Skip to main content

15. Đăng đơn

Create Order

The order registration API is similar to the regular account order registration API, but in the request, you need to include the B2C account token information in the header X-Refer-Token.

For example, the shop HappyShop sells products on the e-commerce platform SmileB2C.

HappyShop has the token APITokenSample-ca441e70288cB0515F310742.

SmileB2C has the token B2CToken-hlsheiwquhrksadlfkjahsdfjaaljh.

In the order registration request for the HappyShop account sent from the SmileB2C server, you need to set an additional header X-Refer-Token with the value being the token of the SmileB2C account

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]
}
}