Create Purchase Order
Endpoint: POST /purchase-orders
Authentication: Bearer Token (required)
Headers
| Name | Type | Required | Description |
|---|---|---|---|
| Authorization | string | Yes | Bearer token for authentication. Format: Bearer <token> |
| Content-Type | string | Yes | Must be application/json |
Request Body
The request body must be a JSON object with the following structure:
| Field | Type | Required | Description |
|---|---|---|---|
| status | string | Yes | Purchase order status. Must be "PENDING" |
| currencyString | string | Yes | ISO 4217 currency code (e.g., "USD", "EUR", "ZAR") |
| companyIdString | string | Yes | UUID of the company placing the purchase order |
| supplierIdString | string | Yes | UUID of the supplier for the purchase order |
| items | array of objects | Yes | Array of line items in the purchase order |
| charges | array of objects | No | Array of additional charges for the purchase order |
Items Object
| Field | Type | Required | Description |
|---|---|---|---|
| itemCode | string | Yes | Unique code identifying the item |
| qty | number | Yes | Quantity of the item being ordered |
| unitPrice | number | Yes | Unit price of the item in the specified currency |
| amount | number | Yes | Total amount for the line item (qty × unitPrice) |
Charges Object
| Field | Type | Required | Description |
|---|---|---|---|
| amount | number | Yes | Charge amount in the specified currency |
Example Request Body
{
"status": "PENDING",
"currencyString": "USD",
"companyIdString": "{{companyId}}",
"supplierIdString": "{{supplierId}}",
"items": [
{
"itemCode": "{{itemCode}}",
"qty": {{qty}},
"unitPrice": {{unitPrice}},
"amount": {{amount}}
}
],
"charges": [
{
"amount": {{charge}}
}
]
}