**Mostly ready.** The core design holds up: stock is reserved with a guarded `UPDATE`, the payment call happens outside any transaction, every retry uses the same idempotency key, and a reconciliation job settles unknown results. That's the right shape for 2,000 orders a day, and it isn't over-built. But there are two correctness bugs and one gap that would leave orders stuck. Each is a few lines in the doc, and you should fix them before you write the code they affect. I've ordered everything below by how much damage it would do in production.

## Must fix before building

**1. Settling an order isn't guarded, so stock can be restored twice.** You run two instances, and the design doesn't say the reconciliation job runs on only one of them. Nothing says the move out of `PENDING` checks the current status either.
- **Case:** order A (2 units of SKU X) stays `PENDING` after a timeout. Both instances run reconciliation, and both see the provider say "declined". Both mark A `FAILED` and add 2 to X. **Actual:** stock goes up by 4. **Expected:** up by 2.
- The same race on the `PAID` path sends two confirmation emails.
- **Fix:** every transition is `UPDATE orders SET status = :new WHERE id = :id AND status = 'PENDING'`. Only restore stock or queue the email if that update changed one row. Also make the job claim its rows (`SELECT … FOR UPDATE SKIP LOCKED`) or run it on one instance only (`pg_try_advisory_lock`). The guard fixes correctness; the claim just avoids wasted provider calls.

**2. Reconciliation has no rule for "the provider has no such charge".** Suppose an instance crashes after step 2 commits but before step 3 sends the charge.
- **Case:** order B is `PENDING` and has stock reserved, but no charge was ever sent. Reconciliation asks the provider about B's id and gets "not found". **Actual:** the design only covers `PAID` and `FAILED`, so B holds its stock until someone notices the 30-minute alert. **Expected:** B goes to `FAILED` and its stock is released.
- **Fix:** write down that not-found older than N minutes means `FAILED` plus stock release, and that "still processing" means stay `PENDING`. Make sure N is well above the longest possible request. Today that's 4 attempts × 5 s plus backoff, roughly 30 s, so the 2-minute threshold works. Note that dependency in the doc so nobody raises the timeout without rechecking it.

**3. Orders settled by reconciliation never get a confirmation email.** Step 4 queues the email, but step 6 doesn't. You can fix this together with #1: put "mark `PAID` and queue the email" in one function that both paths call. If the queue is outside Postgres, a crash between the `PAID` commit and the enqueue loses the email. An outbox table written in the same transaction closes that hole, and at this volume it's simple.

## Should fix (small, but write it down now)

- **Deadlocks between carts with the same SKUs.** Cart 1 has [X, Y] and cart 2 has [Y, X]. Each locks its first row and waits for the other's. Postgres aborts one of them with a deadlock error, which surfaces as a `500`, not a `409`. **Fix:** update stock rows in SKU order.
- **Two requests with the same idempotency key at once.** Both reserve stock, and one hits the unique constraint. Its rollback correctly releases its stock. But the design must say the handler catches that violation and returns the existing order, not a `500`. Also decide what happens when the key is reused with a *different* cart. I suggest storing a hash of the request and returning `422` when it doesn't match. Scope the unique constraint to `(customer_id, idempotency_key)`.
- **Where prices come from.** The client "sends the cart", and `order_items.unit_price` is stored, but there's no price source in the design. If prices come from the request body, a client can set its own price. State that prices and `total` are computed on the server, and from what.
- **Cross-module transaction versus "no module reads another module's tables".** Step 2 writes `stock` and `orders` in one transaction. Say how: for example, the inventory module exposes `reserve(tx, items)` and `release(tx, items)` that take the caller's transaction. Otherwise `OrderCheckout` will end up writing `stock` directly.
- **What the client does after a `202`.** There's no `GET /orders/{id}` to poll, and no webhook or notification. Add one.
- **Request length.** A slow provider can hold the request for about 30 s. Check that the load balancer and client timeouts are longer than that. If they're shorter, the client retries with the same key mid-flight, which is safe but confusing.

## Order lifecycle with the guards

```mermaid
stateDiagram-v2
    [*] --> PENDING: stock reserved + order inserted (one transaction)
    PENDING --> PAID: charge succeeded (request or reconciliation)<br/>guard: status = PENDING, then queue email
    PENDING --> FAILED: declined, or provider has no charge after N min<br/>guard: status = PENDING, then release stock
    PAID --> [*]
    FAILED --> [*]
```

## Tests missing from the plan

The reconciliation job is the riskiest code here, and it has no tests listed. Add:
- Reconciliation settles `PAID` (and queues the email), settles `FAILED` (and releases stock), handles not-found, and leaves still-processing orders `PENDING`.
- Two reconciliation runs on the same order: stock is released once and one email is sent.
- A request finishing and reconciliation settling the same order at the same moment.
- Two concurrent `POST /orders` with the same key: one order and one reservation.
- The same key with a different cart.
- Two carts with overlapping SKUs in opposite order: no deadlock.
- A crash after the reserve commit and before the charge, which is case #2.
- One contract test against the provider's sandbox, so the fake can't drift from the real API.

## What's already right

The guarded stock update, keeping payment out of the transaction, using the order id as the provider idempotency key, keeping email off the critical path, and the 30-minute `PENDING` alert are all sound. Two instances on one Postgres is the right size for this load.

You can start tomorrow on the data model, stock reservation, and idempotent `POST /orders`. Update the doc for #1–#3 and the price question before you write the payment and reconciliation code.

VERDICT: READY WITH CHANGES
