Create a purchase order
Admin and branch manager. Raises a purchase order with its line items in one transaction. The supplier and branch must exist and be active, and the order opens as DRAFT and is audited.
POST
/api/v1/purchase-ordersAuthorization
AuthorizationBearer token (JWT) · headerrequiredJWT from POST /api/v1/auth/login sent as Authorization Bearer.
Request body
requiredapplication/jsonsupplier_idstringrequiredmin length 1
branch_idstringrequiredmin length 1
expected_datestring | nullnotesstringdefault: ""
itemsobject[]requiredmin items 1
Show propertiesHide properties
Array of
objectmedicine_idstringrequiredmin length 1
ordered_qtyintegerrequiredmin -9007199254740991 · max 9007199254740991
agreed_unit_costnumberrequiredResponses
201
Purchase order drafted
idstringrequiredstatusstringrequiredcreated_atstringrequired400
The request body fails validation
detailstringrequired401
Not authenticated
detailstringrequired403
Access forbidden for this role
detailstringrequired404
Supplier not found, or branch not found
detailstringrequired