**The design is sound and you can start building tomorrow, provided you make three small additions to the doc first.** None of the problems below needs a restructure. The core choices are right: stock is reserved with a conditional update, the charge happens outside the transaction, the order id is the provider idempotency key, and a reconciliation job covers unknown results.

## High severity: fix in the doc before building

1. **An order can be settled twice, which restores stock twice.** Nothing says the `PAID`/`FAILED` update only applies while the order is still `PENDING`, and the reconciliation job will run on both instances.
   - Failing case: an order for 2 units of SKU A is `PENDING` and both instances' jobs see the decline. Each marks it `FAILED` and adds 2 back, so `available` ends 2 higher than real stock and you oversell.
   - Fix: settle with `UPDATE orders SET status = ... WHERE id = :id AND status = 'PENDING'`, and restore stock only if that changed a row. Run the job under a lock, or select with `FOR UPDATE SKIP LOCKED`.

2. **Reconciliation has no rule for "the provider has never heard of this order".** Step 6 only covers settling as `PAID` or `FAILED`.
   - Failing case: the instance crashes after step 2 commits and before the charge call in step 3. The order stays `PENDING` and holds its stock indefinitely; the 30-minute alert fires but no behaviour is defined.
   - Fix: treat "no charge found" past a safe age as `FAILED` with stock restored. Also state what happens when the provider reports the charge as still processing.

3. **The design does not say where prices come from.** There is no price table, and step 1 only says the client sends the cart.
   - Failing case: if `unit_price` is taken from the request, a client can submit a price of 0.01 and be charged that.
   - Fix: state that prices are looked up server-side, `total` is computed by the service, and the stored `total` is the amount sent to the provider.

## Medium severity: fix during the build

4. **Quantity is not validated.** A quantity of -5 passes `available >= -5` and increases stock by 5. Require `quantity > 0` and merge duplicate SKUs in a cart.
5. **The idempotency key is unique globally, not per customer.** If two customers send the same key, the second gets the first customer's order back. Make the constraint `(customer_id, idempotency_key)`, and return `422` when a repeated key arrives with a different cart.
6. **Multi-item orders can deadlock.** One order updates SKU A then B while another updates B then A; Postgres aborts one, which surfaces as a 500. Update stock rows in sorted SKU order.
7. **The confirmation email can be lost.** If the instance crashes after the `PAID` commit and before queuing, no email is sent and nothing retries it. Step 6 also doesn't say whether orders the job settles as `PAID` get an email. Record "email queued" on the order, or write the queue entry in the same transaction, and have the job cover it.
8. **The provider's charge id is not stored.** You will need it for refunds, support lookups and disputes. Add a `payment_reference` column and a failure reason.
9. **The test list misses the riskiest paths.** Add tests for:
   - two concurrent buyers of the last unit;
   - two concurrent `POST`s with the same key;
   - the reconciliation job, covering paid, declined, not found, and run twice;
   - a multi-item order where the second item is out of stock;
   - a failed email.

## Minor

10. **No keys or constraints are listed.** Add primary keys, the `order_items` foreign key, `CHECK (available >= 0)`, and a check on `status`.
11. **Step 3 does not say which errors are retried.** Retry timeouts and 5xx only, never declines or 4xx.
12. **The worst-case request takes about 20 s plus backoff.** Check it fits under the load balancer timeout, or the client sees a gateway error instead of `202`.
13. **Steps 2 and 5 span the orders and inventory modules in one transaction.** This is compatible with "no module reads another's tables", but say that inventory exposes reserve/restore functions that accept the caller's transaction.
14. **The `409` response does not say which SKU is short.**
15. **Retrying after a `FAILED` order is undocumented.** The same key returns the failed order, so the client must send a new key.
16. **`numeric(12,2)` assumes two-decimal currencies.** JPY and KWD do not fit; this is fine if you only sell in one currency, but say so.
17. **Cancellation and refunds are absent.** If that is intentional for this revision, add an "out of scope" line.
18. **The only operational signal is the `PENDING` alert.** A decline-rate and charge-timeout metric would be cheap to add.

VERDICT: READY WITH CHANGES
