> ## Content Index
> Fetch the complete content index at: https://debugly.dev/llms.txt
> Use this file to discover other available public pages before exploring further.

# The Order Created Hook That Fired Before the Payment Cleared
- URL: https://debugly.dev/order-hook-fired-before-payment/
- Published: 2026-10-09T16:16:00.000Z
- Updated: 2026-10-10T13:59:12.000Z
- Description: The fulfilment started on the created event, so unpaid orders shipped, and the cancellation arrived after the parcel, and the return postage was the margin…
- Author: Rohit Bhadani
- Tags: Ecommerce, Shopify, Webhooks

Between the shipped and the hook sit 6 quiet assumptions, and the incident is the story of one of them failing.

Strip the webhook fired at the wrong lifecycle point down and one property makes it costly: the created event means the order exists, not that the order is paid, and the fulfilment keyed on existence ships the unpaid.

This was Shopify with a fulfilment integration, and the mechanics are the same for any system that reacts to a creation event as though it were a commitment.

## Why the hook was the wrong one

The created event is the order's existence, and the existence is the record, and the record is the pending payment, and the pending is the not committed, and the not committed is the cancellable, and the cancellable is the risk, and the risk is the shipment, and the shipment is the cost, and the cost is the hook's choice.

The paid event is the payment's confirmation, and the confirmation is the commitment, and the commitment is the fulfilment's trigger, and the trigger is the safe, and the safe is the fix, and the fix is the event, and the event is the one word in the subscription, and the word is the difference between the shipped and the owed.

The created was chosen because the created is the first, and the first is the fast, and the fast is the fulfilment's speed, and the speed is the appeal, and the appeal is the trap, because the speed is the unpaid order's shipment, and the shipment is the cost, and the cost is the speed's price, and the price is the margin.

## Why the cancellation arrived late

The cancellation is the payment's failure, and the failure is the minutes or the hours, and the hours is the fulfilment's progress, and the progress is the picked and the packed and the shipped, and the shipped is the transit, and the transit is the unstoppable, and the unstoppable is the return, and the return is the postage, and the postage is the cost.

The race is the payment's duration against the fulfilment's, and the fulfilment's is the faster, and the faster is the shipped before the cancelled, and the cancelled is the too late, and the too late is the parcel's journey, and the journey is the cost, and the cost is the race's loser, and the loser is the store.

This is the same ordering problem as [the Shopify webhook retry that double-booked inventory](https://debugly.dev/shopify-webhook-retry-double-booked/), which is why the two fixes look alike.

## The fix, in order

**Subscribe to the paid event, not the created.** The paid is the commitment, and the commitment is the fulfilment's trigger, and the trigger is the fix, and the fix is the subscription, and the subscription is the one change, and the change is the unpaid's absence, and the absence is the saving.

**Check the financial status before fulfilling.** The order's status is the guard, and the guard is the paid or the pending, and the pending is the skip, and the skip is the fix, and the fix is the condition, and the condition is the one line, and the line is the discipline, because the event alone is not the state.

**Hold the high-risk orders for review.** The risk is the amount and the address and the velocity, and the three are the score, and the score is the hold, and the hold is the review, and the review is the fix, and the fix is the manual gate, and the gate is the fraud's catch, and the catch is the saving.

**Delay the fulfilment by the payment's window.** The delay is the minutes, and the minutes is the cancellation's arrival, and the arrival is the skip, and the skip is the fix, and the fix is the queue's delay, and the delay is the cheap insurance, and the insurance is the discipline, because the parcel's speed is not the customer's requirement.

**Reconcile the shipped against the paid.** The comparison is the unpaid shipments, and the shipments are the loss, and the loss is the alert, and the alert is the detection, and the detection is the fix, and the fix is the daily report, and the report is the tripwire, and the tripwire is the discipline.

## The rule

An order created event means the order exists, not that it is paid, so fulfilling on created ships the orders that will be cancelled. Subscribe to the paid event, check the financial status before fulfilling, hold the high-risk orders, delay the fulfilment past the payment window, and reconcile shipped against paid daily.

The store shipped orders that were never paid for, because the fulfilment integration listened to the order created webhook and treated the order's existence as the payment's confirmation, and the cancellation arrived while the parcel was in transit. I now check for that property first, because it is where the failure actually lives.