Đơ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.
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
| Method | Endpoint | Mô tả |
|---|---|---|
POST | /api/v1/orders/from-conversation | Tạo đơn từ hội thoại |
Tham số
| Tham số | Vị trí | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
conversation_id | body | string | Có | Hội thoại nguồn |
items | body | array | Có | Dòng hàng chốt từ chat |
Kiểm thử tại chỗ
POST
https://sale-ai.hitechcloud.vn/api/v1/orders/from-conversationKiểm thử tại chỗ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"
}
}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
| Method | Endpoint | Mô tả |
|---|---|---|
POST | /api/v1/orders/from-conversation | Tạo đơn từ hội thoại |
Tham số
| Tham số | Vị trí | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|---|
conversation_id | body | string | Có | Hội thoại nguồn |
items | body | array | Có | Dòng hàng chốt từ chat |
Kiểm thử tại chỗ
POST
https://sale-ai.hitechcloud.vn/api/v1/orders/from-conversationKiểm thử tại chỗ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"
}
}