Loading.
Back to work
CASE 01 LOGISTICS AI / DECISIONING LIVE

COD RTO
Intelligence Pipeline

A multi-signal decision engine that holds risky cash-on-delivery orders, calls customers via AI, and routes only verified ones to the warehouse — targeting a 96% COD success rate.

Role Architect & Builder
Stack Python · FastAPI · AWS
Duration 6 weeks → live
Status Production · 2025

Cash-on-delivery is a black hole.

D2C brands in India ship 60–70% of orders as COD. A meaningful chunk of those return to origin — wrong addresses, ghost numbers, buyer's remorse, fake orders. Reverse logistics burns money; the warehouse picks, packs and dispatches inventory that never converts.

The existing setup was reactive: orders flowed to the warehouse the moment they came in. By the time a risky order was flagged, the parcel was already in transit. No pre-shipment filter, no signal aggregation, no automated verification — just a spreadsheet of regrets at month-end.

Build a decision engine, not a dashboard.

The system intercepts every COD order at creation, combines three independent signals, and decides one of three things: auto-approve, call the customer, or push toward prepaid conversion. Nothing reaches the warehouse without a cod-verified tag.

  • GoKwik risk tier — the order's historical risk band from the checkout layer.
  • Pincode RTO history — a pre-computed lookup of every Indian pincode's failure rate against our shipping history.
  • EasyEcom suspicious-consignee flag — repeat-offender phone numbers and address fingerprints from the WMS.

Three paths, one tag.

Tag-gating is the whole trick. The warehouse's automation only picks orders tagged cod-verified or cod-autopass. Anything tagged cod-unverified sits in Shopify, frozen, until the decision engine resolves it.

  • Low-risk repeat buyers → auto-approve, tag cod-autopass, flow to warehouse within seconds.
  • Mid-risk first-timers → Formant AI calls the customer three times in 24 hours; outcome writes back to Shopify as a tag.
  • Stacked-signal high-risk → no call, no warehouse. Customer gets a prepaid-conversion nudge instead.
SHOPIFY ORDER
Webhook trigger
SIGNAL FUSION
3 sources
DECISION ENGINE
< 400ms
cod-autopass
Low risk
Formant AI Call
Mid risk · 3 attempts
Prepaid nudge
High risk · blocked
96% COD success target
250k Orders backtested
3 Call attempts / order

Production from day one.

Deployed at webhooks.ccapps.xyz on AWS Tokyo. Shopify webhooks trigger the FastAPI service, which decisions in under 400ms and writes tags back atomically. Formant AI handles the outbound calling layer; the WMS reads tags via its standard order-status sync.

The whole system ships with a runbook: state machine diagrams, tag lifecycle, backtest methodology, AWS deployment steps, and a HANDOFF.md so any engineer can take over.

FastAPI Python AWS EC2 Shopify Webhooks Formant AI GoKwik EasyEcom WMS Caddy PostgreSQL

Live, automated, owned.

COD Success Rate
0%
Auto-approved
0%
Called & Verified
0%
Blocked (high risk)
0%
Orders backtested
0

The pipeline runs unattended. The ops team sees a daily summary; nothing else changes for them. The warehouse no longer dispatches doomed parcels. Customer service stops chasing failed deliveries that should never have shipped.

Built solo. Backtested on a quarter-million historical orders before going live. Full ops handoff documentation included.

Next case · 02 igdesk — Instagram Command Centre