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 campaigning.
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:
{
"customParams": [
{
"name": "purchased",
"value": "yes"
},
{
"name": "country",
"value": "{{order.shippingAddress.country}}"
},
{
"name": "city",
"value": "{{order.shippingAddress.city}}"
}
],
"name": "{{order.customer.displayName}}"
}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
1. What is this automation used for?
This automation helps you automatically sync customers who have made a purchase on Shopify to Wati, so you can run targeted marketing campaigns without manual data exports.
2. Do I need to manually export customer data from Shopify?
No. The workflow uses Shopify Flows and the Wati API to automatically send customer details to Wati.
Shopify workflow setup
3. What Shopify trigger is used to identify a purchase?
The workflow uses the Order Paid trigger by default. You can also use Order Created if that better matches your business process.
4. Can I target only first-time purchasers?
Yes. You can add a condition that checks if the customer’s number of orders is less than or equal to one.
Wati API integration
5. What customer information is sent to Wati?
The workflow sends the customer’s name, phone number, and custom parameters such as purchase status, country, and city.
6. How is the customer added to Wati?
Shopify sends an HTTP POST request to the Wati API endpoint, which creates or updates the contact in Wati.
7. Where do I get the Wati API token and endpoint URL?
Both the API token and endpoint URL are available in your Wati account settings.
Technical requirements
8. What HTTP method is used in the Shopify Flow?
The workflow uses the POST method to send customer data to Wati.
9. Why is the phone number included in the API URL?
The phone number is used to uniquely identify the contact when adding or updating the customer in Wati.
10. Is this workflow suitable for ongoing campaigns?
Yes. Once set up, the workflow runs automatically for every qualifying order, keeping your Wati contacts up to date for future campaigns.




