Summary
Do you want to run marketing campaigns for customers who have previously purchased from you? Instead of manually exporting and importing customer data from Shopify to Wati, you can automate the process using Shopify Flows and the Wati API. This guide walks you through setting up an automated workflow that identifies customers who have made a purchase and syncs their details to Wati for targeted broadcasting.
Instructions
Setting Up the Shopify Workflow
1. Create a Custom Automation in Shopify
Log in to your Shopify account.
In the side navigation bar, go to Marketing > Automations.
Click Create automation > Create custom automation.
In the search bar, look for Order Paid and select it.
If your business workflow identifies a purchase differently, choose the appropriate trigger (e.g., Order Created).
2. Add a Condition for First-Time Purchasers (Optional)
If you only want to target first-time customers:
Click on Then in the Order Paid node.
Click Add criteria, then search for order > customer > numberOfOrders.
Set the condition to less than or equal to 1.
3. Send Customer Data to Wati via API
Click Then and add an Action.
Search for HTTP and select Send HTTP request.
Retrieve your Wati API endpoint URL and API token.
In the Body section of the HTTP request, paste the following JSON:
{
"name": "{{order.customer.displayName}}",
"customParams": [
{
"name": "purchased",
"value": "yes"
},
{
"name": "country",
"value": "{{order.shippingAddress.country}}"
},
{
"name": "city",
"value": "{{order.shippingAddress.city}}"
}
]
}
Under Headers, add:
Authorization: Paste your Wati API token.
Content-Type: Set to
text/json
.
Set the HTTP Method to
POST
.In the URL field, enter:
https://watiendpointURL/api/v1/addContact/{{order.phone | remove: "+"}}
Frequently Asked Questions (FAQs)
General Questions
What is the purpose of this automation? → This automation allows you to sync customer data from Shopify to Wati automatically, enabling targeted marketing campaigns for customers who have made a purchase.
Do I need any coding knowledge to set up this workflow? → No, this setup uses Shopify Flows and Wati’s API without requiring coding skills. You just need to configure Shopify and input the correct API details.
Setting Up the Workflow
How do I create a custom automation in Shopify?
Log in to Shopify and go to Marketing > Automations.
Click Create automation > Create custom automation.
Search for Order Paid and select it as the trigger.
Can I use a different trigger instead of Order Paid? → Yes, if your workflow identifies a purchase differently, you can choose another trigger, such as Order Created.
How do I filter first-time purchasers?
Click Then in the Order Paid node.
Click Add criteria, then search for order > customer > numberOfOrders.
Set the condition to less than or equal to 1.
Sending Data to Wati
How do I send customer data to Wati?
Click Then and add an Action.
Search for HTTP and select Send HTTP request.
Retrieve your Wati API endpoint URL and API token.
Configure the HTTP request as outlined in the instructions.
What JSON format should I use in the HTTP request?**Use the following JSON:
{
"name": "{{order.customer.displayName}}",
"customParams": [
{
"name": "purchased",
"value": "yes"
},
{
"name": "country",
"value": "{{order.shippingAddress.country}}"
},
{
"name": "city",
"value": "{{order.shippingAddress.city}}"
}
]
}
Authorization: Paste your Wati API token.
Content-Type: Set to
text/json
.
3. What should I enter in the URL field?**Use the following format:
https://watiendpointURL/api/v1/addContact/{{order.phone | remove: "+"}}
Troubleshooting
What if my automation is not working?
Double-check that your API token and endpoint URL are correct.
Ensure that the HTTP request body is formatted properly.
Verify that Shopify Flows is set up with the right trigger and conditions.
Check Shopify’s logs for any errors in execution.