Refunds and restocking
Refunds follow the same rule as payment. POST /api/admin/orders/:id/refund
calls Stripe and stops there. refundedCents and the order’s status are written by
the charge.refunded webhook, which is where the money actually settles. The admin
shows the refund as pending until then.
Refunds are additive, so several partial refunds accumulate against one charge, and
the order only moves to refunded once the whole charge is covered. A partial
refund leaves fulfilment alone.
Restocking
Section titled “Restocking”Stock is returned when an order is refunded in full or cancelled from the admin.
The restock is guarded by a restocked_at stamp claimed with a conditional update,
so several refund webhooks, or a merchant re-saving a cancelled order, cannot
inflate the catalogue.
A partial refund does not restock. It says nothing about which line came back. If a partial refund is a returned item, adjust the variant’s stock in the editor.
Digital lines have no stock and restock nothing. Revoking access is your receiver’s job; see Sell a digital product.
Outbound
Section titled “Outbound”order.refunded fires on every refund, partial or full. Compare refundedCents
with totalCents to tell them apart.
Testing
Section titled “Testing”Refund a test order from the admin with stripe listen running. The
charge.refunded event arrives, the status changes, stock moves once. Resend the
event and confirm stock does not move again.