You can start building tomorrow, but fix the first three items below in the doc before you write the order flow. The overall shape is sound. Stock reservation is atomic, the charge happens outside the transaction, the provider gets an idempotency key, and reconciliation handles unknown results. The gaps are in how the pieces interact.

## Problems, by severity

**High**

1. **Reconciliation doesn't say it restores stock.** Step 6 settles orders as `PAID` or `FAILED`, but only step 5 restores stock.
   - Failing case: the service crashes after step 2 commits and before any charge is sent. The order stays `PENDING` and the provider has no charge for it. Reconciliation marks it `FAILED`, and the reserved units are never returned.
   - Expected: every move to `FAILED` restores stock, whichever path it takes.
   - Also say that "provider has no record of this charge" counts as `FAILED`.
2. **Nothing stops two writers settling the same order.** The request thread and the reconciler (on both instances) can act on the same `PENDING` order.
   - Failing case: both see it as `PENDING`, both mark it `FAILED`, and stock is restored twice.
   - Fix: make every status change conditional (`UPDATE ... WHERE status = 'PENDING'`), and restore stock only if that update changed a row.
   - Decide how the reconciler runs on two instances: a Postgres advisory lock, or `FOR UPDATE SKIP LOCKED` on the rows it picks up.
3. **The charge request isn't specified.** The flow never says where the payment method or token comes from. It also doesn't say whether `total` and `unit_price` are computed on the server or taken from the client's cart.
   - If the client sends prices, anyone can pay 1 cent for anything.
   - The doc needs to state that prices come from a server-side source, and that source doesn't exist in the data model yet.

**Medium**

4. **Idempotency key rules are incomplete.**
   - The unique constraint isn't in the data model table.
   - The key should be scoped per customer, not global.
   - The same key with a different cart should be rejected (for example with `422`) rather than silently returning the old order.
   - A concurrent duplicate hits the unique violation inside the stock transaction. State that the handler catches it and returns the existing order.
5. **Reconciliation has no tests listed.** It is the safety net for the worst case (money taken, order unsettled). Add tests for:
   - `PENDING` order with no provider charge
   - `PENDING` order that was actually charged
   - two settlers racing on one order
   - a decline restoring stock
6. **Which charge errors are retried isn't defined.** A decline must not be retried. A 5xx or timeout should be. Also, 4 attempts at 5 s plus backoff can hold the request for about 30 s, which may exceed the client's own timeout. Set a total time budget.
7. **Confirmation email can be lost.** 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 same transaction as the `PAID` update, or accept the loss and record it as known debt. Also name the queue technology, since it isn't in the Context section.

**Low**

8. **Possible deadlocks when reserving stock.** Updating several SKUs in cart order can deadlock two concurrent orders. Sort by `sku` before updating. The risk is low at 2,000 orders a day, but sorting costs nothing.
9. **Schema is loose.**
   - `status` has no check constraint.
   - `order_items` has no primary key, foreign key, or index on `order_id`.
   - `stock.sku` has no primary key.
   - There's no check that `available >= 0`.
10. **Missing details.**
    - The HTTP responses for the `FAILED` case and the `202` case aren't defined.
    - There's no authentication or customer authorization on `POST /orders`.
    - There's no alert if the reconciliation job itself stops running. Today the only alert is a 30-minute `PENDING` order.

## Cost of fixing

Items 1, 2, 4 and 6 are design text, about an hour. Item 3 needs a decision from you on where prices come from. Items 5 and 9 are test and schema work you'd do anyway while building, and item 7 is a decision to record. None of it blocks the first day's work (schema, reservation, idempotency).

VERDICT: READY WITH CHANGES
