The design is sound and you can start building tomorrow, provided you make four small additions to the doc first; none of them changes the architecture. The core choices are right: stock is reserved atomically, no transaction is held open across the payment call, both sides are idempotent, and a reconciliation job covers unknown results.

## Fix before building

**1. Stock can be restored twice for one failed order (high).**
Steps 5 and 6 both mark an order `FAILED` and restore stock, but nothing says the transition only happens if the order is still `PENDING`. The doc also doesn't say the reconciliation job runs on only one of the two instances.
- **Failing case:** an order for 1 unit is declined at the provider while the service's result is unknown. At the next run, the job on both instances reads the same `PENDING` order and both restore stock.
- **Wrong result:** `available` goes up by 2, and you later sell a unit that doesn't exist. Expected: up by 1.
- **Fix:** make every status change `UPDATE orders SET status = … WHERE id = … AND status = 'PENDING'`, and restore stock or send email only if that update changed a row.

**2. Reconciliation has no rule for "provider has no record of this charge" (high).**
Step 6 only covers `PAID` or `FAILED`.
- **Failing case:** the instance crashes after step 2 commits and before step 3 calls the provider. The order is `PENDING`, stock is reserved, and the provider returns "not found".
- **Wrong result:** as written, the order stays `PENDING` and holds stock until the 30-minute alert pages a human. Expected: it is marked `FAILED` and stock is restored.
- **Fix:** state that "not found" means `FAILED` with stock restore, and that a `FAILED` from reconciliation restores stock just as step 5 does.

**3. The idempotency key's uniqueness is not scoped to the customer (medium).**
Step 1 puts a unique constraint on the key alone.
- **Failing case:** customer B sends a key that customer A already used.
- **Wrong result:** B gets A's order back. Expected: B's own order is created.
- **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 answer.

**4. The test plan skips the paths most likely to break (medium).**
Add integration tests for:
- the reconciliation job: paid, declined, not found, and still unknown;
- a crash between step 2 and step 3;
- two concurrent requests with the same key;
- two concurrent buyers for the last unit;
- the double-settle case from item 1.

## Fix during the build

- **Deadlocks on multi-item carts (low–medium).** Cart 1 holds SKU A and wants B while cart 2 holds B and wants A; Postgres aborts one and that customer gets a 500. Reserve SKUs in sorted order.
- **Confirmation email can be lost (low).** If the instance crashes after the `PAID` commit and before queueing, the customer pays and gets no email. The doc also doesn't say reconciliation queues an email when it settles `PAID`. Either write an email row in the same transaction as `PAID`, or accept the gap and say so.
- **No way for the client to learn the outcome after a `202` (low).** The doc doesn't mention a `GET /orders/{id}`.
- **Schema gaps (low).** There are no primary keys on `order_items` or `stock`, no `CHECK (available >= 0)`, and no constraint on `status` values.

## Speculative

- **Request duration.** The worst case in step 3 is four 5-second attempts plus backoff, roughly 27 seconds or more. If the load balancer or client times out at 30 seconds, clients will see errors rather than `202`. Check the load balancer timeout and write down the backoff values.
- **Late charge on a failed order.** If a charge lands after reconciliation has already marked the order `FAILED`, the customer is charged for a failed order. The fix in item 1 exposes this (the `PAID` update changes no row); decide whether that triggers a refund or an alert.
- **Refunds and cancellations.** There is no status for either. That is fine if they are out of scope for this revision, but say so in the doc.

VERDICT: READY WITH CHANGES
