Deduction documents land from EDI 812 feeds, retailer portals, and email, and are stored in S3. Claude Haiku 4.5 reads each one (using vision for the scanned PDFs), extracts the line items, and classifies the reason against the canonical taxonomy, returning the source page for every value. A match step joins each deduction to the order-to-cash record from the EDI build (ASN timestamps, proof of delivery, invoice, shipment) and scores validity. For the disputable ones, Claude Opus 4.8 drafts an evidence-backed dispute packet. Everything surfaces in a TypeScript review console where AR approves, edits, or rejects, and Temporal runs the dispute workflow: submit, await the retailer's response, escalate, and record the outcome.
It reuses the order-to-cash data the EDI build already produces, so every deduction is scored against real shipment evidence rather than a guess.