What This Flow Does
When a customer places a COD (Cash on Delivery) order, this flow immediately creates a discounted draft order in Shopify and sends them a WhatsApp message with a payment link.
If they pay within 30 minutes, the draft order becomes their final order and the original COD order gets cancelled. If they don't pay, the draft order is cancelled and their original COD order proceeds normally.
Why You Need This
Reduces RTO (Return to Origin): Prepaid orders have 70-90% lower RTO rates than COD because customers have already paid.
Cuts logistics costs: You avoid COD handling fees charged by shipping partners.
Improves cash flow: Get paid upfront instead of waiting for delivery and remittance.
Increases margins: Even with a 5% discount, prepaid orders are more profitable than COD after factoring in fees and RTO risk.
Tracks revenue attribution: Orders converted from COD to prepaid show up as revenue in this flow's analytics, so you can measure exactly how much it's contributing.
Things to Note
Draft Order Is Created First
The flow creates a draft order with the discount immediately after a COD order is placed; before the customer even sees the offer. This draft order sits in Shopify waiting for payment. If they pay, it becomes the final order. If they don't, it gets cancelled automatically.
Only Targets First-Time COD Orders
The flow checks two conditions before firing:
Payment status is "pending" (not yet paid)
Order tags do NOT contain "cod-to-prepaid"
This prevents targeting:
Orders that have already been through this flow
Draft orders we created previously
Prevents Discount Abuse
After the draft order is created and tagged with "cod-to-prepaid", the flow has a secondary condition check (Condition #6 in the screenshot):
If a customer tries to game the system by placing another COD order to get the discount again, the flow checks:
Does the order contain the "cod-to-prepaid" tag?
Is the financial status "paid"?
If the order is paid: Flow proceeds to cancel the original COD order (legitimate conversion).
If the order is still COD: Flow cancels the new order to prevent them from exploiting the discount.
30-Minute Response Window
If the customer doesn't pay within 30 minutes, the flow cancels the draft order and lets the original COD order proceed normally.
Third-Party Checkouts Won't Work
Customers get directed to your default Shopify checkout page, not your third-party checkout (Fastrr, GoKwik, Razorpay Magic Checkout, etc.).
WhatsApp only allows us to send direct checkout links. Third-party checkout providers can only be accessed when a customer adds items to cart and proceeds through your actual website, there's no way to generate a direct link to those interfaces.
This is a third-party checkout limitation, not a Spur one.
How It Looks In Action
The flow triggers on COD order creation, immediately creates a discounted draft order, sends a payment link, waits 30 minutes, then either cancels the original COD order (if paid) or cancels the draft order (if unpaid).
How Each Step In The Flow Works
1. Trigger: Shopify Order Created
Fires whenever any COD order is placed on your Shopify store. The flow also filters for COD orders in the next step. (To ensure whether the person hasn't already paid for the COD order after placing it)
2. Condition Check #5: Is This a Fresh COD Order?
Checks:
{{trigger.financial_status}}
is "pending" (not paid yet){{trigger.tags}}
does NOT contain "cod-to-prepaid"
If both are true: Flow continues (this is a new COD order that hasn't been targeted before)
If either is false: Flow moves to Condition #6 to check if this is a converted order trying to abuse the discount
3. Action #1: Create Draft Order with Discount
Creates a Shopify draft order with:
Discount: 5% (or custom percentage)
Discount Type: PERCENTAGE
Saves draft order URL in flow column
new_checkout_url
Saves draft order ID in column
draft_order_id
Sets attribute name:
old_order_id
(links back to original COD order)Adds tag: "cod-to-prepaid" to the original order
This draft order is created immediately, before the customer even sees the offer.
4. Send Message #2: Offer Prepaid Discount
Message:
"Hello {{name}},
Thank you for placing your order with us! Your Order {{order_id}} for {{currency}}{{total}} is confirmed and on its way to you.
To sweeten the deal, we're offering an exclusive {{discount}}% discount if you choose to pay online now. Click the button below to secure your savings and complete your payment."
CTA Button: "Claim Discount & Pay Now"
(Links to {{media_url}}
- the draft order checkout URL)
5. Delay #2: Wait 30 Minutes
Gives the customer time to see the offer and complete payment.
6. Condition Check #6: Did They Pay? (First Path)
This runs for all orders that get created that don't match the conditions in Condition Check #5 (Is This a Fresh COD Order?)
β
It does that by checking if {{trigger.tags}}
contains "cod-to-prepaid" tag meaning it's checking whether this is a not a fresh order that just came through, and that instead it's a draft order that we created in the previous run of this flow for the original order that came in earlier
If YES (tag is present):
Moves to Condition #7 to check payment status. (To check whether customer made a prepaid order with the 5% discount checkout link given.)
If NO (tag is missing):
Something went wrong or flow was interrupted. Stops here.
7. Condition Check #7: Is Payment Complete?
Checks if {{trigger.financial_status}}
is "paid"
If YES (order is paid):
Customer completed payment on the draft order. Flow proceeds to Action #8 to cancel the original COD order.
If NO (still pending):
Customer didn't pay within 30 minutes. Flow proceeds to Action #9 to cancel the draft order. Original COD order continues.
8. Action #8: Cancel Original COD Order
Cancels the original COD order using {{trigger.computed.note_attributes['old_order_id']}}
Prevents duplicate shipments. The paid draft order becomes the final order.
Revenue from this conversion shows up in the flow analytics.
9. Action #9: Cancel Draft Order (If Unpaid)
If the customer didn't pay within 30 minutes, this cancels the draft order to keep Shopify clean. The original COD order proceeds normally.
Alternative Path: Condition #6 (Discount Abuse Prevention)
If Condition #5 doesn't match (order already has "cod-to-prepaid" tag), the flow checks:
Does the order contain "cod-to-prepaid" AND is it paid?
If YES: This is a legitimate prepaid conversion. Proceed to cancel the original COD order.
If NO: Customer tried to place another COD order to exploit the discount. Cancel this new order to prevent abuse.
Setup Tips
Adjust the discount: 5% is a starting point. Test 10% if your margins allow, higher discounts convert more COD customers.
Customize the message: Match your brand tone. Some brands add urgency ("Offer expires in 30 minutes!").
Check template approval: This is a marketing message and needs Meta approval before sending.
Monitor conversion rate: Check flow analytics to see how many COD orders convert to prepaid and how much revenue it's generating.
Test the full flow: Place a test COD order, wait for the message, click the button, complete payment, and verify the original order gets cancelled and the draft order becomes final.
Questions? Ping us in chat and we'll help you optimize conversion rates.