Choose where you’d like to start

Update record in Zoho Billing

Overview

This task is used to update a record in Zoho Billing using the record ID. This task is based on Zoho Billing API <ModuleName> -> Update a <ModuleName>.

Syntax

<variable> = zoho.billing.update(<moduleName>, <organization_id>, <record_ID>, <data_map>, <connection>);

where:

Params Data typeDescription

<variable> 

KEY-VALUE

is the variable which will hold the response returned by Zoho Billing.

<module_name>

TEXT

is the name of the module in Zoho Billing where the record will be updated.

<organization_id>

TEXT

Org id of the organization in which the record will be updated.

Note: Learn how to fetch organization ID from the UI and from the response of zoho.billing.getOrganization task.

<record_ID>

 

TEXT

ID of the record which will be updated.

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

<data_map>KEY-VALUE

Key-value pairs with key as the field name in Zoho Billing and value as its updated value.

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

<connection>

TEXT

specifies the link name of the Zoho Billing connection.

Note:

  • In view of stopping new authtoken generation, a Zoho OAuth connection with appropriate scopes is mandatory in order for new integration tasks (created after the deadline specified in the post) to work as expected. Existing integration tasks will continue to work with or without the connections parameter until you manually delete the authtoken from accounts.
  • Add relevant scopes mentioned in Zoho Billing API while creating the connection.
  • Refer to this post for the list of Zoho services that support the connections page.
  • Learn more about connections

Example: Update record in Zoho Billing

When the following script gets executed, the specified record is updated in the "Subscriptions" module in Zoho Books.

 values = Map();
 values.put("plan_code", 101);
 
 response = zoho.billing.update("Subscriptions", "66XXXX66", "52849000000170032", values, "billing_connection");

where:

response
is a MAP variable that holds the response returned by the Zoho Billing API
values
is a MAP variable which hold key value pairs required to update a subscription
"Subscriptions"
is the TEXT that represents the module in which the record that will be updated
"66XXXXX66"
is the TEXT that represents the organization ID of the Zoho Billing account in which the record that will be created
 "52849000000170032"
is a TEXT that represents the ID of the record that will be updated
"billing_connection"
is the TEXT that represents the link name of the Billing connection

Sample Response

The following is a sample success response:

{  
   "message":"Subscription has been updated successfully.",
   "subscription":{  
      "subscription_id":"115888000000047005",
      "payment_terms":0,
      "interval":1,
      "product_id":"115888000000037018",
      "payment_terms_label":"Due on Receipt",
      "next_billing_at":"2015-04-10",
      "product_name":"zoho",
      "current_term_starts_at":"2015-03-10",
      "customer":{  
         "payment_terms":0,
         "payment_terms_label":"",
         "zcrm_account_id":"",
         "shipping_address":{  
            "zip":"",
            "fax":"",
            "street":"",
            "state":"",
            "country":"",
            "city":""
         },
         "first_name":"",
         "display_name":"ram",
         "email":"ram.s@gmail.com",
         "company_name":"",
         "zcrm_contact_id":"",
         "last_name":"",
         "customer_id":"115888000000046001",
         "billing_address":{  
            "zip":"",
            "fax":"",
            "street":"",
            "state":"",
            "country":"",
            "city":""
         }
      },
      "interval_unit":"months",
      "updated_time":"2015-03-10T11:06:10+0530",
      "current_term_ends_at":"2015-04-10",
      "amount":1000,
      "salesperson_name":"",
      "name":"zoho-monthly",
      "reference_id":"",
      "salesperson_id":"",
      "currency_symbol":"Rs.",
      "activated_at":"2015-03-10",
      "currency_code":"INR",
      "custom_fields":"[]",
      "child_invoice_id":"115888000000046015",
      "status":"live",
      "addons":"[]",
      "last_billing_at":"2015-03-10",
      "contactpersons":[  
         {  
            "phone":"",
            "email":"ram.s@gmail.com",
            "zcrm_contact_id":"",
            "contactperson_id":"115888000000046003",
            "mobile":""
         }
      ],
      "expires_at":"",
      "plan":{  
         "tax_name":"",
         "setup_fee":0,
         "price":1000,
         "tax_type":"",
         "name":"monthly",
         "tax_id":"",
         "quantity":1,
         "tax_percentage":"",
         "plan_code":"monthly"
      },
      "created_time":"2015-03-10T11:00:18+0530",
      "taxes":"[]",
      "auto_collect":false
   },
   "code":0
}

The following is a sample failure response:

{  
   "message":"The action is not allowed for this profile as there are no changes made in the plan or addons.",
   "code":26005
}

Related Links

Get Started Now

Execute