Recipes · 2 min read · For everyone
COD order confirmation call
An AI voice agent calls every cash-on-delivery order a few minutes after it's placed, confirms or cancels it, and tags the order in Shopify.
At the end you'll have a journey that, five minutes after a cash-on-delivery (COD) order, calls the customer, confirms the order (tag cod-confirmed) or cancels it with the reason, and sends a WhatsApp message if nobody answers. Fewer fake orders and fewer returned parcels.
Before you start#
- Your Shopify store connected under Settings → Integrations (see Shopify), with Order placed events on. To confirm or cancel orders, the app needs the
write_orderspermission. - Telephony set up under Voice Agents → Telephony with a caller ID (see Telephony), and Voice minutes in Usage & Plan.
- For the fallback message: WhatsApp connected and an approved template, for example "Hi {{1}}, please confirm your order {{2}} of ₹{{3}}" with Confirm and Cancel buttons.
Steps#
Create the voice agent
Open Voice Agents → Agents and create an agent named
COD confirmation(Copilot can build it: "An agent that confirms cash on delivery orders in Hindi or English").In Start Call:
- Greeting:
Namaste {{first_name}}, this is Riya from Asian Footwears about your order {{order_name}}.(use your store's name) - Prompt:
Confirm the customer wants the order of {{total_price}} rupees delivered with cash on delivery. If yes, thank them. If they want to cancel, ask why politely. - Enable Variable Extraction:
confirmed(Boolean),cancel_reason(String).
- Greeting:
Create the journey
Open Engage → Journeys → New Journey. Choose the trigger Events, event
Purchase, with the conditionpayment_methodiscod. Set the delay to 5 minutes and addshopify.order.cancelledas an exit event, so a cancelled order isn't called.Add the call
Add a Call step: choose the
COD confirmationagent and phone{{context.phone}}. List the variables the agent's prompts use (first_name,order_name,total_price) so they're filled from the order event, andconfirmedandcancel_reasonas outcomes to bring back into the journey.Act on the answer
From the call's completed exit, add a Condition:
{{context.confirmed}}is true.- true → Shopify step, action Confirm order (adds the tag
cod-confirmed). - false → Shopify step, action Cancel order, reason from
{{context.cancel_reason}}(only unpaid, unshipped orders can be cancelled).
- true → Shopify step, action Confirm order (adds the tag
Handle no answer
From the call's no_answer, busy and voicemail exits, add a WhatsApp step with your confirmation template, then Wait for reply (24 hours): the Confirm button → Shopify Confirm order; Cancel → Cancel order; timeout → Shopify Tag order with
not-reached.Set allowed hours and go live
In the journey's Workflow Settings, set Allowed hours for calls (for example 10:00 to 19:00). Then Go live.
Check it worked#
- Place a test COD order on your store with your own phone number.
- Within about 5 minutes your phone rings. Answer and confirm.
- Insights → Runs → Journey Runs shows the run with each step; Agent Calls shows the call with
confirmed = true. - In Shopify, the order has the tag
cod-confirmed.
Common problems#
| What you see | Fix |
|---|---|
| No run starts | Check Order placed is ticked in the Shopify integration's Store events, and the order's payment method name contains cash on delivery or cod (see Cash-on-delivery payment methods) |
| The run waits at the Call step | Outside allowed hours, or all phone lines busy. See Journeys troubleshooting |
| "The caller ID is not on the provider account" | See Calls and telephony |
| Shopify step fails | Cancelling a paid or shipped order isn't allowed by Shopify. Tag it instead |
Was this page helpful?
Docs