Skip to content
PharmaFlow Knowledgebase
Esc
↑↓navigate↵open⌘Jpreview

Send or cancel a purchase order

Admin and branch manager. Moves an order to SENT or CANCELLED and writes an audit entry. A status that is neither, or an order already received or cancelled, is refused with 400.

PUT/api/v1/purchase-orders/{purchaseOrderId}/status
Authorization
AuthorizationBearer token (JWT) · headerrequired

JWT from POST /api/v1/auth/login sent as Authorization Bearer.

Path parameters
purchaseOrderIdstringrequired

The purchase order being moved.

Request body
requiredapplication/json
statusstringrequired
Responses
200

The new status

idstringrequired
statusstringrequired
400

status is neither SENT nor CANCELLED, the PO is already received, or it is already cancelled

detailstringrequired
401

Not authenticated

detailstringrequired
403

Access forbidden for this role

detailstringrequired
404

PO not found

detailstringrequired
Try it
Server
Authorization
Parameters
Bodyapplication/json
Request
curl -X PUT 'http://localhost:8000/api/v1/purchase-orders/string/status' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
  "status": "string"
}'
Response
{
  "id": "string",
  "status": "string"
}