WorkConsumer Goods (CPG)6 min read

Stopping Retail Chargebacks Before They Hit With Per-PO OTIF Risk Prediction

A real-time layer over the existing order flow that scores every purchase order for on-time-in-full risk and alerts the team to intervene before the delivery window closes and the fine triggers.

The brand ships into national retail and already trades via EDI, but compliance and on-time-in-full chargebacks had become a growing line on the P&L. The worst part: they only found out weeks later, as deductions on the remittance, long after anything could be done. By the time the fine appeared, the late shipment had already shipped late.

Client profile
A consumer packaged-goods brand, ~$30M revenue, shipping into national retail
Industry
Consumer Goods (CPG)
Region
North America / UK

01 The Challenge

Finding out about chargebacks weeks after it was too late to stop them

Weeks lateWhen chargebacks were discoveredAs deductions, long after the miss

National retailers fine suppliers for missing the on-time-in-full window, for late advance ship notices, and for label or packaging non-compliance. The brand traded via EDI, but it had no early warning. A purchase order would drift toward its delivery window with nobody watching, and the first sign of trouble was a deduction on the remittance weeks later. By then the truck had shipped late, the window had closed, and the fine was locked in. The team was managing chargebacks by reading deduction reports, which is to say, by reading the past.

You can't fix a missed delivery window after the window has closed.

02 The Approach

Watch every PO in real time and intervene before the deadline, not after

The governing rule: every purchase order is tracked from receipt to delivery, scored for chargeback risk against its on-time-in-full window and its compliance deadlines, and the team is alerted while there is still time to act.

The decision at the heart of it: a durable workflow per PO that holds a timer for each deadline, the advance-ship-notice cutoff, the ship-by date, the delivery window, and escalates as a deadline approaches and the shipment is not on track. That turns chargeback prevention from a report you read afterward into an alert you act on beforehand.

It is deliberately right-sized. The risk scoring is deterministic and timing-based, not a heavy machine-learning model a brand this size cannot feed or trust. And it sits on top of the existing EDI and 3PL flow rather than replacing it.

What we deliberately did not do: no rip-and-replace of the EDI or 3PL setup, no machine-learning overkill, no acting on carriers or the warehouse automatically (the system recommends the intervention; the team executes it), and no event-streaming infrastructure the PO volume does not need.

03 The Build

A durable workflow per PO, counting down every deadline

The system ingests purchase orders from the EDI feed, fulfillment status from the 3PL and WMS, carrier tracking, and each retailer's on-time-in-full windows and compliance deadlines. For every PO, a Temporal workflow holds durable timers for each deadline and carries a live risk score. As a deadline approaches and the shipment is not progressing, not picked, not shipped, or tracking behind schedule, the workflow escalates an alert that names the at-risk PO and the recommended intervention: expedite, split-ship the in-stock portion, re-label, or re-book the carrier. A TypeScript dashboard shows the at-risk queue and the on-time-in-full and scorecard trend. The loop closes by recording what happened, so recurring root causes, a slow 3PL lane, a SKU that is always short, surface for a permanent fix.

It is deliberately right-sized: deterministic, timing-based risk scoring rather than a heavy model, sitting on top of the existing EDI flow instead of replacing it.

  • Python
  • Temporal Cloud
  • Aurora PostgreSQL
  • TypeScript
  • AWS

04 The Results

A P&L line that shrinks, and an ops team that acts in time

-85%Compliance and OTIF chargebacksCaught and fixed before the fine triggered

Every purchase order is now risk-scored in real time, and the team works an at-risk queue with recommended interventions instead of reading deduction reports after the fact. Compliance and on-time-in-full chargebacks fell about 85%, and on-time-in-full compliance climbed above the retailer fine threshold to 98% and up. Finance watches a P&L line shrink; operations gets hours of warning instead of weeks of hindsight; and the recurring root causes that used to repeat every month get engineered out.

05 What's Next

The per-PO risk spine the rest of retail ops can run on

The live per-PO risk data is a foundation beyond chargebacks: vendor-scorecard reporting, and carrier and 3PL performance management from the same signal. The recurring root causes feed back into the order-to-cash process and, where present, the compliance-rules engine, so prevention keeps compounding. Built once, it extends to each new retailer the brand takes on.

Dental7 min read

A 24/7 Front Desk That Books Patients and Refuses to Play Doctor

A governed AI assistant that answers admin enquiries from approved practice information and books through Dentally, escalates anything clinical with a hard safety gate, and never gives clinical advice, with staff reviewing every non-templated reply.

70%Of enquiries resolved without the front desk (booking, FAQs, hours)
  • AI Workflow
  • Governed
  • Clinical-Safety Gate
  • Dentally
Read

DTC E-commerce6 min read

Learning Which Creative Attributes Win With a Multimodal Creative-Intelligence Layer

A vision LLM tags every ad creative into structured attributes and joins them to your attribution and margin data, so you see which creative traits drive the cheapest, highest-margin new customers, not which ad id got clicks.

2xWin rate on new creative concepts
  • Creative Intelligence
  • Sonnet 4.6 Vision
  • BigQuery
  • Growth
Read

Engineering edge,
without hiring a team.

Numbers you can trust, operations that run themselves, all built into your stack and owned by you. Tell us where you want the edge, and we'll build it.

Have a project in mind?

  • Quick response

    You'll hear from an engineer the same working day, not a sales sequence.

  • Clear next steps

    A short call, then a plan, and we start with Proof Week or a full build.

  • Fixed fee first

    A fixed fee agreed before anything starts, for Proof Week or the full build.