Skip to main content

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

HeaderValueRequiredDescription
X-API-Key{api_key}YesAPI key for authentication.
Content-Typeapplication/jsonYesThe 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

FieldTypeRequiredDescription
currencyCodeStringstringYesThe ISO 4217 currency code (e.g., "USD", "EUR", "GBP").
customerIdStringstringYesThe unique identifier of the customer for this sales order.
orderDatestring (date)YesThe date the order was placed (ISO 8601 format: YYYY-MM-DD).
dueDatestring (date)YesThe due date for the order (ISO 8601 format: YYYY-MM-DD).
notesstringNoOptional notes or comments for the sales order.
authorizedbooleanYesWhether the sales order is authorized upon creation.
itemsarrayYesAn array of line items included in the sales order.
chargesarrayNoAn array of additional charges applied to the sales order.

Items Array Fields

Each object in the items array has the following fields:

FieldTypeRequiredDescription
itemCodestringYesThe code or SKU of the item being ordered.
qtynumberYesThe quantity of the item being ordered.
unitPricenumberYesThe unit price of the item.
amountnumberYesThe total amount for this line item (qty × unitPrice).

Charges Array Fields

Each object in the charges array has the following fields:

FieldTypeRequiredDescription
amountnumberYesThe amount of the additional charge.
descriptionstringNoA description of the charge.
chargeTypestringNoThe type or category of the charge (e.g., "shipping", "tax", "handling").