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 B2B

POST
/api/v1/public/orders/create
This API is used to create a new B2B order. The order includes details about the buyer, receiver, products, shipping method, pickup address, and optionally the vendor.
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

Body Params application/json

Examples

Responses

🟢200OK
application/json
Body

Previous
Create order B2C
Next
List order
Built with