Add New
Add a new sales order
HTTP Request
POST /api/v3/orders
Parameter | Default | Description |
---|---|---|
order_info | object | Order information, described in detail below |
products | array | Array containing product information |
terms | array | Order conditions |
Order information (order_info). An order can have multiple products. The information for each product includes:
Parameter | Default | Description |
---|---|---|
account_code | Customer code, if not provided, a new one will be added | |
account_name | Customer name | |
account_address | Address | |
account_email | Customer email | |
account_phone | Phone number | |
order_date | Order date (d/m/Y format) | |
discount | Discount percentage on the order | |
discount_amount | Discount amount on the order | |
vat | VAT | |
vat_amount | VAT amount in currency | |
transport | Shipping fee percentage | |
transport_amount | Shipping fee in currency | |
installation | Installation fee percentage | |
installation_amount | Installation fee in currency | |
amount | Order value | |
source_name | Order source (text input) |
Product information (products)
Parameter | Default | Description |
---|---|---|
product_code | Product code | |
product_name | Product name | |
quantity | Quantity | |
price | Price | |
product_sale_off | Product discount percentage, if none, leave as 0 | |
cash_discount | Discount amount (calculated from the discount percentage or entered manually) |
Body
{
"order_info": {
"account_code": "KH0001",
"account_name": "Anh Quyet",
"account_address": "Linh Dam - Hoang Mai - Hanoi",
"account_email": "[email protected]",
"account_phone": "0988686868",
"order_date": "12/12/2016",
"discount": 5,
"discount_amount": 3200,
"vat": 10,
"vat_amount": 6080,
"transport": 0,
"transport_amount": 0,
"installation": 0,
"installation_amount": 0,
"amount": 66880,
"source_name": "FB Source"
},
"products": [
{ "product_code": "ABCXYZ123", "product_name": "iPhone 7 Plus", "quantity": 1, "price": 10000, "product_sale_off": 10, "cash_discount": "1000" },
{ "product_code": "ABCXYZ456", "product_name": "iMac X20", "quantity": 2, "price": 30000, "product_sale_off": 0, "cash_discount": "5000" }
],
"terms": [ "Delivery time: ", "Delivery location: ", "Other terms"
]
}