The design is sound enough to start building tomorrow, provided you write five small clarifications into it first. None changes the architecture; the two "High" ones can cause wrong stock or a cross-customer data leak if left to chance during implementation.

## What must change before building

| # | Severity | Gap | Concrete failing case | Fix |
|---|---|---|---|---|
| 1 | High | Nothing says the move out of `PENDING` is guarded, and the reconciliation job (step 6) will run on both instances. | Both instances pick up the same `PENDING` order and each marks it `FAILED` and restores stock. `available` goes up by 2 for 1 unit, where it should go up by 1, and you later oversell. | Settle with `UPDATE orders SET status = … WHERE id = … AND status = 'PENDING'` and restore stock only if that changed a row. Apply the same rule in steps 4 and 5. |
| 2 | High | Step 1 puts a unique constraint on `idempotency_key` alone, and the key is client-generated. | Customer B sends a key Customer A already used. B gets A's order back, where B should get their own new order. | Make the constraint `(customer_id, idempotency_key)` and look up by both. |
| 3 | Medium | Step 6 only covers "settles as `PAID` or `FAILED`", not the case where the provider has no record of the charge. | The service crashes after step 2 commits and before step 3 calls the provider. The order sits `PENDING` with stock held until the 30-minute alert, where it should be marked `FAILED` and the stock released. | State that "no such charge" after the 2-minute threshold means `FAILED` plus stock restore, and that "still processing" means leave it `PENDING`. |
| 4 | Medium | Only step 4 queues the confirmation email. | A customer gets `202`, and the job later settles the order as `PAID`. They get no email, where they should get the same confirmation as everyone else. | Have the job queue the email too, ideally through the same "mark paid" function as step 4. |
| 5 | Medium | The test list has no reconciliation or concurrency cases. | Gaps 1, 3 and 4 would all pass the current test plan. | Add tests for: job settles as paid, as failed, and as not found; two job runs on the same order; two buyers racing for the last unit; two simultaneous `POST /orders` with the same key. |

## Minor, can be fixed during the build

- **Deadlocks on multi-item orders.** Step 2 updates stock rows in cart order, so carts with A,B and B,A can deadlock, and Postgres will abort one as a 500. Update SKUs in sorted order.
- **Same key, different cart.** Step 1 does not say what happens; returning the old order silently would hide a client bug. Return `422` on a payload mismatch.
- **Email lost on crash.** Step 4 commits `PAID` and then queues the email, so a crash in between loses it. This is rare at your volume, and an outbox row in the same transaction would close it.
- **Schema details not stated.** The table lists no primary key on `order_items` or `stock.sku`, no `CHECK (available >= 0)`, and no check constraint on `status`.
- **Retry triggers.** Step 3 names timeouts only; say whether provider 5xx and connection errors also retry.

## Questions, not confirmed problems

- **Where prices come from.** The design does not say where `unit_price` and `total` come from. If they are taken from the client's cart, a customer can set their own price; they should be computed server-side.
- **Request duration.** Four attempts at 5 s plus backoff can hold a request open for about 30 s. Check this against your load balancer and client timeouts.
- **Refunds and cancellation.** There is no status for either. That is fine if they are out of scope for this revision, but say so in the design.

## What is already right

- Stock is reserved with a conditional update in the same transaction as the order insert.
- The payment call is outside any transaction and uses the order id as the provider idempotency key.
- An unknown payment result is handled explicitly with `202`, reconciliation and an alert.
- The module boundaries and thin routes fit a team of four, and 2,000 orders a day is comfortably within this setup.

VERDICT: READY WITH CHANGES
