The design is sound in structure and can be built from tomorrow, provided four gaps are closed in the document first; none needs a redesign. The parts that usually go wrong are right: stock reservation is a single conditional update, the payment call is outside any transaction, and the order id is the provider's idempotency key.

## Fix before building

1. **High: reconciliation has no rule for "the provider has never heard of this order".**
   - Case: an instance is restarted (a normal deploy is enough) after step 2 commits and before step 3 sends the charge.
   - Result: the order is `PENDING` with stock reserved, and step 6 only says it settles as `PAID` or `FAILED`, so the order stays `PENDING` and the stock stays locked.
   - Expected: "no charge found" is settled as `FAILED` with stock restored.
   - Also state that every `FAILED` settlement by the job restores stock; step 5 says so, step 6 does not.

2. **High: stock can be restored twice.**
   - Case: there are two instances, so two reconciliation jobs can pick up the same `PENDING` order with 1 unit reserved, and both mark it `FAILED`.
   - Result: `available` goes up by 2, and the phantom unit is later oversold.
   - Expected: every status change is `UPDATE ... WHERE status = 'PENDING'`, and stock is restored only if that update changed a row.
   - The same guard covers the job racing a slow request in step 4 or 5.

3. **High: the idempotency key is unique globally, not per customer.**
   - Case: customer B sends a key that customer A already used.
   - Result: B gets A's order back.
   - Expected: the unique constraint is on `(customer_id, idempotency_key)`, and B gets their own new order.
   - Also say what happens when the same key arrives with a different cart; I suggest `422`.

4. **Medium: the source of `unit_price` and `total` is not stated.**
   - If they come from the client's cart, a customer can set their own price.
   - The design has no price table and no named module that owns prices; say where the server looks them up.

## Fix during the build

5. **Medium: the test plan misses the concurrent and recovery paths.** Add tests for:
   - the reconciliation job: charge found paid, found declined, not found;
   - two simultaneous buyers of the last unit;
   - two simultaneous `POST /orders` with the same key;
   - two jobs settling the same order.

6. **Medium: two concurrent duplicate requests are not described.** The second one hits the unique constraint rather than finding an existing row. It must roll back its stock reservation and return the first order, not a `500`.

7. **Low: deadlock on multi-item carts.** Order 1 reserves SKU A then B while order 2 reserves B then A; Postgres aborts one. Reserve in sorted SKU order.

8. **Low: the confirmation email can be lost.** A crash after the `PAID` commit and before the email is queued sends nothing. Either write the email request in the same transaction as `PAID`, or accept the loss and say so.

9. **Low: missing keys and constraints in the data model.** Add a primary key on `stock.sku` and `order_items (order_id, sku)`, the foreign key, and `CHECK (available >= 0)`.

10. **Low: worst-case response time is not stated.** Four attempts at 5 s plus backoff is about 30 s, which may exceed the load balancer's timeout. State the backoff values and check they fit.

11. **Low: retry after a decline is not stated.** The client must send a new `Idempotency-Key` to try another card, since the old key returns the `FAILED` order.

Capacity is not a concern: 2,000 orders a day is well within one Postgres and two instances.

VERDICT: READY WITH CHANGES
