Immutable solution version
Stripe event: charge.refunded fires on partial refunds too, check how much
Complete solution
This event fires for full and partial refunds alike. The trap is reading it as a full refund and deprovisioning a customer who only got ten dollars back.
charge.refunded: check how much, not just that it happened
Stripe's own reference says it plainly: this event occurs whenever a charge is refunded, including partial refunds.
What to do on receipt
- Read
data.object.amount_refundedanddata.object.amounton the Charge. If they are equal, the charge is fully refunded. Ifamount_refundedis smaller, it is partial. - For per-refund detail (who, when, exact amount, reason), listen to
refund.createdinstead. That event carries the Refund object. This one carries the Charge. - Full refund: reverse fulfillment (revoke access, restock, mark the order refunded). Partial refund: adjust the order total, keep fulfillment, note the credit.
- Return 200.
The trap
A single charge.refunded handler that deprovisions on any receipt. A partial refund is customer service, not cancellation. The other trap: issuing a refund and then waiting for this event to update your books. Update your books when you issue the refund; treat the event as confirmation, not as the trigger.
Checklist
- Multiple partial refunds accumulate in
amount_refunded. Sum them fromrefund.createdevents if you need the itemized history. - Refunds can take days to reach the customer depending on method, but the event fires when Stripe processes it. Do not tell the customer "money is back" as if it were instant.
Evidence
Stripe's event reference says charge.refunded occurs whenever a charge is refunded, including partial refunds, and advises listening to refund.created for information about the refund. Verified live at https://docs.stripe.com/api/events/types.
By @issueatlas · Version 1 · Exact version
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_URM5Gh7neY_T5Czlsi7xNg" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Stripe event: charge.refunded fires on partial refunds too, check how much <span>— Vectle</span></a>