Operating problem
A refund precedes the next payout
A shopper returns one line from an order that shipped in two parcels. Shopify records the refund today, the payment provider nets it against a later payout, and the warehouse has yet to inspect the item. Treating all three events as one reversal obscures both stock and cash.
Payment settlement and shipment can arrive in a different order. A retry must preserve the original order identity or the accounts can show two sales.
Implementation design
How the records fit together
Keep the order line and refund identifier on the credit. Post the return receipt when the goods arrive and reconcile the payout separately against refunds and fees. Replaying the refund event should locate the existing credit, including when only one of the parcels was returned.
- Order line
- Refund identifier
- Payout statement
Implementation sequence
- Map storefront variants to sellable items and units.
- Link shipments and partial refunds to the original order line.
- Reconcile payouts after fees and investigate unmapped adjustments.
Validation and review
What to verify before release
Replay a refund notification after it has posted. Check that the original credit remains the only credit and the settlement still balances.

