1. Pull the chargeback file. Whatever the retailer sent: portal export, EDI 812, PDF, or a remittance buried inside an email.
2. Standardize the format. Each retailer codes its violations differently. The flow normalizes them into a common schema.
3. Match each violation to its pricing rule. Late, short ship, label, packaging, ASN error. Each rule has its own charge formula.
4. Calculate the charge amount. Per-unit, per-PO, percentage of invoice. Whichever the contract calls for.
5. Summarize by vendor and code. One row per vendor per violation type with totals and counts.
6. Output the report. Full chargeback table for the record, plus a dispute-ready view sorted by dollar amount.