Adds one or more supplier packages to an existing purchase order.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
The request body is a flat array of package objects — not wrapped in a parent object. The purchase order must be in IN_PROGRESS status.
With the Order Approval module, an order in AWAITING_APPROVAL or REJECTED status is accepted too; see Order approval below.
quantity and to_par
quantity and to_parEach package entry must provide either quantity or to_par, but not both:
quantity— the number of units to order. Must be a non-negative number. Sending0removes the package from the order if it was already present.to_par— whentrue, the quantity is automatically calculated aspar − (current stock + outstanding orders), rounded up. If stock already meets or exceeds par, the calculated quantity is0and the package is removed from the order if it was already present.
Order approval
With the Order Approval module, an order can also be in AWAITING_APPROVAL or REJECTED status. Adding packages to such an order takes it back first, in the same transaction as the edit, so a refused edit leaves it as it was:
- The order returns to
IN_PROGRESSand becomes the caller's, whoever owned it before. - Its pending order approval is cancelled (
status: cancelled). Arejectedone staysrejected. If the order still needs approval when it is sent again, a new order approval is created. - The caller's own
IN_PROGRESSorder for the same outlet and supplier is deleted, without warning, because a user can have only one open order per outlet and supplier. The caller's orders inAWAITING_APPROVALare not affected.
This works whether or not the library still has the Order Approval module, so orders parked before the module was removed can still be edited and sent.
400The body is not valid, a supplier package does not exist, belongs to another supplier or can no longer be ordered, a packaging option is invalid, or the order is already ORDERED or DELIVERED. Nothing is changed, and an order that would have been taken back for editing keeps its status.
403The token lacks the procurement scope, the library does not have the Ordering module, or the user lacks the Create Orders permission.
404The purchase order does not exist or is not accessible to the caller.
