Most teams handle chargebacks the same way. A dispute notification arrives and someone reads the reason code. Then they either scramble to assemble evidence or quietly let the deadline pass. Neither path is a system. Both are guesses.

This article treats dispute handling as an engineering problem. Each incoming chargeback gets classified by its likely source: criminal fraud, friendly fraud, or merchant error. Then an expected-value calculation decides whether responding is worth the effort. For the business side of why merchants skip disputes they could win, see Chargeback Excuses: Why Do Merchants Hate Chargebacks, but Then Refuse to Fight Back?. Here we focus on the plumbing.

Why the reason code isn't a classifier

Every dispute carries a reason code from the card network. Examples are Visa's fraud category (10.x) versus its consumer dispute category (13.x), or a processor-normalized value such as fraudulent or product_not_received. It's tempting to map these directly to actions.

That breaks down for three reasons:

  1. The cardholder (or their bank) picks the code. Someone who recognizes the purchase but regrets it may still tell their issuer "I didn't authorize this." The result is a fraud code on a friendly-fraud dispute.
  2. Codes describe the claim, not the cause. "Item not received" can mean the carrier lost it (merchant-side problem), the customer is lying (friendly fraud), or a stolen card was used with a drop address (criminal fraud).
  3. Codes vary across networks and processors. If you have more than one acquirer, you need a normalization layer anyway.

Treat the reason code as one input feature, not as the label.

The three sources and what distinguishes them

The source decides the response. Criminal fraud and merchant error are usually accepted, and the lesson is fed back into prevention or operations. Friendly fraud is the category where representment tends to pay off.

Signal Criminal fraud Friendly fraud Merchant error
Device / IP matches cardholder's prior undisputed orders Rarely Often Varies
Account has prior successful orders, no disputes Rarely Often Often
Delivery confirmed to billing-matched address Rarely Often Varies
Post-purchase engagement (logins, downloads, usage) Rarely Often Varies
Open support ticket, failed refund, or shipping exception Rarely Sometimes Often
Duplicate charge / wrong amount in your ledger No No Yes
Multiple cards or accounts sharing device in short window Often Rarely No

None of these is decisive alone. Together they move a dispute strongly in one direction.

Data flow

A minimal pipeline looks like this:

processor webhook (dispute.created) │ ▼ normalize ──► dispute record (id, amount, currency, reason, due_by) │ ▼ enrich ──► join order, fulfillment, auth/3DS result, device/IP, account history, support tickets, refund ledger │ ▼ classify ──► {source, confidence, signals[]} │ ▼ decide ──► fight | accept | manual_review (EV-based) │ ├─► fight: build evidence packet ─► submit before due_by ├─► accept: close, emit event to fraud/ops feedback └─► manual: queue with SLA well before due_by │ ▼ outcome webhook (won/lost/pre-arb) ──► store for calibration 

Two details matter more than they seem:

  • Enrichment depends on data you captured at transaction time. If you didn't log device fingerprint, IP, and delivery proof when the order happened, you can't reconstruct them weeks later.
  • Make the webhook handler idempotent. Processors retry delivery. Key on the processor's dispute ID and upsert.

A rule-based classifier you can ship this week

Start with transparent rules before reaching for ML. You need labeled outcomes to train anything, and rules produce those labels.

from dataclasses import dataclass, field @dataclass class Classification: source: str # 'criminal', 'friendly', 'merchant_error', 'unknown' confidence: float signals: list = field(default_factory=list) def classify(d) -> Classification: s = [] # Merchant error first: it's usually provable from your own ledger. if d.ledger.duplicate_charge or d.ledger.amount_mismatch: return Classification('merchant_error', 0.95, ['ledger_mismatch']) if d.refund.requested and not d.refund.processed: return Classification('merchant_error', 0.85, ['unprocessed_refund']) if d.fulfillment.carrier_exception and not d.fulfillment.delivered: return Classification('merchant_error', 0.75, ['shipping_exception']) friendly, criminal = 0.0, 0.0 if d.history.prior_undisputed_orders >= 2: friendly += 0.3; s.append('repeat_customer') if d.device.matches_prior_undisputed: friendly += 0.3; s.append('device_match') if d.fulfillment.delivered and d.fulfillment.address_matches_billing: friendly += 0.2; s.append('delivered_to_billing') if d.usage.post_purchase_activity: friendly += 0.2; s.append('post_purchase_usage') if d.device.linked_cards_24h >= 3: criminal += 0.4; s.append('card_cycling') if d.history.account_age_days < 1 and d.history.prior_undisputed_orders == 0: criminal += 0.3; s.append('new_account') if d.fulfillment.ship_to_freight_forwarder: criminal += 0.2; s.append('forwarder') if friendly >= 0.5 and friendly > criminal: return Classification('friendly', min(friendly, 0.95), s) if criminal >= 0.5: return Classification('criminal', min(criminal, 0.95), s) return Classification('unknown', max(friendly, criminal), s) 

