Deluge Tasks

Create records in Zoho Invoice

Overview

The zoho.invoice.create task is used to create a new record with specified value in the required Zoho Invoice module.

Syntax

<response>=zoho.invoice.create(<module_name>,<org_ID>,<params>);

where,

ParamsData typeDescription

<response> 

KEY-VALUE

specifies the response returned by Zoho Invoice

<module_name>

TEXT

specifies the Zoho Invoice's module in which the record will be created

  • Contacts

  • Invoices

  • Customerpayments

  • Items

  • Estimates

  • Expenses

  • Projects

  • Expensecategories

<org_ID>

TEXT

specifies the organization ID as specified in Zoho Invoice

<params>

KEY-VALUE

specifies the values of the record that needs to be updated. The key is the label name of the field against the required value.

Example

The following script creates a new record in the Zoho Invoice module - Customerpayments.

 CusPayMap=map();
 CusPayMap.put("customer_id","13144XXXXXXXXXXXX");
 CusPayMap.put("payment_mode","cheque");
 CusPayMap.put("amount","450");
 CusPayMap.put("date","2017-01-01");
 response=zoho.invoice.create("Customerpayments", "5368XXXX",CusPayMap);

where,

CusPayMap
is the KEY-VALUE variable that holds the values of the record that needs to be created
 "customer_id"
 "payment_mode"
 "amount"
 "date"
are the TEXT that represents the label names of fields specified in Zoho Invoice's API
"Customerpayments"
is the TEXT that represents the module in which the record needs to be created
"5368XXXX"
is the TEXT that represents the organization ID of the Zoho Invoice account in which the record needs to be created

Response Format

Success Format

  • The response returned is of the following format:

    {  
       "payment":{  
          "date":"2017-01-01",
          "can_send_in_mail":true,
          "documents":[  

          ],
          "discount_amount":0.0,
          "is_payment_details_required":true,
          "attachment_name":"",
          "is_client_review_settings_enabled":false,
          "description":"",
          "currency_code":"INR",
          "online_transaction_id":"",
          "page_width":"8.27in",
          "bank_charges":0.0,
          "invoices":[  

          ],
          "payment_id":"13144XXXXXXXXXXXX",
          "tax_amount_withheld":0.0,
          "custom_field_hash":{  

          },
          "template_type":"elite",
          "product_description":"",
          "last_four_digits":"",
          "payment_mode":"check",
          "amount":450.0,
          "orientation":"portrait",
          "exchange_rate":1.0,
          "custom_fields":[  

          ],
          "payment_refunds":[  

          ],
          "card_type":"",
          "reference_number":"",
          "template_name":"Elite Template",
          "template_id":"13144XXXXXXXXXXXX",
          "customer_name":"Bowman and Cos",
          "unused_amount":450.0,
          "customer_id":"13144XXXXXXXXXXXX",
          "is_pre_gst":true,
          "currency_id":"13144XXXXXXXXXXXX",
          "page_height":"11.69in"
       },
       "code":0,
       "instrumentation":{  
          "response_write_time":11,
          "query_execution_time":28,
          "page_context_write_time":0,
          "request_handling_time":1012
       },
       "message":"The payment from the customer has been recorded"
    }

Failure Response

  • The failure response returned due to incorrect organization ID is of the following format:

              {  
                 "code":6041,
                 "message":"This user is not associated with the CompanyID/CompanyName:537XX."
             }

Related Links

Share this post : FacebookTwitter

Still can't find what you're looking for?

Write to us: support@zohodeluge.com