Payment modes
COD, prepaid incentives and partial payments — how each flow is built.
CODGuard offers up to three payment modes in the storefront modal. You choose which appear.
| Mode | Setting | Default |
|---|---|---|
| Cash on delivery | codEnabled | true |
| Prepaid | prepaidEnabled | true |
| Partial (deposit) | partialEnabled | false |
COD
The shopper verifies, CODGuard builds a Storefront cart of the real items, and returns a checkout URL. The cart carries _codguard_payment=cod along with verification attributes. On orders/create the webhook links the selection, updates analytics, and computes an RTO score.
Prepaid
Identical to COD, plus a discount. Set prepaidDiscountPct and CODGuard creates or reuses a Shopify discount code and applies it to the cart automatically — there are no coupon codes for you to manage. The applied percentage is recorded on the order for reporting.
Pick the rate from your own numbers rather than convention. Compare the discount cost against your RTO rate multiplied by the fully-loaded cost of a failed order.
Partial payments
Collect a deposit at checkout and the balance on delivery. partialUpfrontPct defaults to 30.
The implementation avoids every trap in this pattern:
- It uses a Shopify draft order so the real products check out discounted down to the deposit. No placeholder products, no inventory side effects.
- Variant prices are fetched server-side, so the deposit calculation cannot be tampered with from the browser.
- The balance is split proportionally across cart lines, with the rounding remainder applied to the last line.
- On
orders/create, CODGuard runs a Shopify order edit: deposit lines go to quantity zero, the real products are added at full price, and the order is committed with a staff note recording deposit paid versus balance due.
Partial checkouts are rate-limited to five attempts per phone number per ten minutes.
