**The design is sound enough to start building tomorrow, provided you write four small fixes into it first.** None of them changes the structure. The core is correct: stock is reserved atomically, the charge happens outside the transaction with a stable idempotency key, and unknown results go to reconciliation.

## Changes to make before building

1. **Guard every status change with `WHERE status = 'PENDING'`.** Steps 4, 5 and 6 don't say the transition is conditional, and both instances will run the reconciliation job.
   - Failing case: order A holds 1 unit and its charge was declined. Both instances pick it up in the same 5-minute run, and both mark it `FAILED` and restore stock.
   - Result: `available` goes up by 2 instead of 1, and you oversell a unit you don't have.
   - Fix: restore stock only if the guarded update changed a row. Optionally have the job select with `FOR UPDATE SKIP LOCKED`.

2. **Say what reconciliation does when the provider has no record of the charge.** Step 6 only covers `PAID` or `FAILED`.
   - Failing case: an instance is restarted (any deploy) after step 2 commits but before the step 3 call goes out. The order is `PENDING`, stock is held, and the provider answers "not found".
   - Result: as written, the order sits until the 30-minute alert and someone fixes it by hand.
   - Fix: treat "not found" as `FAILED` and restore stock. This is safe only because the request's retry budget (about 30 s) is well under the 2-minute cutoff, so state that as an explicit rule.

3. **Update stock rows in a fixed order (sorted by `sku`) in step 2.**
   - Failing case: one order contains SKUs X then Y, and a concurrent order contains Y then X. Each locks one row and waits for the other.
   - Result: Postgres kills one with a deadlock error, which is neither a `409` nor a success.
   - Fix: sort by `sku`, and also retry once on a deadlock error.

4. **Tighten the idempotency key rules in step 1.**
   - Make the unique constraint `(customer_id, idempotency_key)`, so one customer's key can't return another customer's order.
   - Two simultaneous requests with the same key: the loser hits the unique violation, must roll back its stock reservation and return the existing order, not a `500`.
   - Same key with a different cart: return `422` rather than silently returning the old order.

## Tests to add to the list

- Two reconciliation runs on the same order restore stock once.
- A `PENDING` order with no charge at the provider is settled as `FAILED` with stock restored.
- Two concurrent `POST /orders` with the same key produce one order and one reservation.
- Two concurrent multi-item orders with overlapping SKUs in opposite order both resolve cleanly.

## Smaller gaps to fix as you build

- **Lost confirmation email:** in step 4, a crash between the `PAID` commit and queuing the email loses it. Either write an outbox row in the same transaction or accept the loss in writing.
- **Price source:** the design doesn't say where `unit_price` and `total` come from. They must be computed server-side, never taken from the client's cart.
- **Module boundary:** steps 2 and 5 span the orders and inventory modules in one transaction. State that `OrderCheckout` owns the transaction and passes it into each module, or the "no module reads another's tables" rule will be broken on day one.
- **Missing keys:** `order_items` and `stock` have no declared primary keys. Use `(order_id, sku)` and `sku`, and add a `CHECK (available >= 0)` on `stock` as a backstop.
- **Request duration:** the worst-case request lasts about 30 s. Check that the load balancer and client timeouts exceed that, or cut the retries.

VERDICT: READY WITH CHANGES
