**Not quite ready to build from, but close.** The core flow is sound for 200–2,000 orders a day. The payment idempotency, the conditional stock `UPDATE`, and the charge call kept outside the transaction are all correct. There are 4 gaps to settle in the doc before you start, because they change the schema and the flow. The rest can be settled while building.

## Fix before building

1. **Nothing guards the status changes, so stock can be restored twice.** The request thread (step 5) and the reconciliation job (step 6) can both settle the same order. Example: the provider declines the charge, the request marks the order `FAILED` and restores stock, and the reconciliation job reads the order as `PENDING` at the same moment and does the same. The stock goes up twice, which oversells. Fix: every transition is `UPDATE orders SET status=… WHERE id=:id AND status='PENDING'`. Restore stock only if that update changed a row. Put this rule in the doc.

2. **There is no rule for an order that was never charged.** If the service crashes after step 2 commits and before the charge call, the order is `PENDING` and the provider has no such charge. Step 6 only says "settles as PAID or FAILED". It doesn't say what happens when the provider answers "not found". Decide this one, because stock stays reserved until it's decided. A reasonable rule is that "not found" after N minutes means `FAILED` plus a stock restore, using the same guarded update as in 1.

3. **Two instances will both run the reconciliation job.** The job runs every 5 minutes, and the design has two instances. Fix: use `SELECT … FOR UPDATE SKIP LOCKED` or a Postgres advisory lock. Also say that settling an order as `PAID` queues the confirmation email, as step 4 does.

4. **The schema has no keys or constraints.**
   - The unique constraint on `idempotency_key` doesn't say what it covers. Make it `(customer_id, idempotency_key)`, or one customer's key can return another customer's order.
   - There are no primary keys on `stock(sku)` or `order_items`, no foreign key from items to orders, and no `CHECK (available >= 0)`.
   - There is no index for the reconciliation query (`status, created_at`).
   - Two clients sending the same key at once will hit a unique violation on insert. The doc should say the loser re-reads and returns the winner's order.

## Fix while building

- **Module rule vs. step 2.** "No module reads another's tables" conflicts with one transaction that updates `stock` and inserts into `orders`. Name how inventory and orders share a transaction, for example a unit-of-work passed into both. This is the decision most likely to cause rework.
- **Deadlocks.** Reserve SKUs in sorted order so two carts with overlapping items can't deadlock.
- **Request time.** 3 retries at 5 s plus backoff can hold the HTTP request for 20 s or more. Set a total deadline, or return `202` earlier.
- **Where prices come from.** `unit_price` and `total` have no stated source. Compute them server-side. Say whether the client's cart prices are trusted.
- **Email queue.** It isn't in the infrastructure list. State what it is. Committing and then queuing can lose an email on a crash. That's acceptable at this scale if you say so.
- **Errors and auth.** Add an error body shape and say how the customer is authenticated.

## Tests to add

The test list is good but has no reconciliation tests. Add these:
- Reconciliation settling `PAID`, settling `FAILED`, and handling "not found".
- Two concurrent `POST`s with the same key.
- Two buyers racing for the last unit.
- A decline racing the reconciliation job (the double restore from item 1).
- Email failure leaving the order `PAID`.
- A partial-cart stock failure rolling back every reservation.

VERDICT: READY WITH CHANGES
