**The design is sound at its core and you can start building tomorrow, but three gaps need a decision written into the doc first.** Two of them can corrupt stock or leave orders stuck, and the third is a possible pricing hole.

The parts that hold up: the stock reservation is atomic and cannot oversell, the charge runs outside any database transaction, the order id as the provider idempotency key prevents double charges, and the reconciliation job covers a crash after the charge succeeds.

## Fix before building

1. **A failed order can have its stock restored twice.**
   - **Case:** an order for 1 unit of SKU A is left `PENDING` after timeouts. The reconciliation job fires on both instances at once, both learn the charge was declined, and both run step 5.
   - **Result:** `available` goes up by 2 instead of 1, and you later sell a unit you don't have.
   - **Fix:** make every status change conditional (`UPDATE orders SET status = 'FAILED' WHERE id = :id AND status = 'PENDING'`) and restore stock only if that changed a row. Apply the same guard to `PAID`.

2. **Step 6 doesn't say what happens when the provider has no record of the charge.**
   - **Case:** the instance crashes after step 2 commits but before step 3 calls the provider. The job asks for the charge status and gets "not found", which is neither `PAID` nor `FAILED`.
   - **Result:** the order stays `PENDING` with its stock held until the 30-minute alert pages someone.
   - **Fix:** treat "not found" on an order older than 2 minutes as `FAILED` and restore the stock. The request's worst-case retry window is about 30 seconds, so nothing is still in flight by then. Also state what the job does when the provider reports the charge as still processing (leave it for the next run).

3. **The design doesn't say where prices come from.** The client sends the cart, and there is no price or catalog table. If `unit_price` and `total` are taken from the request, a customer can set their own price. State the server-side price source and that `total` is computed by the service.

## Small additions, can be done as you build

- **Deadlocks on multi-item orders:** two orders reserving SKUs A and B in opposite order can deadlock, and one gets a 500. Reserve in sorted SKU order.
- **Lost confirmation email:** a crash between the `PAID` commit and the enqueue in step 4 loses the email, and nothing retries it. Either accept that in writing or write the email job in the same transaction as `PAID`.
- **Idempotency key scope:** make the unique constraint `(customer_id, idempotency_key)`, and say what happens when the same key arrives with a different cart.
- **Outcome after `202`:** the client needs a `GET /orders/{id}` to poll; the design doesn't list one.
- **Schema details:** the tables list no primary keys, there is no `CHECK (available >= 0)` on `stock`, and no column stores the provider's charge id for support and refunds.
- **Retry count:** "up to 3 retries" should say whether that means 3 or 4 attempts. At 4, the request can run close to a typical 30-second load balancer timeout.

## Tests to add to the plan

- The reconciliation job itself: settles as paid, settles as declined, and provider has no record.
- Two reconciliation runs on the same order, asserting stock is restored once.
- Two concurrent buyers for the last unit (the current list only covers one).
- Two concurrent `POST /orders` with the same key.
- A crash between steps 2 and 3, and between the charge and the `PAID` update.

VERDICT: READY WITH CHANGES
