Procurement API
Purchase Orders
Create and manage auditable purchase orders from draft through supplier acknowledgement and fulfilment.
Auth
OAuth 2.0 / scoped access
Idempotency
Supported on writes
Audit
Lifecycle history
Rate limit
100 requests / min
Order lifecycle
Draft
Build the order
Validate
Check supplier, terms and quantities
Approve
Apply purchasing approvals
Submit
Send to supplier
Fulfil
Track acknowledgement and delivery
Create an order
POST
/v1/purchase-ordersGET
/v1/purchase-orders/{id}PATCH
/v1/purchase-orders/{id}POST
/v1/purchase-orders/{id}/cancelGET
/v1/purchase-ordersOrder lines
| Field | Type | Description |
|---|---|---|
| product_id | uuid | Mediloop product reference |
| supplier_product_id | uuid | Supplier offer/catalog item |
| quantity | decimal | Requested order quantity |
| uom | string | Unit of measure / pack |
| unit_price | money | Resolved commercial price |
| agreement_id | uuid? | Applied price agreement when relevant |
Approval & submission
Separate drafting from submission. Organization permissions and internal purchasing approvals should be resolved before the order becomes visible to the supplier. Preserve the effective approver, membership and tenant context in the audit trail.
Order status
draftEditable
submittedAwaiting supplier
acknowledgedSupplier accepted
fulfillingIn fulfilment
partially_fulfilledPartial shipment
fulfilledCompleted
cancelledStopped
Idempotency
Send an
Idempotency-Key for create, submit and cancellation requests. Retrying the same business operation must not create duplicate orders or duplicate supplier actions.Example request
cURLJavaScriptPython
curl -X POST "https://api.mediloop.com/v1/purchase-orders" \
-H "Authorization: Bearer $MEDILOOP_API_KEY" \
-H "X-Tenant-Id: $TENANT_ID" \
-H "Idempotency-Key: po-2026-00042" \
-H "Content-Type: application/json" \
-d '{"supplier_id":"sup_42","lines":[{"product_id":"prod_123","quantity":20}]}'Create a purchase order
Response201 Created
{
"id": "po_42",
"status": "draft",
"supplier_id": "sup_42",
"total": { "amount": 178.00, "currency": "EUR" }
}