Skip to main content

15. Order Creation

Order Creation

The order creation API works the same as for regular accounts, but must include the B2C account's token in the header X-Refer-Token when sending a request

Example: Shop HappyShop sells products on the e-commerce platform SmileB2C

HappyShop's token: APITokenSample-ca441e70288cB0515F310742

SmileB2C’s token (B2C platform): B2CToken-hlsheiwquhrksadlfkjahsdfjaaljh

In the order creation request sent from the SmileB2C server for the HappyShop account, the header X-Refer-Token must be included with the value set to the SmileB2C account’s token

POST /services/shipment/order HTTP/1.1
Token: APITokenSample-ca441e70288cB0515F310742
X-Refer-Token: B2CToken-hlsheiwquhrksadlfkjahsdfjaaljh
Content-Type: application/json

{
"products": [{
"name": "bút",
"weight": 0.1
}, {
"name": "tẩy",
"weight": 0.2
}],
"order": {
"id": "123123a",
"pick_name": "HCM-nội thành",
"pick_address": "590 CMT8 P.11",
"pick_province": "TP. Hồ Chí Minh",
"pick_district": "Quận 3",
"pick_tel": "0911222333",
"tel": "0911222333",
"name": "GHTK - HCM - Noi Thanh",
"address": "123 nguyễn chí thanh",
"province": "TP. Hồ Chí Minh",
"district": "Quận 1",
"is_freeship": "1",
"pick_date": "2016-09-30",
"pick_money": 47000,
"note": "Khối lượng tính cước tối đa: 1.00 kg",
"value": 3000000
"tags": [1,7]
}
}