The design is close. The overall approach holds up: stock is reserved in a transaction, the payment call happens outside it with the order id as the provider's idempotency key, and a reconciliation job settles unknown outcomes. That is the right shape for this scale (200 to 2,000 orders a day). Before you build, I'd make five changes to the doc. Each one is a sentence or two, not a redesign, and each would otherwise cause wrong stock counts, wrong charges or a confused client.

## Changes to make before building

**1. A `FAILED` order from the reconciliation job never gives its stock back.**
Step 5 restores stock when a card is declined during the request. Step 6 only says the job "settles them as `PAID` or `FAILED`."
- *Case:* a customer buys the last unit of SKU `A`. All charge attempts time out, so the order stays `PENDING`. The job later learns the charge was declined and marks the order `FAILED`. `stock.available` for `A` stays at 0 for good, even though nobody bought it.
- *Fix:* define one "fail order" operation (mark `FAILED` and restore stock in one transaction). Use it from both step 5 and the job.

**2. Status changes need a guard, and only one job should run at a time.**
There are two service instances, so the job as written runs on both. The request path and the job can also touch the same order.
- *Case:* both instances' jobs pick up the same declined order and each restores its stock. 1 unit of `A` becomes 2 in `stock`.
- *Fix:*
  - Write every status change as `UPDATE orders SET status = … WHERE id = :id AND status = 'PENDING'`, and only restore stock if exactly one row changed.
  - Have the job claim its orders with `SELECT … FOR UPDATE SKIP LOCKED` or a Postgres advisory lock, so one order is only processed once at a time.

```mermaid
stateDiagram-v2
    [*] --> PENDING: POST /orders (stock reserved)
    PENDING --> PAID: charge succeeds (request or job)
    PENDING --> FAILED: declined or no charge found, stock restored (request or job)
    PAID --> [*]
    FAILED --> [*]
```

Every arrow should only fire while the order is still `PENDING`.

**3. Say what the job does when the provider has no record of the charge.**
If an instance crashes after step 2 commits but before step 3 calls the provider, the order is `PENDING` with no charge behind it. Today it would sit there until the 30-minute alert fires.
- *Fix:* decide between "no charge found means fail the order and restore stock" and "no charge found means try the charge once more." Write the choice into the doc.

**4. Say where prices come from.**
`order_items.unit_price` and `orders.total` exist, but there is no product or price table, and the flow doesn't say whether prices come from the client's cart.
- *Fix:* state that the server looks up prices itself and never trusts prices sent by the client. Otherwise a modified client could send `unit_price: 0.01`.

**5. Give the client a way to follow up on a `202`.**
Step 6 returns `202`, but there is no read endpoint.
- *Fix:* add `GET /orders/{id}` and state that retrying `POST` with the same `Idempotency-Key` returns the current status.

## Smaller points to settle while building

- **Lock stock rows in a fixed order.** Two carts holding the same SKUs in opposite order can deadlock each other in step 2. Sort the SKUs before running the `UPDATE`s, and merge duplicate SKUs in a cart into one line.
- **Handle two requests with the same key at the same moment.** The second request hits the unique constraint when it inserts. Catch that error and return the existing order, not a `500`.
- **Scope the key to the customer.** `UNIQUE (customer_id, idempotency_key)` is safer than making the key unique across all customers.
- **One transaction across modules.** Step 2 updates inventory's `stock` and inserts into orders' `orders` in one transaction. That fits the "no module reads another module's tables" rule only if each module offers an operation that runs inside a transaction the caller passes in. Write that down so nobody "fixes" it by querying another module's tables directly.
- **Add indexes.** The job needs an index on `orders (status, created_at)`. `order_items` and `stock` also need primary keys.

## Tests to add

These go on top of the integration tests you already list:
- The job settles an order as `PAID`, as `FAILED` (and stock comes back), and handles the "no charge found" case.
- Both instances run the job on the same order, and stock is restored only once.
- Two customers try to buy the last unit at the same time: one gets `PENDING`, the other gets `409`.
- Two `POST /orders` with the same key arrive at the same time and produce one order.

If you want to start tomorrow, you can begin with the parts these changes don't touch: routes, the idempotency key on `POST /orders`, stock reservation, and the payment client. Update the doc for items 1 to 4 before writing the reconciliation job and the pricing logic.

VERDICT: READY WITH CHANGES