The weights are placeholders. Tune them against your own outcome data. The structure is what you're after: ledger checks first, then scored signals, with an explicit unknown bucket rather than a forced label.

Deciding to fight: expected value, not gut feel

"Is a $60 dispute worth it?" is answerable. Define:

  • A = disputed amount you'd recover on a win
  • p = probability of winning, given source and evidence strength
  • C = marginal cost of responding (staff time, tooling, per-case fees)
  • F = any fee you'd recoup on a win. Many processors don't refund the dispute fee even if you win, so this is often 0.
  • L = lifetime value at risk from a repeat abuser. This is the soft term: an uncontested friendly-fraud dispute may teach the customer the tactic works.
EV(fight) = p × (A + F) − C fight if EV(fight) > 0 (optionally + λ × L for flagged repeat risk) 

Worked example

These numbers are hypothetical. Suppose analyst time costs $40/hour.

  • Dispute 1: $60, classified friendly fraud, delivery confirmed, device match. Your historical win rate for this profile is 0.6. With automation, evidence assembly takes 10 minutes (C ≈ $7). EV = 0.6 × 60 − 7 = +$29. Fight.
  • Dispute 2: $60, unknown source, weak evidence, manual assembly takes 90 minutes (C = $60). Win rate 0.2. EV = 12 − 60 = −$48. Accept, unless the account has prior disputes.
  • Dispute 3: $400, criminal fraud, card cycling detected. Win rate near 0. Accept, and push the signals into your pre-authorization rules.

Dispute 1 and Dispute 2 have the same amount but opposite decisions. The cost term C is where automation pays off. Cutting evidence assembly from 90 minutes to 10 turns many low-value disputes from negative EV into positive EV.

Decision table

Source Confidence EV Action
merchant_error any n/a Accept; open ops ticket
criminal ≥ 0.5 n/a Accept; feed fraud rules
friendly ≥ 0.7 > 0 Auto-fight with templated evidence
friendly 0.5–0.7 > 0 Manual review
friendly any ≤ 0 Accept unless repeat-abuse flag
unknown any any Manual review if amount above threshold, else accept

Common mistakes and how to catch them

Treating the reason code as ground truth. Track how your classifier's labels diverge from the incoming reason codes. A large share of fraud-coded disputes labeled friendly is normal. That gap is the reason for building the classifier.

Deadline bugs. Response windows are strict, and processors expose a due date. Store it in UTC, alert at a fixed buffer (e.g., 72 hours before), and have a test that fails if any open dispute lacks a due_by.

Counting first-cycle wins as recovered money. An issuer can escalate to pre-arbitration after you win representment. Mark a case "recovered" only when it reaches a terminal state. Otherwise your p estimates will be inflated.

No feedback loop. Accepted criminal-fraud disputes should create rules or training data for prevention. Merchant-error disputes should create tickets. If accepting a dispute triggers nothing, you'll see the same disputes again.

Evidence that doesn't match the claim. Delivery proof does nothing against a "not as described" claim. Map each normalized reason to the evidence fields it needs, and validate the packet before submission.

Testing the pipeline

  • Fixture disputes per source. Build synthetic enriched records for each archetype and assert on the classification and the decision.
  • Replay historical disputes. Run past disputes through the current rules and compare against known outcomes. This is your calibration set for p.
  • Idempotency test. Send the same webhook payload three times. Expect one record and one action.
  • Shadow mode. Run the classifier alongside your manual process for a few weeks before letting it auto-accept anything.

Once you're logging outcomes per source and confidence band, you have what you need to replace hand-tuned weights with a trained model. The rules will have done their job by producing that data.

Subscribe for more content about Chargeback Management.