Create order B2B
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.
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": "{{store_id_b2b}}",
"pickup_id": "{{pickup_id}}",
"receiver": {
"customer_id": null,
"country": "VN",
"fullname": "{{$person.fullName(locale='\''vi'\'')}}",
"phone": "{{$phone.number(locale='\''vi'\'')}}",
"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": 0
}
],
"discounts": [],
"fees": [
{
"code": "buyer_shipping_fee",
"amount": 31000
}
],
"items": [
{
"sku": "250204067",
"sale_price": 30700000,
"discounted_price": 30700000,
"quantity": 10
}
],
"config": {
"order_type": "b2b",
"approve": 1,
"preview": 1,
"use_insurance": 0,
"fulfill_now": 0,
"delivery_service": "SOF_STD",
"additional_services": "CIG,OWH",
"tax_paid_by": "sender",
"fee_paid_by": "sender",
"courier_integration_id": 172,
"courier_id": 16
},
"extra_info": {
"note": "Giao tới nhà có cổng màu tím trước sân cây hoa mai",
"packaging_note": "Kiểm tra hàng trong sản phẩm còn nguyên vẹn trước khi đóng gói",
"order_number": "{{$string.numeric(length=10,locale='\''vi'\'')}}",
"estimated_departure_time": {{$date.timestamp|addDays(3)}}
},
"documents": [
{
"name": "{{$food.dish}}",
"quantity": 2,
"doc_type": "3",
"url": "google.com"
}
]
}'
Response Response Example
{
"status_code": 0,
"data": {
"order_id": 0,
"tracking_code": "string"
},
"error": true,
"error_code": null,
"log_id": null,
"messages": "string",
"total": 0
}
Request
Header Params
Authorization
string
required
Default:
{{your_api_key_here}}
Body Params application/json