**The design is sound and you can start building tomorrow, provided you make three small additions to the doc first.** The core of it is right: stock is reserved with a conditional update, the charge happens outside the transaction with the order id as the provider idempotency key, and unknown outcomes are left `PENDING` for a reconciliation job with an alert behind it. None of the changes below alter that structure.

## Change before building

1. **An order can be settled twice, which restores its stock twice.**
   - **Case:** the last unit of a SKU is reserved (`available = 0`), the charge outcome is unknown, and the provider later reports a decline. If the reconciliation job runs on both instances, both run step 5 and `available` becomes 2 when it should be 1, so you oversell a unit.
   - **Fix:** make every status change conditional (`UPDATE orders SET status = ... WHERE id = :id AND status = 'PENDING'`) and restore stock or queue the email only if that update changed a row. Also say where the job runs.

2. **Reconciliation has no rule for "the provider has no record of this charge".**
   - **Case:** an instance crashes after step 2 commits and before step 3 sends the charge. Step 6 only says "settles as `PAID` or `FAILED`", so this order has no defined outcome and should be marked `FAILED` with stock restored, but today it would stay `PENDING` with stock held until the 30-minute alert.
   - **Fix:** state that "not found" on an order older than 2 minutes means `FAILED` plus stock restore.
   - **Check today:** confirm your provider can look up a charge by your order id. After a timeout you have no provider charge id, and some providers only look up by their own id. Step 6 depends on this.

3. **Two multi-item orders can deadlock on `stock`.**
   - **Case:** order A reserves SKU X then Y while order B reserves Y then X. Postgres aborts one of them and that customer gets a 500 where the order should have succeeded.
   - **Fix:** reserve items in sorted SKU order.

## Decide as you build

- **Idempotency key scope:** make the unique constraint `(customer_id, idempotency_key)`, so two customers' keys cannot collide. Decide what a repeated key with a different cart returns; I would return `422`.
- **Confirmation email:** a crash between the `PAID` commit and the queue call loses the email, and step 6 does not say that orders settled by reconciliation get one. Have the job queue it too.
- **Prices:** the doc does not say where `unit_price` and `total` come from. State that they are computed server-side, not taken from the client's cart.
- **After a `202`:** say how the client learns the final result, presumably `GET /orders/{id}`.
- **Tests to add:**
  - reconciliation settling as paid, declined and not found;
  - a double settle of the same order;
  - two concurrent buyers of the last unit;
  - concurrent duplicate `POST /orders`.

VERDICT: READY WITH CHANGES
