Add New Invoice
Prod Env
{{subdomain}}/api2
Prod Env
{{subdomain}}/api2
POST
{{subdomain}}/api2
Last modified:2025-03-23 22:24:55
Maintainer:Not configured
Mandatory Fields
Field | Type | Description |
---|---|---|
client_id | integer | ID of the client for this invoice |
store_id | integer | ID of the store for this invoice |
InvoiceItem | array | At least one invoice item is required |
Invoice Item Mandatory Fields
Field | Type | Description |
---|---|---|
product_id | integer | ID of the product |
quantity | number | Quantity of the product |
unit_price | number | Price per unit |
Common Optional Fields
Field | Type | Description | Default |
---|---|---|---|
currency_code | string | 3-digit currency code | Account default |
date | string | Invoice date (YYYY-MM-DD) | Current date |
draft | integer | Whether this is a draft (0/1) | 0 |
discount | number | Percentage discount | 0 |
discount_amount | number | Fixed amount discount | 0 |
notes | string | Invoice notes | null |
po_number | string | Purchase order number | null |
is_offline | boolean | Whether client is offline (0/1) | 0 |
Invoice Item Optional Fields
Field | Type | Description | Default |
---|---|---|---|
discount | number | Item discount amount | 0 |
discount_type | integer | Discount type (1=Percentage, 2=Absolute) | 1 |
tax1 | integer | First tax ID | null |
tax2 | integer | Second tax ID | null |
col_3 | string | Custom column 3 content | null |
col_4 | string | Custom column 4 content | null |
col_5 | string | Custom column 5 content | null |
Example Request
{
"Invoice": {
"client_id": 15,
"store_id": 1,
"currency_code": "USD",
"date": "2023-03-23",
"draft": 0,
"notes": "Invoice for March services",
"InvoiceItem": [
{
"product_id": 1,
"quantity": 2,
"unit_price": 100
},
{
"product_id": 3,
"quantity": 1,
"unit_price": 50,
"discount": 10,
"discount_type": 1
}
]
}
}
Response
{
"code": 202,
"result": "successful",
"id": 124
}
Request Request Example
Shell
JavaScript
Java
Swift
curl --location -g --request POST '{{subdomain}}/api2/api2/invoices.json' \
--header 'Authorization: Bearer {{token}}' \
--header 'Content-Type: text/plain' \
--data-raw '{
"Invoice": {
"client_id": 15,
"store_id": 1,
"currency_code": "USD",
"date": "2023-03-23",
"draft": 0,
"notes": "Invoice for March services",
"InvoiceItem": [
{
"product_id": 1,
"quantity": 2,
"unit_price": 100
},
{
"product_id": 3,
"quantity": 1,
"unit_price": 50,
"discount": 10,
"discount_type": 1
}
]
}
}'
Response Response Example
{}
Request
Header Params
Authorization
stringÂ
required
Example:
Bearer {{token}}
Body Params text/plain