stock_batch_invoice_add_items
POST /stock_batch_invoice_add_items
To add new items into an existing stock batch invoice.
{
"api_credentials": {
"token": "XXX"
},
"batch_invoice": {
"batch_invoice_number_365": "9991001B1",
"table_id": "29",
"list_invoice_details": [
{
"line_number": "1",
"item_code_365": "CFCCA",
"line_quantity": "1",
"line_price_incl_vat": 3.50,
"line_total_sub": 3.21,
"line_total_discount": 0,
"line_total_discount_percentage": 0.00,
"line_vat_code_365": "009",
"line_total_vat": 0.29,
"line_total_vat_percentage": 9.00,
"line_total_grand": 3.50,
"line_notes": "",
"is_modifier": false,
"root_line_number": 0,
"list_modifiers": [
{
"modifier_prefix": "",
"modifier_code_365": "BRA",
"modifier_name": "Brazil Beta"
},
{
"modifier_prefix": "",
"modifier_code_365": "SYRUPCH",
"modifier_name": "Chocolate"
}
]
},
{
"line_number": "2",
"item_code_365": "ESYCA",
"line_quantity": "1",
"line_price_incl_vat": 0.30,
"line_total_sub": 0.28,
"line_total_discount": 0,
"line_total_discount_percentage": 0.00,
"line_vat_code_365": "009",
"line_total_vat": 0.02,
"line_total_vat_percentage": 9.00,
"line_total_grand": 0.30,
"line_notes": "",
"is_modifier": true,
"root_line_number": 1,
"list_modifiers": null
},
{
"line_number": "3",
"item_code_365": "ESYTA",
"line_quantity": "1",
"line_price_incl_vat": 0.50,
"line_total_sub": 0.48,
"line_total_discount": 0,
"line_total_discount_percentage": 0.00,
"line_vat_code_365": "005",
"line_total_vat": 0.02,
"line_total_vat_percentage": 5.00,
"line_total_grand": 0.50,
"line_notes": "",
"is_modifier": true,
"root_line_number": 1,
"list_modifiers": null
},
{
"line_number": "4",
"item_code_365": "CAFE-FREDDO",
"line_quantity": "1",
"line_price_incl_vat": 2.10,
"line_total_sub": 1.93,
"line_total_discount": 0,
"line_total_discount_percentage": 0.00,
"line_vat_code_365": "009",
"line_total_vat": 0.17,
"line_total_vat_percentage": 9.00,
"line_total_grand": 2.10,
"line_notes": "",
"is_modifier": false,
"list_modifiers": null
},
{
"line_number": "5",
"item_code_365": "101",
"line_quantity": "1",
"line_price_incl_vat": 0.0,
"line_total_sub": 0.0,
"line_total_discount": 0,
"line_total_discount_percentage": 0.00,
"line_vat_code_365": "009",
"line_total_vat": 0.0,
"line_total_vat_percentage": 9.00,
"line_total_grand": 0.0,
"line_notes": "",
"is_modifier": false,
"is_subitem": true,
"exclude_print": true,
"root_line_number": 4,
"list_modifiers": null
},
{
"line_number": "6",
"item_code_365": "RAW-COFFEE",
"line_quantity": "0.02",
"line_price_incl_vat": 0.0,
"line_total_sub": 0.0,
"line_total_discount": 0,
"line_total_discount_percentage": 0.00,
"line_vat_code_365": "009",
"line_total_vat": 0.0,
"line_total_vat_percentage": 9.00,
"line_total_grand": 0.0,
"line_notes": "",
"is_modifier": false,
"is_subitem": true,
"exclude_print": true,
"root_line_number": 4,
"list_modifiers": null
}
]
}
}
| field |
type |
description |
| api_credentials
|
| token |
string |
Credentials provided by Powersoft that allow access to the API |
| batch_invoice
|
| batch_invoice_number_365 |
string |
365 stock batch invoice number |
| table_id |
string |
365 table ID. It is required only if the batch is linked to a table for validation purpose. |
| list_invoice_details
|
| line_number |
int |
The position of this line in the invoice list. eg 1 |
| item_code_365 |
string |
The code of the item in 365 |
| line_quantity |
decimal |
The number of pieces of the item for this invoice line |
| line_price_incl_vat |
decimal |
The price including VAT of the item for this invoice line |
| line_total_sub |
decimal |
The total amount of this line of the invoice before vat, and before any discount. line_total_sub = round((it.line_price_incl_vat * it.line_quantity) / (1 + line_total_vat_percentage / 100),2) |
| line_total_discount |
decimal |
The total discount amount of this line of the invoice. If there is no discount, pass 0.00. line_total_discount = round(line_total_sub * line_total_discount_percentage / 100,2) |
| line_total_discount_percentage |
decimal |
The total discount percentage of this line of the invoice. eg. If the discount is 10%, pass 10.00 If there is no discount, pass 0.00 |
| line_vat_code_365 |
string |
The code of the vat in 365 |
| line_total_vat |
decimal |
The total vat amount of this line of the invoice. line_total_vat = round(line_total_grand - (line_total_sub - line_total_discount),2) |
| line_total_vat_percentage |
decimal |
The total vat percentage of this line of the invoice. eg. If the vat is 19%, pass 19.00 |
| line_total_grand |
decimal |
The total amount for this line of the invoice. line_total_grand = round((line_price_incl_vat * line_quantity)*(1 - line_total_discount_percentage / 100),2) |
| line_notes |
string |
Notes per line |
| is_modifier |
boolean |
Indicates that charged item in the invoice is linked to a modifier |
| is_subitem |
boolean |
Indicates if in the line is a subitem |
| exclude_print |
boolean |
Indicates if the subitem is excluded from the invoice printing. The value is taken from the subitems information |
| root_line_number |
string |
Indicates the parent line id to which the chargeable modifier is linked |
| list_modifiers
|
| modifier_prefix |
string |
Prefix of the modifier(e.g. EXTRA, NO, WITHOUT, PLUS) |
| modifier_code_365 |
string |
The 365 modifier code (e.g. AVOCADO,TOMATO and so on) |
| modifier_name |
string |
The modifier name |
Returns
Returns the standard api_response object. The Powersoft365 batch invoice code is returned in the response_id field.