The design is close to buildable: the core is sound, and nothing I found needs a restructure. Three gaps should be closed in the document before you write code, because each can produce wrong stock or wrong money; the rest can be handled as you build.

## High: settle in the design before coding

1. **Nothing stops an order being settled twice, which restores stock twice.** Steps 5 and 6 both mark `FAILED` and restore stock, with no guard on the current status.
   - **Failing case:** the reconciliation job runs on both instances at the same minute, and both see order A (1 unit of SKU X) as `PENDING` and declined. Both restore stock, so `available` goes up by 2 instead of 1 and you later oversell a unit.
   - **Fix:** settle with `UPDATE orders SET status = ... WHERE id = :id AND status = 'PENDING'`, and restore stock or queue the email only if that changed a row. Also say whether the job runs on one instance or takes a lock.

2. **Reconciliation has no answer for "the provider has never heard of this order".** Step 6 only allows `PAID` or `FAILED`.
   - **Failing case:** the instance crashes after step 2 commits and before the step 3 charge call. The order is `PENDING` with stock reserved, and the provider returns "not found". As written, the order stays `PENDING` forever and the stock stays locked; expected is `FAILED` with stock restored.
   - **Fix:** treat "not found" on an order older than the 2 minutes as `FAILED` plus restore.

3. **The design does not say where prices come from.** There is no price table, and step 1 says the client "sends the cart". If `unit_price` and `total` are taken from the request, a customer can post a price of 0.01. State that the server looks prices up and computes the total, and name the module that owns them.

## Medium: decide this week

4. **Three idempotency key cases are unspecified.**
   - **Scope:** the unique constraint should be on `(customer_id, idempotency_key)`. With a global key, customer B reusing customer A's key gets A's order back.
   - **Concurrent duplicates:** when two identical posts arrive together, the second hits the unique violation rather than finding an existing row. It must roll back and return the existing order, not a 500.
   - **Same key, different cart:** this should be rejected (422), not silently return the old order.

5. **Multi-item orders can deadlock.** Order 1 updates SKU A then B while order 2 updates B then A; Postgres kills one and that customer gets a 500. Update the stock rows in sorted SKU order.

6. **The confirmation email can be lost or skipped.**
   - A crash between the `PAID` commit and the queue call in step 4 means no email is ever sent.
   - Step 6 does not say that orders settled as `PAID` by reconciliation get an email at all.
   - Simplest fix: write an "email pending" row in the same transaction as `PAID` and have the queue read from it.

7. **The test list misses the cases above.** Add:
   - two buyers racing for the last unit;
   - two concurrent posts with the same key;
   - reconciliation outcomes: paid, declined, not found, and the job running twice on one order;
   - a crash between reserve and charge;
   - two multi-item orders with overlapping SKUs.

## Minor

8. **Module rule against step 2.** "No module reads another module's tables" conflicts with one transaction spanning `stock` and `orders`. Say that `OrderCheckout` owns the transaction and calls an inventory function inside it.
9. **Schema constraints are missing.** Add primary keys, the foreign key on `order_items`, `CHECK (available >= 0)`, `CHECK (quantity > 0)`, and an enum or check on `status`.
10. **The `202` response has no follow-up.** Add a `GET /orders/{id}` for the client to poll, or the customer will retry with a new key and may pay twice.
11. **Worst-case request time is over 20 s** (4 attempts × 5 s plus backoff, whose values are not given). Check that it fits under the load balancer timeout.
12. **Provider errors that are neither decline nor timeout** (bad request, auth failure) have no stated outcome. They should fail fast without retries.
13. **`numeric(12,2)` assumes two-decimal currencies.** It is wrong for JPY or KWD; this is fine if you only sell in one currency, but say so.
14. **No cancel or refund status.** I assume this is out of scope for this revision; a one-line note would confirm it.
15. **The source of `customer_id` is not stated.** It should come from the authenticated session, not the request body.

VERDICT: READY WITH CHANGES
