Create Sales Order
Create a new sales order with items, charges, and customer details.
Endpoint
POST /sales-orders
Authentication
API Key (passed in the X-API-Key header)
Request Headers
| Header | Value | Required | Description |
|---|---|---|---|
X-API-Key | {api_key} | Yes | API key for authentication. |
Content-Type | application/json | Yes | The content type of the request body. |
Example Request
curl -X POST "https://api.example.com/sales-orders" \
-H "X-API-Key: {api_key}" \
-H "Content-Type: application/json" \
-d '{
"currencyCodeString": "USD",
"customerIdString": "{{customerUid}}",
"orderDate": "2026-05-06",
"dueDate": "2026-05-13",
"notes": "Thank you for your business",
"authorized": true,
"items": [
{
"itemCode": "{{itemCode}}",
"qty": {{qty}},
"unitPrice": {{unitPrice}},
"amount": {{amount}}
}
],
"charges": [
{
"amount": {{charge}}
}
]
}'
Request Schema
The request body must be a JSON object with the following structure:
Root Fields
| Field | Type | Required | Description |
|---|---|---|---|
currencyCodeString | string | Yes | The ISO 4217 currency code (e.g., "USD", "EUR", "GBP"). |
customerIdString | string | Yes | The unique identifier of the customer for this sales order. |
orderDate | string (date) | Yes | The date the order was placed (ISO 8601 format: YYYY-MM-DD). |
dueDate | string (date) | Yes | The due date for the order (ISO 8601 format: YYYY-MM-DD). |
notes | string | No | Optional notes or comments for the sales order. |
authorized | boolean | Yes | Whether the sales order is authorized upon creation. |
items | array | Yes | An array of line items included in the sales order. |
charges | array | No | An array of additional charges applied to the sales order. |
Items Array Fields
Each object in the items array has the following fields:
| Field | Type | Required | Description |
|---|---|---|---|
itemCode | string | Yes | The code or SKU of the item being ordered. |
qty | number | Yes | The quantity of the item being ordered. |
unitPrice | number | Yes | The unit price of the item. |
amount | number | Yes | The total amount for this line item (qty × unitPrice). |
Charges Array Fields
Each object in the charges array has the following fields:
| Field | Type | Required | Description |
|---|---|---|---|
amount | number | Yes | The amount of the additional charge. |
description | string | No | A description of the charge. |
chargeType | string | No | The type or category of the charge (e.g., "shipping", "tax", "handling"). |