**Almost. The design is sound for 200 to 2,000 orders a day, but fix the reconciliation gaps below before you write that code.** The core flow is right: reserve stock, then charge outside the transaction, with the order id as the provider idempotency key and a reconciliation job as the safety net. Nothing here needs a redesign. There are four things to settle before building and a few smaller ones.

## Settle these before building

1. **Stock can be restored twice.**
   - Two instances both run the 5-minute reconciliation job. Both find order A `PENDING` and see the provider say "declined". Both mark it `FAILED` and add its quantity back to `stock`. The stock count is now too high, so you can oversell.
   - Step 5 (a decline in the request path) racing with reconciliation does the same thing.
   - Fix: make every status change conditional (`UPDATE orders SET status='FAILED' WHERE id=:id AND status='PENDING'`). Restore stock only when that update changed a row, in the same transaction. Alternatively, use `SELECT … FOR UPDATE SKIP LOCKED` in the job. Write the allowed transitions into the doc (`PENDING→PAID`, `PENDING→FAILED`, nothing else).

2. **A crash between step 2 and step 3 is not covered.**
   - If an instance dies after the commit but before the charge call, the order is `PENDING` and stock is reserved, but the provider has never heard of the order.
   - The doc doesn't say what reconciliation does when the provider answers "no such charge". It could mark the order `FAILED` and restore stock, or retry the charge. Pick one. Marking it `FAILED` is simpler, but only if you know the original request can't still be in flight. The 2-minute threshold covers that, because the retries finish in well under a minute.

3. **Where prices come from is unspecified.** `unit_price` and `total` are stored on the order, but the doc never says whether they come from the client's cart or from a server-side catalog. If they come from the client, anyone can buy anything for 1 cent. State that the server prices the order.

4. **The module rule conflicts with the transaction in step 2.**
   - "No module reads another module's tables" conflicts with one transaction that updates `stock` (inventory) and inserts into `orders` (orders).
   - Pick one approach and write it down. For example, `OrderCheckout` opens the transaction and passes it to each module's repository. That is fine at your size, and it's the right trade over separate services.

## Smaller gaps (fix in the doc or while building)

- **Concurrent duplicate requests.**
  - Two requests with the same `Idempotency-Key` arrive at once. The second one hits the unique-constraint error and must catch it and return the first order, not a `500`.
  - Scope the key per customer, `(customer_id, idempotency_key)`, so two customers can't collide.
- **Deadlocks on multi-item carts.** Reserve SKUs in sorted order so two carts with the same items can't lock each other.
- **Lost confirmation email.** If the process dies after the `PAID` commit but before the email is queued, the email is never sent. Write an outbox row in the `PAID` transaction instead. The doc also doesn't say which queue you'll use.
- **What counts as a decline.** A provider 5xx or timeout must be retried, never treated as a decline, or you'll fail orders that were charged. Say which responses mean "declined".
- **The client has no way to follow up on a `202`.** Add `GET /orders/{id}` to the design.
- **Schema.** Add a primary key on `stock.sku`, a primary key on `order_items (order_id, sku)`, a check for `available >= 0`, and an index on `orders (status, created_at)` for the reconciliation query.

## Tests

The plan covers the happy and failure paths of the request. It has no tests for the riskiest part, reconciliation. Add these before writing the job:

- Settles to `PAID` and to `FAILED`.
- Provider has no record of the charge.
- Two job runs at once restore stock exactly once.
- A decline in the request path racing with the job.
- Concurrent duplicate `POST /orders`.
- Email failure leaves the order `PAID`.

VERDICT: READY WITH CHANGES
