**Not quite ready to build as written, but close.** The core approach is sound: reserve stock in a transaction, charge outside it, use the order id as the provider's idempotency key, and reconcile whatever is left over. Three gaps involve money or stock and need decisions before you write steps 3 to 6. The rest can be fixed while building.

## Must settle before coding

**1. A settled order can be settled a second time.**
- **Failing case:** the charge declines and step 5 marks the order `FAILED` and restores 2 units of stock. A reconciliation run that read the order as `PENDING` a moment earlier also settles it as `FAILED` and restores 2 more units. Stock now shows 2 units that don't exist, so you can oversell.
- **Expected:** exactly one restore.
- **Fix:** write down that every status change is `UPDATE orders SET status=… WHERE id=:id AND status='PENDING'`. Restore stock only if that update changed one row, in the same transaction.
- **Also needed:** two instances both run the reconciliation job. Use `SELECT … FOR UPDATE SKIP LOCKED` or a lock so they don't duplicate work.

**2. The reconciler's "provider has no such charge" case is undefined.**
- **Failing case:** the service reserves stock and commits, then crashes before it ever calls the provider. The order stays `PENDING`. Five minutes later the reconciler asks the provider about it and gets "not found". The design doesn't say what happens next.
- **The risky choice:** if you mark it `FAILED`, you will also fail orders whose charge was sent but isn't visible at the provider yet. The charge then lands later, the customer is charged, and the order is `FAILED`.
- **Safer choice:** for "not found", re-send the charge with the same order-id key and settle on that answer. The key makes this safe. State this rule explicitly.
- **Also state:** which provider responses count as "declined" (settle `FAILED`) and which are errors (retry or leave `PENDING`). A 5xx or a validation error is not a decline.

**3. The source of `unit_price` and `total` is undefined.**
- The data model has no product or price table, and the flow says only "the cart".
- If the client sends prices, anyone can buy at any price. State that the server computes prices from a catalog, and say where that catalog lives.

## Fix during the build

- **Deadlocks:** two carts containing the same SKUs in different order will deadlock on the stock updates. Sort items by SKU before reserving.
- **Concurrent duplicate `POST`s:** with the same key, the second insert hits the unique constraint while the first is still uncommitted. Specify catching that error and returning the existing order.
- **Same key, different cart:** decide whether to reject it with `422`. Also scope the key per customer.
- **How a `202` client learns the result:** there is no `GET /orders/{id}` or webhook in the design. The client has no way to find out whether the order became `PAID` or `FAILED`.
- **Lost emails:** if the service crashes after the `PAID` commit and before the email is queued, the email is never sent. Either write an outbox row in the `PAID` transaction or accept the loss and say so. Which queue you use is also unstated.
- **Schema gaps:**
  - Primary keys on `stock(sku)` and `order_items`, plus a foreign key from `order_items` to `orders`.
  - `CHECK (available >= 0)` on `stock` as a backstop.
  - A unique index on `idempotency_key`.
  - An index on `(status, created_at)` for the reconciler.
  - A `CHECK` on `status`.
  - Migrations.
- **Request latency:** the worst case is about 4 attempts × 5 s plus backoff, roughly 30 s or more of request time. That is fine at your volume, but set the load balancer timeout above it, or `202` will never reach the client.
- **Alert:** the 30-minute `PENDING` alert has no runbook. Say what the on-call person does.

## Tests to add

The test list has no reconciliation tests at all, and that job carries the riskiest logic. Add:
- Reconciler settles `PAID`, `FAILED`, and not-found.
- Decline racing the reconciler restores stock once.
- Two concurrent identical `POST`s.
- Crash between the stock commit and the charge.
- Carts with the same SKUs in opposite order, run concurrently.
- Same key with a different cart.

Per your standards, write these tests first for the status-transition code. They define the behaviour in items 1 and 2.

VERDICT: READY WITH CHANGES
