The design is sound and you can start building tomorrow, provided you settle three underspecified points first; each could cause a wrong stock count or a wrong order. The core is right for this scale: reserving stock with a conditional update, charging outside the transaction, using the order id as the provider's idempotency key, and reconciling unknown results.

## Fix before building

1. **Stock can be restored twice for one failed order.** Both instances will run the reconciliation job, and nothing says a status change only applies if the order is still `PENDING`.
   - **Case:** an order for 1 unit is declined, and both instances' jobs pick it up in the same run. Each marks it `FAILED` and adds 1 back, so `available` rises by 2 and you can oversell.
   - **Fix:** make every transition conditional (`UPDATE orders SET status = ... WHERE id = ... AND status = 'PENDING'`) and restore stock or queue the email only if that update changed a row.
   - **Remaining decision:** if a charge succeeds but the order is already `FAILED`, the design should say what happens (refund or alert).

2. **Reconciliation has no rule for a charge the provider has never heard of.** Step 6 only settles orders as `PAID` or `FAILED` based on the charge status.
   - **Case:** the instance crashes after step 2 commits and before step 3 calls the provider. The order is `PENDING` with stock reserved, and the provider answers "not found". As written, the order stays `PENDING` and the stock stays locked; the 30-minute alert fires but nothing resolves it.
   - **Fix:** state that "not found" on an order older than 2 minutes means `FAILED` plus stock restore.

3. **The idempotency key is unique across all customers.**
   - **Case:** customer B sends a key that customer A already used. B gets A's order back instead of a new one.
   - **Fix:** make the constraint unique on `(customer_id, idempotency_key)`. Also decide what a repeated key with a different cart returns; `422` is the usual choice.

## Smaller gaps you can close while building

- **Confirmation email on the reconciliation path.** Step 4 queues the email only in the request path. An order settled as `PAID` by the job gets no email unless the job queues it too.
- **Deadlocks on multi-item carts.** Two carts holding the same two SKUs in opposite order can deadlock in step 2. Updating stock in sorted SKU order prevents it.
- **Source of prices.** The design does not say where `unit_price` and `total` come from. If they come from the client's cart, a client can set its own price; they need to come from a server-side source.
- **How the client learns the outcome after `202`.** There is no `GET /orders/{id}` in the design.
- **Request duration.** Step 3 can run about 30 seconds in the worst case (four 5 s attempts plus backoff). Check that this fits under the load balancer's timeout.

## Tests to add to the plan

- Two reconciliation runs on the same order at once: stock is restored exactly once.
- Crash before the charge call: the order ends `FAILED` and stock is restored.
- Same idempotency key from two different customers: two separate orders.
- Same key with a different cart: rejected.
- Order settled as `PAID` by reconciliation: the email is queued.
- Two concurrent carts with overlapping SKUs in opposite order: both complete or one gets a clean `409`.

VERDICT: READY WITH CHANGES
