Inputting customer information into two separate platforms is cumbersome. For example, if you used Quickbooks to store customer data, and also wanted that same data to be entered into Kintone, you’d find yourself performing double-entry. Let’s go over how we can use Zapier to create Kintone records from new Quickbooks entries, and how we can update Kintone every time a change is made in Quickbooks.
NOTE: Uploading attachment files to Kintone requires an extra action with Webhooks by Zapier, which will be covered in a separate article.
Agenda:
- Overview
- New customer Zap
- Update customer Zap
- Conclusion
Overview:
A “Zap” is a series of steps in Zapier, which is started by a trigger. To sync the data between Kintone and Quickbooks, we need to trigger the Zap, and send an object of customer data from one platform to the other. In this case, we will be sending an object of customer data from Quickbooks to Kintone.
The Quickbooks user creates a customer first before updating it, so that is the first Zap we will create. It will be triggered when a customer is created in Quickbooks. A Trigger action “New Customer in Quickbooks Online” will initiate the Zap.
We will need to make an entire separate Zap to handle the second part of the use case; update Kintone when a customer in Quickbooks is updated. That will be covered in the second part of this tutorial. A Trigger action “Update Customer in Quickbooks Online” will initiate the second Zap.
Let’s get started on the first Zap.
New Customer Zap:
Make sure your Kintone app has the necessary fields to capture the Quickbooks customer data. For this tutorial, we will be passing the following data from Quickbooks into Kintone:
- Company Name
- Company Address
- Company Phone
This is how the List View would appear in Kintone, where we are capturing customer data into a “Companies” app.
In your apps, remember to rename the field codes in Kintone to something familiar. Zapier uses these field codes in the mapping menu, so renaming them will make it easier to identify where to place the record values.
In the main menu of Zapier, we will select “New Zap” and name it “New Customer”.
First we will create the trigger of the New Customer Zap. When a new customer is created, the Zap will be started.
For the next step of the New Customer Zap, we will create a record in Kintone. Press the plus button under the trigger step to add the Kintone step called “Create Record”.
The company_id will come from the Quickbooks record ID.
Now I will save and submit the Zap. It should be ready to listen for a new customer in Quickbooks. Let’s add a new customer to test the Zap.
Once we have created a new customer record, Zapier should have captured the data. Go to the Zap, and click “Edit this Zap”. The first step, the trigger, should allow you to see the most recent customers created. Select the customer record, click “Continue with this record”, and move onto the next step. The “Create Record in Kintone” step will have a button to “Test This Step”.
Click “Test this Step”.
Click “Publish” and exit this Zap. In the main menu, select “New Zap” and name it “Update Customer”.
The first Zap was successful, so now we’ll move onto the next Zap.
Update Customer Zap:
The second Zap will be very similar, except for one extra action. To update a customer record in Kintone, we need to use the customer ID from Quickbooks to find the existing record. To do that, we will use a request called a “query”, via a Kintone API endpoint.
The Zap will be triggered when a customer in Quickbooks is updated. Set the trigger event by adding the action called “Updated Customer in Quickbooks Online”.
As the following action, add Webhooks by Zapier. Set the event to “GET”. This will allow us to get the Kintone record with a request. Zapier will allow us to provide the Customer ID as a key, to get the Kintone record of the company we need to update.
Next, we need to add the endpoint. Replace your subdomain, your app id and the field code of the Kintone Company ID field in the following URL:
https://{your-subdomain}.kintone.com/k/v1/records.json?app={your-app-id}&query=company_id%20%3D%20"{Quickbooks Customer ID Tag}”
— Get Record — Kintone Developer Program
Add the URL to the Webhooks action with the Quickbooks Customer Id tag.
At the bottom of the action, add the API key of the Kintone Companies app with the header “X-Cybozu-API-Token”.
Click continue, to go to the Test section of this step. Click “Test this Step”, and the window should return information about the Kintone record that contains that company ID.
The third step in the Zap will be a Kintone step. Add the step called “Update Record by Record ID”. This will allow us to update the Kintone record by using the Kintone record number we retrieved with the last step.
The Kintone record number will be used to update the record. Lower down on the same menu, we will input the customer data that we want to update, such as the phone number and address fields.
After setting all the fields to update in Kintone, we can select Publish and test the Zap. In Quickbooks, find the customer that was created in the first half of the tutorial. Edit their information, such as a phone number or address. The Zap should capture this submission.
Return to the Update Customer Zap and select the trigger. Select the Quickbooks customer record that was just edited. Select “Continue with this record”. Move onto the second step, test the “Get in Webhooks by Zapier” step as well, to find the existing Kintone record (created by the first Zap). Then proceed to the third and final step.
The Kintone customer record will update successfully, and return a Revision number.
We have successfully completed two separate Zaps to handle syncing customer data between Quickbooks and Kintone.
Conclusion:
This tutorial covered how to use triggers and steps to send data between platforms using Zapier. The second Zap we covered also provided a small overview of queries, to get Kintone data. The same principle can be applied for creating or updating Kintone data with Webhooks in Zapier. More of these topics will be covered in future tutorials.
Visit Kintone Developer Program for more tutorials and developer tips. Happy hacking!