- Overview
- Getting Started
- Common Errors
- API
- Config
- Product
- Product Inventory
- Order
- Shipment
- Shipment Inbound
- Courier
- Address Directory
- Status
- Webhooks
Create order B2C
Developing
POST
/api/v1/public/orders/create
Last modified:2025-01-17 09:08:25
Request
Header Params
Authorization
string
optional
Default:
6pGkII/faXeTxkNR1wOXRKZniSG25HgtPoDr3dLcuAcegBUKinCDkkdpxeSULdtPE0I7P8nM7dWTPRUyhzgtvQ==
Body Params application/json
store_id
integer
required
pickup_id
integer
required
receiver
object
required
country
string
required
fullname
string
required
phone
string
required
address
string
required
zipcode
string
optional
province_name
string
required
district_name
string
required
ward_name
string
required
payments
array [object {3}]
required
status
integer
optional
100: Chưa thanh toán
110: Thanh toán đang xử lý
120: Đang chờ thanh toán
200: Đã thanh toán
150: Thanh toán 1 phần
250: Đang chờ hoàn
300: Đã hoàn
310: Đã hoàn 1 phần
500: Hủy thanh toán
550: Hủy thu hộ
600: Quá hạn
method
integer
optional
2: Chuyển khoản ngân hàng
5: QR Code
6: Online Banking
3: Visa/Master/Amex
1: Thu hộ COD
4: Tiền mặt
7: Trả góp
amount
integer
optional
fees
array [object {2}]
optional
code
string
required
amount
integer
required
items
array [object {4}]
required
sku
string
required
sale_price
integer
required
discounted_price
integer
required
quantity
integer
required
config
object
required
order_type
string
required
b2c: Đơn bán lẻ
b2b: Đơn bán sỉ
approve
integer
required
1: True
0: False
preview
integer
required
use_insurance
integer
required
fulfill_now
integer
required
delivery_service
string
required
tax_paid_by
string
required
fee_paid_by
string
required
box_dimension
integer
required
courier_integration_id
integer
required
courier_id
integer
required
extra_info
object
required
note
string
optional
order_number
string
required
Example
{
"store_id": 336,
"pickup_id": 167,
"receiver": {
"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": 172,
"courier_id": 16
},
"extra_info": {
"note": "Giao trong ngày",
"packaging_note": "Giao trong ngày",
"order_number": "{% faker datatype.number %}"
}
}
Request samples
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://stg-oms.nandh.vn/api/v1/public/orders/create' \
--header 'Authorization: 6pGkII/faXeTxkNR1wOXRKZniSG25HgtPoDr3dLcuAcegBUKinCDkkdpxeSULdtPE0I7P8nM7dWTPRUyhzgtvQ==' \
--header 'Content-Type: application/json' \
--data-raw '{
"store_id": 336,
"pickup_id": 167,
"receiver": {
"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": 172,
"courier_id": 16
},
"extra_info": {
"note": "Giao trong ngày",
"packaging_note": "Giao trong ngày",
"order_number": "{% faker datatype.number %}"
}
}'
Responses
🟢200OK
application/json
Body
status_code
integer
required
data
object
required
order_id
integer
required
tracking_code
string
required
error
boolean
required
error_code
null
optional
log_id
null
optional
messages
string
required
total
integer
required
Example
{
"status_code": 200,
"data": {
"order_id": 11733,
"tracking_code": "NHOV851691511"
},
"error": false,
"error_code": null,
"log_id": null,
"messages": "",
"total": 1
}
Modified at 2025-01-17 09:08:25