Add New invoice
POST/api/invoices
Headers
| Field | Type | Description |
|---|---|---|
| authtoken | String | Authentication token, generated from admin area |
Parameters
| Field | Type | Description |
|---|---|---|
| clientid | Number | Mandatory. Customer id |
| number | Number | Mandatory. Invoice Number |
| date | Date | Mandatory. Invoice Date |
| currency | Number | Mandatory. currency field |
| newitems | Array | Mandatory. New Items to be added |
| subtotal | Decimal | Mandatory. calculation based on item Qty, Rate and Tax |
| total | Decimal | Mandatory. calculation based on subtotal, Discount and Adjustment |
| billing_street | String | Mandatory. Street Address |
| allowed_payment_modes | Array | Mandatory. Payment modes |
| billing_city | String | optional Optional. City Name for billing |
| billing_state | String | optional Optional. Name of state for billing |
| billing_zip | Number | optional Optional. Zip code |
| billing_country | Number | optional Optional. Country code |
| include_shipping | boolean | optional Optional. set yes if you want add Shipping Address
|
| show_shipping_on_invoice | boolean | optional Optional. Shows shipping details in invoice. |
| shipping_street | String | optional Optional. Address of shipping |
| shipping_city | String | optional Optional. City name for shipping |
| shipping_state | String | optional Optional. Name of state for shipping |
| shipping_zip | Number | optional Optional. Zip code for shipping |
| shipping_country | Number | optional Optional. Country code |
| duedate | Date | optional Optional. Due date for Invoice |
| cancel_overdue_reminders | boolean | optional Optional. Prevent sending overdue remainders for invoice |
| tags | String | optional Optional. TAGS comma separated |
| sale_agent | Number | optional Optional. Sale Agent name |
| recurring | String | optional Optional. recurring 1 to 12 or custom |
| discount_type | String | optional Optional. before_tax / after_tax discount type |
| repeat_every_custom | Number | optional Optional. if recurring is custom set number gap |
| repeat_type_custom | String | optional Optional. if recurring is custom set gap option day/week/month/year |
| cycles | Number | optional Optional. number of cycles 0 for infinite |
| adminnote | String | optional Optional. notes by admin |
| removed_items | Array | optional Optional. Items to be removed |
| clientnote | String | optional Optional. client notes |
| terms | String | optional Optional. Terms |
curl -X POST "https://yoursite.com/api/invoices" \
-H "authtoken: YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "clientid": "...", "number": "...", "date": "...", "currency": "...", "newitems": "...", "subtotal": "...", "total": "...", "billing_street": "...", "allowed_payment_modes": "..." }' Success-Response:
HTTP/1.1 200 OK
{
"status": true,
"message": "Invoice Added Successfully"
} Error-Response:
HTTP/1.1 404 Not Found
{
"status": false,
"message": "Invoice Add Fail"
} Error-Response:
HTTP/1.1 409 Conflict
{
"status": false,
"error": {
"number":"The Invoice number is already in use"
},
"message": "The Invoice number is already in use"
} Error-Response:
HTTP/1.1 404 Not Found
{
"status": false,
"error": {
"allowed_payment_modes[]": "The Allow Payment Mode field is required."
},
"message": "<p>The Allow Payment Mode field is required.</p>\n"
} Error-Response:
HTTP/1.1 404 Not Found
{
"status": false,
"error": {
"billing_street": "The Billing Street field is required"
},
"message": "<p>The Billing Street field is required</p>\n"
} Error-Response:
HTTP/1.1 404 Not Found
{
"status": false,
"error": {
"newitems[]": "The Items field is required"
},
"message": "<p>The Items field is required</p>\n"
} Error-Response:
HTTP/1.1 404 Not Found
{
"status": false,
"error": {
"subtotal": "The Sub Total field is required"
},
"message": "<p>The Sub Total field is required</p>\n"
} Error-Response:
HTTP/1.1 404 Not Found
{
"status": false,
"error": {
"total": "The Total field is required"
},
"message": "<p>The Total field is required</p>\n"
}