Update record

Update records in Zoho Invoice

Overview

This task is used to update a record in Zoho Invoice using the record ID.

Syntax

<variable> = zoho.invoice.update(<module_name>, <org_ID>, <record_ID>, <data_map>);

where,

Params Data typeDescription

<variable> 

KEY-VALUE

specifies the variable which will hold the response returned by Zoho Invoice.

<module_name> 

TEXT

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

Following are the applicable modules.

ContactsInvoicesCustomer PaymentsItems
EstimatesExpensesExpenseCategory

Projects

(applicable to all Zoho services except Zoho Creator)

<org_ID>

TEXT

specifies the organization ID of the account in which the record will be updated.

<record_ID>

TEXT

specifies the ID of the record which will be updated.

Learn how to fetch the record ID after creating or fetching records.

<data_map>

KEY-VALUE

Map key-value pairs with key as field name in Zoho Invoice and value as its updated value. 

To learn about the field names in Zoho Invoice, click here and go to <ModuleName> -> Update <ModuleName>

Example

The following script updates a record in the Zoho Invoice module - Contacts with record ID - 13144XXXXXXXXXXXX.

 contactMap = map();
 contactList=List();
 contactMap1=map();
 contactMap1.put("first_name","Bettie");
 contactMap1.put("last_name","Bee");
 contactMap2=map();
 contactMap2.put("first_name","Carol");
 contactMap2.put("last_name","Kaye");
 contactList.add(contactMap1);
 contactList.add(contactMap2);
 contactMap.put("contact_persons",contactList);
 response = zoho.invoice.update("Contacts", "5368XXXX", "13144XXXXXXXXXXXX",contactMap);

where,

contactMap 
contactMap1 
contactMap2 
are the KEY-VALUE variables taht holds the new values of the contacts
contactList
is the LIST variable that holds the list of all contacts that need to be updated along with its new values
"first_name" 
"last_name" 
"contact_persons" 
are the TEXT that represents the label names specified in Zoho Invoice's API
"Contacts"
is the TEXT that represents the module that contains the record that needs to be updated
"5368XXXX"
is the TEXT that represents the organization ID of the Zoho Invoice account
"13144XXXXXXXXXXXX"
is the TEXT that represents the ID of the record in that needs to be updated

Note:

  • Records if any, except the ones being updated, will be deleted automatically.

Sample Response

  • The following is a sample success response:

    {  
       "code":0,
       "instrumentation":{  
          "response_write_time":77,
          "query_execution_time":48,
          "page_context_write_time":0,
          "request_handling_time":379
       },
       "message":"Contact information has been saved.",
       "contact":{  
          "is_crm_customer":false,
          "addresses":[  

          ],
          "notes":"",
          "documents":[  

          ],
          "owner_id":"",
          "is_linked_with_zohocrm":false,
          "is_client_review_settings_enabled":false,
          "billing_address":{  
             "zip":"",
             "country":"",
             "address":"",
             "city":"",
             "phone":"",
             "address_id":"13144XXXXXXXXXXXX",
             "attention":"",
             "street2":"",
             "state":"",
             "state_code":"",
             "fax":""
          },
          "default_templates":{  
             "invoice_email_template_id":"",
             "creditnote_email_template_id":"",
             "creditnote_template_name":"",
             "paymentthankyou_email_template_name":"",
             "estimate_template_id":"",
             "paymentthankyou_template_id":"",
             "invoice_email_template_name":"",
             "creditnote_email_template_name":"",
             "invoice_template_id":"",
             "paymentthankyou_email_template_id":"",
             "invoice_template_name":"",
             "estimate_template_name":"",
             "estimate_email_template_id":"",
             "creditnote_template_id":"",
             "paymentthankyou_template_name":"",
             "estimate_email_template_name":""
          },
          "source":"api",
          "outstanding_receivable_amount_bcy":0.0,
          "language_code":"",
          "twitter":"",
          "zcrm_contact_id":"",
          "unused_credits_receivable_amount_bcy":0.0,
          "contact_category":"",
          "associated_with_square":false,
          "contact_persons":[  
             {  
                "can_invite":true,
                "mobile":"",
                "is_added_in_portal":false,
                "last_name":"Bee",
                "contact_person_id":"13144XXXXXXXXXXXX",
                "is_primary_contact":true,
                "is_portal_invitation_accepted":false,
                "skype":"",
                "zcrm_contact_id":"",
                "phone":"",
                "salutation":"",
                "designation":"",
                "photo_url":"https://secure.gravatar.com/avatar/00000000000000000000000000000000?&d=mm",
                "department":"",
                "fax":"",
                "first_name":"Bettie",
                "email":""
             },
             {  
                "can_invite":true,
                "mobile":"",
                "is_added_in_portal":false,
                "last_name":"Kaye",
                "contact_person_id":"13144XXXXXXXXXXXX",
                "is_primary_contact":false,
                "is_portal_invitation_accepted":false,
                "skype":"",
                "zcrm_contact_id":"",
                "phone":"",
                "salutation":"",
                "designation":"",
                "photo_url":"https://secure.gravatar.com/avatar/00000000000000000000000000000000?&d=mm",
                "department":"",
                "fax":"",
                "first_name":"Carol",
                "email":""
             }
          ],
          "pricebook_id":"",
          "outstanding_receivable_amount":0.0,
          "created_time":"2017-11-30T16:08:55+0530",
          "owner_name":"",
          "zcrm_account_id":"",
          "custom_fields":[  

          ],
          "unused_credits_receivable_amount":0.0,
          "has_transaction":false,
          "pricebook_name":"",
          "price_precision":2,
          "primary_contact_id":"13144XXXXXXXXXXXX",
          "checks":[  

          ],
          "company_name":"Billie Beth",
          "crm_owner_id":"",
          "status":"active",
          "cards":[  

          ],
          "contact_id":"13144XXXXXXXXXXXX",
          "payment_terms":0,
          "currency_code":"INR",
          "contact_type":"customer",
          "shipping_address":{  
             "zip":"",
             "country":"",
             "address":"",
             "city":"",
             "phone":"",
             "address_id":"13144XXXXXXXXXXXX",
             "attention":"",
             "street2":"",
             "state":"",
             "state_code":"",
             "fax":""
          },
          "contact_name":"Billie Beth",
          "website":"",
          "is_client_review_asked":false,
          "last_modified_time":"2017-11-30T16:15:49+0530",
          "language_code_formatted":"",
          "currency_symbol":"Rs.",
          "ach_supported":false,
          "facebook":"",
          "vendor_portal_url":"",
          "unused_retainer_payments":0.0,
          "contact_salutation":"",
          "bank_accounts":[  

          ],
          "currency_id":"13144XXXXXXXXXXXX",
          "payment_terms_label":"Due On Receipt",
          "payment_reminder_enabled":true
       }
    }

  • The failure response returned due to incorrect org 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