← All case studies

Industry case study

Ecommerce

Reconciling Shopify orders and refunds

Read the study ↓

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.

  1. Order line
  2. Refund identifier
  3. Payout statement

Implementation sequence

  1. Map storefront variants to sellable items and units.
  2. Link shipments and partial refunds to the original order line.
  3. 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.

Chat on WhatsApp