Create dealer order

Add MCP server to your AI tool

Allow AI tools and LLMs to interact with the API documentation portal through MCP.

MCP server URL

https://tailieu-api.dilisupplement.com/mcp

Standard setup for AI tools providing an mcp.json file

mcp.json
{
  "API Đại Lý MCP server": {
    "url": "https://tailieu-api.dilisupplement.com/mcp"
  }
}

Close
POST /orders

Single entry point for dealer-app order creation (VTP, GHTK, J&T, Grab). Gọi bằng API key bị giới hạn 1 đơn / 2 phút mỗi đại lý (429 kèm Retry-After); phiên đăng nhập trên app không bị siết.

application/json

Body Required

  • sender_id string

    Dealer sender profile UUID. Optional for PICKUP_AT_COMPANY (sender may be empty); required for other carriers.

  • customer_name string

    Customer full name. Skipped for PICKUP_AT_COMPANY (backend fills from dealer).

    Maximum length is 255.

  • customer_phone string

    Customer phone. Skipped for PICKUP_AT_COMPANY.

    Maximum length is 20.

  • customer_address string

    Customer street address. Skipped for PICKUP_AT_COMPANY.

    Maximum length is 500.

  • receiver_province_id number

    VTP receiver province id

  • receiver_district_id number

    VTP receiver district id

  • receiver_ward_id number

    VTP receiver ward id

  • receiver_province string

    Receiver province name

    Maximum length is 100.

  • receiver_district string

    Receiver district name

    Maximum length is 100.

  • receiver_ward string

    Receiver ward name

    Maximum length is 100.

  • items array[object] Required

    Order line items (≥1)

    Hide items attributes Show items attributes object
    • kind string Required

      Line kind

      Values are product or combo.

    • ref_id string Required

      Reference id of product or combo

    • quantity number Required

      Quantity (1..9999)

      Minimum value is 1, maximum value is 9999.

  • carrier number

    Shipping carrier. Defaults to VTP for backward compatibility.

    Values are 0, 1, 2, 3, 4, or 99.

  • order_service string Required

    Carrier service code (e.g., VTP service)

  • order_payment number Required

    Who pays ship fee

    Values are 1, 2, 3, or 4.

  • product_weight number Required

    Product weight in grams

    Minimum value is 1.

  • money_collection number Required

    COD money to collect on delivery

    Minimum value is 0.

  • prepaid_amount string

    Prepaid amount (decimal string)

  • notes string

    Internal note

    Maximum length is 500.

  • order_service_add string

    Extra carrier service options

  • is_draft boolean

    Save as draft (skip carrier API submit)

    Default value is false.

  • is_use_carton boolean

    Đơn có dùng thùng carton hay không. Bỏ trống → suy ra từ carrier (Grab / lấy tại công ty = không dùng).

Responses

  • 201

    Order created with tracking number

  • 429

    Vượt hạn mức tạo đơn qua API key — ORDER_CREATE_RATE_LIMIT_EXCEEDED

POST /orders
curl \
 --request POST 'https://api-dealer.dilisupplement.com/api/orders' \
 --header "Content-Type: application/json" \
 --data '{"sender_id":"string","customer_name":"string","customer_phone":"0912345678","customer_address":"string","receiver_province_id":42.0,"receiver_district_id":42.0,"receiver_ward_id":42.0,"receiver_province":"string","receiver_district":"string","receiver_ward":"string","items":[{"kind":"product","ref_id":"string","quantity":42.0}],"carrier":0,"order_service":"string","order_payment":1,"product_weight":42.0,"money_collection":42.0,"prepaid_amount":"0.00","notes":"string","order_service_add":"string","is_draft":false,"is_use_carton":true}'
Request examples
{
  "sender_id": "string",
  "customer_name": "string",
  "customer_phone": "0912345678",
  "customer_address": "string",
  "receiver_province_id": 42.0,
  "receiver_district_id": 42.0,
  "receiver_ward_id": 42.0,
  "receiver_province": "string",
  "receiver_district": "string",
  "receiver_ward": "string",
  "items": [
    {
      "kind": "product",
      "ref_id": "string",
      "quantity": 42.0
    }
  ],
  "carrier": 0,
  "order_service": "string",
  "order_payment": 1,
  "product_weight": 42.0,
  "money_collection": 42.0,
  "prepaid_amount": "0.00",
  "notes": "string",
  "order_service_add": "string",
  "is_draft": false,
  "is_use_carton": true
}