How do I sync new data from Zoho CRM to Zoho Billing instantly?
The Zoho Billing-Zoho CRM integration syncs new data every two hours by default. You can also initiate a manual instant-sync by clicking the Instant Sync button from Zoho Billing > Settings > Integrations > Zoho CRM.
However, if you’d like all new data (Accounts and Contacts) from Zoho CRM to be synced to Zoho Billing immediately, you can automate the process by creating a Workflow Rule in Zoho CRM. This rule is essentially a Custom Function, which will sync new Accounts and Contacts to Zoho Billing as soon as they have been created in Zoho CRM.
First, you will need to create a Connection between Zoho Billing and Zoho CRM. This Connection serves to authenticate the communication between Zoho CRM and Zoho Billing. To create this Connection:
- Log in to Zoho CRM.
- Go to Setup > Developer Space > Connections.
Select Zoho Billing.
Insight: If you’ve already created other Connections in Zoho CRM, then click + Add Connection in the top right and select Zoho Billing.
Enter
zohobillingconnection
as both the Connection Name and the Connection Link Name.Select
ZohoBilling.fullaccess.all
as the Scope.Click Create and Connect.
Click Proceed in the pop-up that follows.
Click Accept to finish creating the Connection.
Now the Connection will be created and its status will be Connected, if it was set up properly.
Next, you will have to create a Workflow Rule by following the steps below:
- Go to Zoho CRM > Setup > Automation > Workflow Rules.
- Click + Create Rule.
- Select the Module as either Accounts or Contacts, based on the type of data that you want to sync instantly with Zoho Billing.
- Enter any Rule Name and Description for the rule.
- Select On a record action, for WHEN the rule has to be triggered.
- Select Create or Edit.
- Click Next.
In CONDITION 1, select Accounts matching certain conditions and provide the necessary conditions, if you only want certain types of Accounts to be synced automatically. Select All Accounts if you’d like all new Accounts to be synced automatically.
Insight: This step assumes that you selected Accounts as the module when creating this rule. If you had selected Contacts, then the options shown in Condition 1 would be Contacts matching certain conditions and All Contacts.
Click Next.
Select Function under the Instant Actions drop-down.
Select Write your own function in the pop-up, or click + New Function if you’ve already created a function before.
Provide any Function Name, Display Name, and Description.
Click Create.
Click Edit Arguments from the top of the Deluge editor.
Enter
referenceID
as the Key.Place your cursor in the Param Value field and enter
#
.Select the Module as Accounts in the drop-down that appears, and select the Field as Account Id.
Insight: If you are creating this rule for Contacts, then you will have to select the Module as Contacts and the Field as Contact Id.
Click Done and then click Save.
Now copy and paste one of the following scripts into the Deluge editor, based on the Module that you selected.
Deluge Script for Contacts:
orgID = ""; url = "https://billing.zoho.com/api/v1/crm/contact/import?reference_id=" + referenceID + "&organization_id="+orgID; response = invokeurl [ url :url type :POST connection:"zohobillingconnection" ]; info response;
Deluge Script for Accounts:
orgID = ""; url = "https://billing.zoho.com/api/v1/crm/account/import?reference_id=" + referenceID + "&organization_id="+orgID; response = invokeurl [ url :url type :POST connection:"zohobillingconnection" ]; info response;
Enter your Zoho Billing’s organization ID in the first line of this script within the quotes. You can find your organization ID by going to Zoho Billing and clicking the name of your organization in the top right corner.
Click Save in the top right corner and click Save again in the screen that follows.
Now, new Accounts/Contacts will be synced instantly with Zoho Billing as soon as they are created in Zoho CRM.