API Docs
Home
Home
Developer GuideAPI
StatusWebhooks
Developer GuideAPI
StatusWebhooks
  1. Order
  • Config
    • List Pickup Address
      GET
    • List Box Dimension
      GET
    • List vendor
      GET
    • List store
      GET
  • Online Product
    • Options
      • List category
      • List brand
    • Create Single Product
      POST
    • Create Product From Product Inventory
      POST
    • List product
      GET
    • Product detail
      GET
  • Product Inventory
    • Options
      • List Outbound Strategy
      • List Product Type
      • List Material
      • List Storage Method
    • List product inventory
      GET
    • Product inventory detail
      GET
    • Create single inventory product
      POST
  • Order
    • Shipping Service
      • Preview shipping prices
        • List shipping service
        • List available courier
      • List available courier from order
      • List shipping service of courier
    • Create order B2C
      POST
    • Create order B2B
      POST
    • List order
      GET
    • Order detail
      GET
    • Cancel order
      PATCH
  • Shipment
    • Create shipment auto
      POST
    • [Retail][Ship by self] Create shipment with item
      POST
    • Cancel shipment
      PATCH
    • List shipment
      GET
    • Shipment detail
      GET
    • List shipment of order
      GET
  • Shipment Inbound
    • Create shipment inbound
    • Cancel shipment inbound
    • List shipment inbound
    • Shipment inbound detail
    • Shipment inbound items
  • Order Return
    • List return order
    • Return order detail
    • Create return order
    • Cancel Return Order
  • Courier
    • List courier service integrated
    • List courier operate
    • List courier integrated
  • Address Directory
    • Province
    • District
    • Ward
  1. Order

Create order B2C

POST
/api/v1/public/orders/create
This API is used to create a B2C (Business-to-Consumer) order on the N&H OMS system. It includes customer, payment, shipping, product, and courier details. The API supports options like insurance, fulfillment settings, and courier selection.
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#

Creating a B2C order where:
2 SKUs are being ordered
The payment is cash-on-delivery (COD)
A shipping fee is applied
The order is auto-approved and previewed
The seller chooses self-fulfillment using a defined courier
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

Body Params application/json

Examples

Responses

🟢200OK
application/json
Body

Previous
List shipping service of courier
Next
Create order B2B
Built with