All packsMarketplace Payouts & Connected AccountsSolve
stripe charge.dispute.funds_withdrawn vs closed webhook
The dispute event that debits money isn't the one that decides the outcome
Treating charge.dispute.funds_withdrawn as 'the dispute was lost' marks every single dispute as lost the instant it opens -- the funds event moves the ledger, only charge.dispute.closed moves the order's state (D14).
This is one of the things Marketplace Payouts & Connected Accounts already handles. Take payment from buyers and pay out sellers, with the onboarding and identity checks Stripe requires.
Is this you?
Handling charge.dispute.funds_withdrawn as if it means the dispute was lost marks every dispute lost the moment it's opened, because Stripe debits the platform's balance provisionally at dispute creation -- not at resolution. A handler built this way claws money back from sellers who did nothing wrong the instant a chargeback is even filed, then has to unwind that the moment the dispute is later won or resolved in the platform's favor.
Why this one is easy to get wrong
'Funds withdrawn' reads as an unambiguous, final-sounding event name -- money left the account, so the platform must have lost. The provisional-versus-final distinction (debited immediately, reversed automatically on a win) is a fact about Stripe's specific dispute mechanics that has to be read from the docs directly; the event name itself gives no hint that it fires at the start of the process, not the end.
What you get instead
D14 splits the two event types cleanly: funds_withdrawn and funds_reinstated book ledger entries only (dispute_debit, dispute_reinstate) with zero order-state change, while charge.dispute.closed -- which fires only when a dispute is won, lost, or expired -- is the sole event that ever moves the order's state, resolving to CHARGEBACK_LOST or back to stateBeforeDispute depending on the dispute's final status. That split is what keeps warning_closed inquiry-style disputes from stranding an order in DISPUTED forever.
Source: ARCHITECTURE.md D14 — checkable in the pack you receive
How you actually use this
You don’t install a library or wire up an SDK. Your own coding agent builds the code in your project, and you keep it — no runtime dependency on us.
Step 1
Download and unzip
You get a folder: the docs that tell an agent what to build, a starting skeleton, and the test suite that decides when it's done.
Step 2
Open it in Claude Code or Cursor
Point your coding agent at the folder. Nothing to install, no account with us, no API key.
Step 3
Paste one prompt
The pack contains the exact prompt. Paste it as your first message and leave it alone — it works through the build itself, choosing a cheaper or stronger model per task.
Step 4
Run ./verify.sh
One command. It prints a pass or fail for every check. Green means the build is done — the same script we ran to produce the receipt on this page.
Typical build: about 25 minutes of your agent working, mostly unattended. Then you integrate the working module into your app the way you would any code you’d written yourself.
Why you can believe this
3 of 3 runs passedWe ran this pack from an empty folder 3 times and published exactly what happened — every check, the model, the token cost, the wall time. Not a testimonial, and not our opinion: the same verify.sh you run yourself. Read the full receipt →
Related problems
Marketplace Payouts & Connected Accounts
A dispute that's won has to resume the exact state it interrupted -- or guess wrong
Marketplace Payouts & Connected Accounts
Winning a dispute still doesn't get the dispute fee back
Webhook Durability & Replay
A stale event should be skipped -- unless skipping it loses money forever