Create Invoice
Create a new invoice with items, charges, and customer details.
Endpoint
POST /invoices
Authentication
Bearer Token (passed in the Authorization header)
Request Headers
| Header | Value | Required | Description |
|---|---|---|---|
Authorization | Bearer {token} | Yes | Bearer token for authentication. |
Content-Type | application/json | Yes | The content type of the request body. |
Example Request
curl -X POST "https://api.example.com/invoices" \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{
"currencyCodeString": "USD",
"companyIdString": "{{companyUid}}",
"customerIdString": "{{customerUid}}",
"postingDate": "2026-03-17",
"notes": "Thank you for your business",
"return": false,
"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"). |
companyIdString | string | Yes | The unique identifier of the company issuing the invoice. |
customerIdString | string | Yes | The unique identifier of the customer for this invoice. |
postingDate | string (date) | Yes | The date the invoice was posted (ISO 8601 format: YYYY-MM-DD). |
notes | string | No | Optional notes or comments for the invoice. |
return | boolean | Yes | Whether this invoice is a return/credit note. Set to false for standard invoices. |
items | array | Yes | An array of line items included in the invoice. |
charges | array | No | An array of additional charges applied to the invoice. |
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 invoiced. |
qty | number | Yes | The quantity of the item being invoiced. |
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"). |