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
- 200
- 400
- 404
- 500
The network order of that purchase order, in any state. localOrderId is present only once the order was acknowledged.
The poNumber is not 1-128 URL-safe characters (invalid-purchase-order-number), or a query parameter was sent (unknown-query-parameter: this route declares none), or the query string contains a NUL character (invalid-request).
No network order was received for that purchase-order number (purchase-order-not-found), or a path that carries a NUL character (resource-not-found).
An RFC 7807 problem document. A NUL character (U+0000) is never valid input (PostgreSQL text cannot hold it): in the request path it is a 404 resource-not-found, in a query parameter a 400 invalid-request, and in a request body a 400 malformed-request-body.