注文プレビュー API
POST /v1/orders/preview — create の前に、明細、価格、国内送料を検証します。
関連: Create order · Response model
リクエスト本文
| フィールド | 必須 | 説明 |
|---|---|---|
channel | はい | 1688 | taobao |
receiver | はい | 国内入庫先住所: name, mobile, province, city, address。1688 で address_id がない場合は district も必要 |
lines[] | はい | 明細ごとの id + spec_id + quantity (offer_id / mi_id still work) |
response_format | いいえ | standard(デフォルト・推奨)または upstream — レスポンス形式 を参照 |
lines[].id の取り方 {#line-mapping}
POST /v1/products/detail(または search)を呼び出す- レスポンス
id→lines[].id(Taobao ではsource_product_id不可) - 選択 SKU の
variants[].sku_id→lines[].spec_id - preview 成功後、create で 同じ
lines[]を使う
Taobao: Gateway が mi_id + traffic sku_id を自動で一括チェックし、その後 upstream render を呼び出します。 lines[].id には新しい id / mi_id を使ってください。定期的に変わるため、長期キャッシュしないでください。
フィールド対応
Prefer lines[].id = search/detail id. offer_id and mi_id remain compatible.
lines[] | 1688 | Taobao |
|---|---|---|
id (preferred) | search/detail id (offerId) | search/detail id (mi_id) |
offer_id | Compatible alias of id | Compatible alias of id |
mi_id | — | Compatible Taobao alias of id |
spec_id | variants[].sku_id | variants[].sku_id (or mpSkuId) |
If both id and offer_id are sent, offer_id wins. Otherwise id (then mi_id) is copied to offer_id. Do not pass Taobao source_product_id. Taobao id / mi_id rotates periodically.
例
POST /v1/orders/preview
{
"channel": "1688",
"receiver": {
"name": "张三",
"mobile": "15251667788",
"province": "浙江省",
"city": "杭州市",
"district": "滨江区",
"address": "网商路699号"
},
"lines": [
{
"id": "554456348334",
"spec_id": "b266e0726506185beaf205cbae88530d",
"quantity": 5
}
]
}Taobao example
POST /v1/orders/preview
{
"channel": "taobao",
"receiver": {
"name": "张三",
"mobile": "15251667788",
"province": "浙江省",
"city": "杭州市",
"district": "滨江区",
"address": "网商路699号"
},
"lines": [
{
"id": "0000iIpSgysC-ca00kbG-Y-LXZu7WojtOJ5cnKTyzoID9UM",
"spec_id": "6079564221554",
"quantity": 5
}
]
}レスポンス
StandardOrderPreviewResult — order response models を参照してください。JSON 例: Response format。
Get Support
Need integration help? Contact Developer Support at support@hiobuy.com · Response within 1–2 business days