How to Set Up Shopify Workflows Using Mercuri CX

Use case: Set Up Cart Abandonment WhatsApp Reminder Workflow in Shopify Using Mercuri API

Cart abandonment reminders help re-engage customers who added items to their cart but didn’t complete their purchase. Follow the steps below to automate a WhatsApp reminder using Shopify Flow and the Mercuri API.


Steps to Create the Workflow

  1. Go to your Shopify Admin Dashboard.

  2. From the left-hand side panel, click on Apps, then select Flow, or search for Flow using the app search bar.

  3. Once the Flow dashboard opens, click on Create Workflow in the top-right corner of the screen.

  4. You’ll be prompted to either Select a Trigger or Browse Templates — click on Select a Trigger.

  5. You’ll now see the workflow dashboard. To start building your automation, select a trigger.

  6. In the search bar, type “Customer abandoned checkout” and choose it from the list.

  7. This trigger activates the workflow whenever a customer adds items to their cart but doesn’t complete the checkout process.

  8. After setting the trigger, click the “+” button to add the next step.

  9. Select Action → Wait (under Flow). Set the waiting time to 1 hour.This ensures the WhatsApp reminder will be sent one hour after the cart is abandoned.

  10. Click the “+” icon again below the wait step.

  11. Select Action → Send HTTP Request.

  12. In the flow action, configure:

  • HTTP Method: POST

  • URL: https://api.mercuri.cx/v1/send_message

  • Headers:

  • Key: Authorization

  • Value: Bearer Bearer ${bearerToken} . Replace the ${bearerToken} with the secret key.

  • Body: Paste the JSON payload for your WhatsApp reminder message (example below).

Request (Payload)
{
   "phoneNumberId":"xxxxxxxxxxx",
    "channel":"whatsapp",
    "recipient":"+918971476855",
    "message":{
        "type":"template",
        "template":{
            // "templateId":"1777667316490397",
            "templateId":"xxxxxxxxxxxxx",
            "parameters":[
                {
                    "otpCode":"xxxxxxxxxxx",
                    "businessPhoneNumber":"xxxxxxxxxxx"
                    "firstName" : "xxxxxxxxxxx",
                    "lastName" : "xxxxxxxxxxx",
                    "businessName" : "xxxxxxxxxxx",
                    "orderNumber" : "xxxxxxxxxxx",
                    "orderTotal" : "xxxxxxxxxxx",
                    "expirationTime":"xxxxxxxxxxx",
                    "couponCode":"xxxxxxxxxxx"
                }
            ]
        }
    },
    "country":"US",
    "saveToInbox":true
}
}

Note:🔧 Changes to Make After Copy-Pasting the Code

  1. Add Your Phone Number ID

  • Replace "xxxxxxxxxxxxxxxxxxx" corresponding to phoneNumberId in the code with the Phone Number ID you copied from the Mercuri Dashboard.

  1. Add Your Template ID

  • Replace "xxxxxxxxxxxxxxxxxxx" corresponding to templateId with the Template ID you copied from the Mercuri Dashboard.

Please click on this link to view the instructions for locating the Phone Number ID and Template ID.

  1. Add recipient :

  • Click the Add Variable button at the bottom-right of the body box, search for phone number, and select it.

  • This variable automatically fetches the customer’s phone number to send the cart abandonment message.

  1. Add Template Variables :

Based on your message template:

  • Add the corresponding parameters and values so they dynamically populate for each customer.

  • For this tutorial, we’ve included a single variable — the customer’s first name. To add it:

  • Click Add Variable at the bottom of the text box and search for First Name.

  1. You’ve now successfully set up the Cart Abandonment Reminder Workflow.

  2. Click Turn On Workflow at the top-right corner to activate it.

  3. When prompted for confirmation, click Turn On again.

Last updated