Skip to main content

Get the network order of one purchase order

GET 

/purchase-orders/:poNumber

The same NetworkOrder that GET /network-orders/{networkRef} returns (state, site, requiredShipBy, acknowledgeBy, receivedAt, acknowledgementOverdue, networkRef, the lines, and localOrderId once the order was acknowledged), found by the network's purchase-order number instead of by networkRef.

This route exists for a caller that knows only the purchase-order number. The networkRef is minted by this context the first time a purchase order is seen and is never derived from the number (ADR 0026), so nobody outside can work it out; the purchase-order number is known outside. With this route such a caller can follow a purchase order to the order-management order raised for it: read localOrderId from the answer (ADR 0036).

It is a KEYED READ, not a listing. It answers for exactly one purchase-order number, takes no query parameter (any is a 400 unknown-query-parameter) and has no paging, so it does not widen GET /network-orders, which stays the only list. It reads the same stored order as its sibling, so the two always agree.

A 404 purchase-order-not-found means this context holds no demand for that number: it was never polled, or the poll that would bring it has not run yet (a caller waiting for a purchase order it expects should retry). In NETWORK_MODE=stub nothing keeps the map from purchase-order number to networkRef (ADR 0026: the map tables stay empty), so every number is a 404 there; the stub's demand is read by networkRef.

Request​

Responses​

The network order of that purchase order, in any state. localOrderId is present only once the order was acknowledged.