Model phản hồi Order API
Các kiểu trong packages/shared/src/ (order-preview-result.ts, order-create-result.ts, trade.ts, logistics-trace.ts). Tất cả số tiền: fen.
StandardOrderPreviewResult {#standard-order-preview-result}
Từ order preview.
| Field | Type | Description |
|---|---|---|
success | boolean | Chỉ true sau khi xác minh tổng thanh toán, nhóm người bán, các dòng yêu cầu, khả năng mua và phương thức giao dịch áp dụng |
total.merchandise | Money | null | Tạm tính hàng hóa; chỉ null khi thực sự không biết |
total.payment | Money | Tổng cần thanh toán |
total.shipping | Money | null | Vận chuyển nội địa; miễn phí đã biết là Money có amount: 0 |
sellers[] | array | Nhóm theo người bán với lines[], phí |
unavailable_lines[] | array | Validate hoặc tồn kho thất bại |
trade_types[] | array | Chỉ 1688 |
promotions | object | Khuyến mãi 1688 khi có |
code / message | string | Trạng thái nghiệp vụ tùy chọn, gồm LINE_UNAVAILABLE, UNSUPPORTED_TRADE_MODE, PREVIEW_INCOMPLETE |
monetary_unit | string | Luôn là CNY_minor trong standard preview |
request_id | string | ID liên kết yêu cầu |
Standard preview đọc được nhưng không đầy đủ trả HTTP 200 với success:false. Để tương thích, lỗi SKU, tồn kho, MOQ và hạn chế marketplace do 1688 trả rõ ràng vẫn giữ HTTP 502 CHANNEL_UPSTREAM_ERROR. Với response_format:"upstream", HTTP 200 có thể chứa lỗi nghiệp vụ upstream; hãy kiểm tra các trường gốc upstream.success, code, message và trường lồng tương ứng.
StandardOrderCreateResult {#standard-order-create-result}
| Field | Type | Description |
|---|---|---|
order_id | string | Dùng cho pay, detail, trace |
total.payment | Money | Số tiền cần thanh toán |
order_list[] | array | Sub-orders / tách theo người bán |
failed_offers[] | array | Có thể create một phần với success: true |
outer_purchase_id | string | Idempotency key Taobao |
payment_url | string | URL thanh toán Taobao tùy chọn |
StandardOrderPayResult {#standard-order-pay-result}
Taobao self chuẩn chỉ trả success: true khi truy vấn đơn xác nhận thanh toán. code: "0" hoặc kết quả thành công cũ không chứng minh đã trừ tiền. pending là kết quả Gateway chưa xác nhận, không phải hàng đợi chính thức.
| Field | Description |
|---|---|
success | Taobao self chuẩn: true chỉ sau khi truy vấn đơn xác nhận thanh toán |
pending / payment_status | success / pending / failed / unknown |
payment_submission_status | Các trường mới tùy chọn: submitted / rejected / unknown |
payment_recovery | Các trường mới tùy chọn: action, reason, elapsed_seconds. API |
order_status / order_status_raw | Taobao self |
upstream_request_id | Taobao self |
pay_channel | 1688 |
error_code / error_message | Lý do từ chối rõ ràng; có thể không có với pending/unknown |
StandardOrderDetail {#standard-order-detail}
| Field | Description |
|---|---|
status | ví dụ wait_payment, wait_shipment, shipped |
refund_status | Chỉ đọc; refund APIs không public |
amounts | total, product_total, shipping_fee, refund (fen) |
line_items[] | Dòng sản phẩm với sku_specs, status |
times | created_at, paid_at, shipped_at, … |
domestic_parcels[] | Chế độ kho → fulfillment |
UnifiedLogisticsTrace {#unified-logistics-trace}
Từ domestic trace.
| Field | Description |
|---|---|
packages[] | tracking_number, carrier, steps[] |
cross_border_packages[] | Node xuyên biên giới 1688 — không phải fulfillment quốc tế |
StandardOrderCancelResult {#standard-order-cancel-result}
| Field | Description |
|---|---|
success | Hủy được chấp nhận (có thể vẫn đang xử lý) |
pending | Hủy bất đồng bộ Taobao |
sub_order_ids | Id bị ảnh hưởng khi hủy một phần |
Get Support
Need integration help? Contact Developer Support at support@hiobuy.com · Response within 1–2 business days