Skip to main content

Add New

Add a new sales order

HTTP Request

POST /api/v3/orders

ParameterDefaultDescription
order_infoobjectOrder information, described in detail below
productsarrayArray containing product information
termsarrayOrder conditions

Order information (order_info). An order can have multiple products. The information for each product includes:

ParameterDefaultDescription
account_codeCustomer code, if not provided, a new one will be added
account_nameCustomer name
account_addressAddress
account_emailCustomer email
account_phonePhone number
order_dateOrder date (d/m/Y format)
discountDiscount percentage on the order
discount_amountDiscount amount on the order
vatVAT
vat_amountVAT amount in currency
transportShipping fee percentage
transport_amountShipping fee in currency
installationInstallation fee percentage
installation_amountInstallation fee in currency
amountOrder value
source_nameOrder source (text input)

Product information (products)

ParameterDefaultDescription
product_codeProduct code
product_nameProduct name
quantityQuantity
pricePrice
product_sale_offProduct discount percentage, if none, leave as 0
cash_discountDiscount 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"
]
}