Create order B2C
POST
/api/v1/public/orders/create
It supports conditional logic such as using customer_id to auto-fill receiver info, or manual input if customer_id is not provided.
Sample Use Case
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST '/api/v1/public/orders/create' \
--header 'Authorization;' \
--header 'Content-Type: application/json' \
--data-raw '{
"store_id": 336,
"pickup_id": 167,
"receiver": {
"customer_id": null,
"country": "VN",
"fullname": "{% faker name.fullName %}",
"phone": "+84961557476",
"address": "Số 9 Trà Khúc",
"zipcode": "77000",
"province_name": "TP. Hồ Chí Minh",
"district_name": "Tân Bình",
"ward_name": "Phường 2"
},
"payments": [
{
"status": 100,
"method": 1,
"amount": 100000
}
],
"fees": [
{
"code": "buyer_shipping_fee",
"amount": 31000
}
],
"items": [
{
"sku": "BANHTRANGXIKI",
"sale_price": 25000,
"discounted_price": 30000,
"quantity": 2
},
{
"sku": "MUOIXATAC",
"sale_price": 15000,
"discounted_price": 20000,
"quantity": 2
}
],
"config": {
"order_type": "b2c",
"approve": 1,
"preview": 1,
"use_insurance": 0,
"fulfill_now": 0,
"delivery_service": "SOF_STD",
"box_dimension": 120,
"courier_integration_id": 212,
"courier_id": 16
},
"extra_info": {
"note": "Giao trong ngày",
"packaging_note": "Giao trong ngày",
"order_number": "{% faker datatype.number %}"
}
}'
Response Response Example
{
"status_code": 200,
"data": {
"order_id": 11733,
"tracking_code": "NHOV851691511"
},
"error": false,
"error_code": null,
"log_id": null,
"messages": "",
"total": 1
}
Request
Header Params
Authorization
string
required
Default:
{{your_api_key_here}}
Body Params application/json