Đơn hàng — Tạo từ hội thoại

Chốt đơn trực tiếp từ một hội thoại live chat.

Xem Markdown

Tạo đơn hàng ngay từ một hội thoại: hệ thống tự lấy người mua và thông tin giao hàng đã thu thập trong chat.

Endpoint

MethodEndpointMô tả
POST/api/v1/orders/from-conversationTạo đơn từ hội thoại

Tham số

Tham sốVị tríKiểuBắt buộcMô tả
conversation_idbodystringCóHội thoại nguồn
itemsbodyarrayCóDòng hàng chốt từ chat

Kiểm thử tại chỗ

POSThttps://sale-ai.hitechcloud.vn/api/v1/orders/from-conversation

Gửi thử sẽ ghi dữ liệu thật trên môi trường được chọn. Nên thử trên Sandbox trước. Token không được lưu lại.

Body
Ví dụ cURL
curl -X POST "https://sale-ai.hitechcloud.vn/api/v1/orders/from-conversation" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "conversation_id": "conv_9900aabb",
    "items": [
      {
        "product_id": "prod_a1f2e3d4",
        "quantity": 1
      }
    ]
  }'
Phản hồi mẫu
{
  "status": "success",
  "data": {
    "id": "order_55667788",
    "bot_id": "bot_7c1a9f2e",
    "subscriber_id": "sub_2a9b8c7d",
    "items": [
      {
        "product_id": "prod_a1f2e3d4",
        "name": "Ao thun basic",
        "quantity": 2,
        "unit_price": 199000
      }
    ],
    "subtotal": 398000,
    "shipping_fee": 30000,
    "total": 428000,
    "currency": "VND",
    "status": "pending",
    "customer": {
      "name": "Nguyen Van A",
      "phone": "0901234567",
      "address": "12 Nguyen Hue, Q1, HCM"
    },
    "created_at": "2026-10-31T10:30:00+07:00"
  }
}