How CODFlip Builds & Sends a WhatsApp Nudge
“CODFlip sends a WhatsApp nudge” is one sentence covering six real steps: a webhook, a cost estimate, a discount calculation, a message assembly, a timing check, and a send that has to survive Shopify retrying itself. Here is what actually happens between an order being placed and a customer's phone buzzing.
In this guide
- This Is About the Pipeline, Not the Schedule
- Step 1: The Trigger
- Step 2: Scoring the Order
- Step 3: Calculating the Offer
- Step 4: Assembling the Message
- Step 5: The Timing Gate
- Step 6: Sending, Logging, and Billing
- Why a Retry Can Never Double-Send
- What Happens If a Step Fails
- Where to Learn More
- Frequently Asked Questions
- Sources
TL;DR
A COD order triggers CODFlip in real time through Shopify's order-creation webhook. From there: RTO cost is estimated (forward shipping, return shipping, restocking, and goods at risk), a discount is calculated (a flat rule, or Pro's Smart Incentive Engine), the message is assembled with a payment link, a Quiet Hours check decides exactly when it can send, and the send itself is logged for both the Dashboard and billing. Every one of these steps is keyed to the specific order and message type, so a webhook Shopify retries, which does happen, can never cause a duplicate message or a duplicate charge.
This Is About the Pipeline, Not the Schedule
We already covered exactly when a nudge sends, Quiet Hours, Expiry Reminders, and Per-Product Timing overrides, in Best Time to Send WhatsApp COD Offers (2026). This post is about what happens before and after that scheduling decision: the actual pipeline that turns a placed order into a delivered WhatsApp message, and the reliability guarantees that keep it from misfiring under Shopify's own webhook retries.
Step 1: The Trigger
Everything starts with Shopify's order-creation webhook. The moment a customer checks out with Cash on Delivery, either through Shopify's default checkout or CODFlip's own Payment Picker, Shopify notifies CODFlip immediately. This is what makes the whole pipeline event-driven rather than running on a delayed batch job: RTO scoring and offer calculation start within moments of the order actually existing, not on the next scheduled sync.
Step 2: Scoring the Order
CODFlip estimates the order's RTO cost the instant it is created: forward shipping, return shipping, restocking, and (on Pro) real per-product margin data instead of a store-wide estimate. We covered exactly how each of these inputs is calculated in COD to Prepaid Shopify App: CODFlip Features (2026). The output of this step is a single number: what this specific order would cost the store if it came back undelivered, which is the input every later step depends on.
Step 3: Calculating the Offer
With an RTO cost estimate in hand, CODFlip calculates a discount using one of two modes: a Flat Discount (the same fixed percentage or ₹ amount for every qualifying order), or, on Pro, the Smart Incentive Engine, which weighs the order's RTO cost, its value, and the customer's purchase history, capped against the store's margin. We wrote a full comparison of the two approaches in Personalized vs Flat Discount: COD to Prepaid (2026).
Step 4: Assembling the Message
Once the discount amount is set, CODFlip generates a one-tap payment link for the discounted total and slots it into the correct pre-approved WhatsApp message template. Three message types exist for different points in an order's lifecycle: the main nudge (the core offer), the Expiry Reminder (a last-chance message before the discount lapses), and the Partial-Balance Reminder (for Partial COD orders, framed as a balance owed rather than a discount).
Why a template, not a freeform message: WhatsApp's Business Platform requires business-initiated messages outside an active customer conversation window to use a pre-approved template, categorized by Meta as marketing, utility, or authentication1. CODFlip's nudge is built to fit that requirement rather than sending arbitrary text, which is also part of why per-message cost varies by what the message is for, as covered in CODFlip Pricing: COD App Plans & WhatsApp Costs (2026).
Step 5: The Timing Gate
Before the assembled message actually goes out, it passes through the scheduling logic covered in detail in Best Time to Send WhatsApp COD Offers (2026): a configurable delay after order creation (4 hours by default), a check against Quiet Hours (held and released the moment the window ends rather than sent overnight), and, on Pro, any Per-Product Timing Rule that might override that window entirely for a specific product or tag.
Step 6: Sending, Logging, and Billing
Once the timing gate clears, the message is sent over WhatsApp. Every send is logged twice, once to the message log on Analytics (sent, converted, pending, or failed), and once against the store's billing usage, checked against the current cycle's free quota before a usage charge is applied. We covered the full billing mechanics, including how the free quota and overage rate work, in CODFlip Pricing: COD App Plans & WhatsApp Costs (2026) and how the resulting numbers are surfaced in CODFlip Dashboard: Reading RTO Savings (2026).
Why a Retry Can Never Double-Send
Shopify itself can retry a webhook delivery, for its own reliability reasons, which means CODFlip has to assume any given order-creation event might arrive more than once. The way this stays safe is that every action taken in response, sending a specific message type, or applying a specific usage charge, is keyed to the exact order, message type, and day it belongs to. A duplicate webhook delivery is recognized against that key and skipped, rather than triggering a second send or a second charge.
This is the same principle Partial COD relies on when it edits a real Shopify order behind the scenes using Shopify's own Order Edit API, covered in Partial COD (Half COD) for Shopify: Reduce RTO (2026): the operation is idempotent, so it cannot double-charge or duplicate the order even if the same webhook fires twice.
For example. Shopify retries an order-creation webhook because the first response took slightly too long to acknowledge. CODFlip receives the event a second time, checks it against the order ID and message type already logged, sees the main nudge was already sent for this order, and simply does nothing on the second delivery. The customer's phone buzzes once, not twice.
What Happens If a Step Fails
Two failure modes are handled explicitly rather than silently dropped. If a usage charge is rejected because a store's approved spend cap for the cycle has been reached, that specific message is skipped, since the merchant has explicitly capped spend. If the failure is instead because the store's Shopify subscription payment has failed and is temporarily frozen, the nudge is queued and retried automatically an hour later, resuming as soon as the payment issue clears, with no manual re-activation step required.
Where to Learn More
For the full feature-by-feature breakdown this pipeline sits underneath, see COD to Prepaid Shopify App: CODFlip Features (2026).
Frequently Asked Questions
What actually triggers a CODFlip nudge?
The Shopify order-creation webhook. The moment a COD order is placed, Shopify notifies CODFlip in real time, which is what lets RTO scoring and offer calculation happen immediately rather than on a delay waiting for a batch job to run.
Can a customer get charged or messaged twice if Shopify retries a webhook?
No. Every action CODFlip takes in response to an order event, whether it's sending a message or applying a usage charge, is keyed to the specific order, message type, and day, so a duplicate webhook delivery is recognized and skipped rather than reprocessed.
Does the WhatsApp message send instantly when the order is placed?
No, by default there's a configurable delay (4 hours out of the box) between order creation and the main nudge sending, and the send is also subject to the Quiet Hours check before it actually goes out.
What happens if the WhatsApp send itself fails?
If the failure is due to a temporarily frozen Shopify subscription, the nudge is queued and automatically retried an hour later, resuming as soon as the billing issue clears, with no manual re-activation needed.
Sources
- WhatsApp Business Platform template message categories and pricing, Blueticks, “WhatsApp Business API Pricing in 2026”, and Meta's own WhatsApp Business Platform pricing documentation
See the full feature set this pipeline powers
Read the full feature breakdown, or check out the product page for pricing and setup.