Order Preview API

POST /v1/orders/preview - Positionen, Preise und inländische Fracht vor Create validieren.

Verwandt: Bestellung erstellen · Antwortmodell

Request-Body

FeldErforderlichBeschreibung
channelJa1688 | taobao
receiverJaInländische Inbound-Adresse: name, mobile, province, city, address; 1688 ohne address_id benötigt zusätzlich district
lines[]Jaid + spec_id + quantity (offer_id / mi_id still work) pro Position
response_formatNeinstandard (Standard) oder upstream

Taobao: Gateway führt automatisch Batch-Checks für mi_id + Traffic-sku_id aus und ruft anschließend Upstream Render auf. Nutzen Sie eine aktuelle id / mi_id als lines[].id — sie ändert sich regelmäßig und darf nicht langfristig gecacht werden.

Line mapping

Prefer lines[].id = search/detail id. offer_id and mi_id remain compatible.

lines[]1688Taobao
id (preferred)search/detail id (offerId)search/detail id (mi_id)
offer_idCompatible alias of idCompatible alias of id
mi_id—Compatible Taobao alias of id
spec_idvariants[].sku_idvariants[].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.

Beispiel

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
    }
  ]
}

Antwort

StandardOrderPreviewResult - siehe Bestell-Antwortmodelle. JSON-Beispiel: Antwortformat.

Beträge werden in CNY-Fen angegeben. total enthält immer merchandise, shipping und payment. Eine bekannte Null wird als Money-Objekt mit amount:0 dargestellt; null wird nur verwendet, wenn der Betrag tatsächlich unbekannt ist.

Vor dem Erstellen der Bestellung muss success === true gelten. Gateway prüft einen positiven Zahlbetrag, Verkäufergruppen, alle angeforderten Positionen, nicht verfügbare Positionen und bei 1688 einen Handelsmodus mit op_support:true. Ein interpretierbares, aber unvollständiges Ergebnis liefert HTTP 200 mit success:false und einem code wie LINE_UNAVAILABLE, UNSUPPORTED_TRADE_MODE oder PREVIEW_INCOMPLETE.

Aus Kompatibilitätsgründen behalten ausdrückliche 1688-Fehler zu SKU, Bestand, MOQ oder Marktplatzbeschränkungen den HTTP-502-Fehlerumschlag bei. response_format:"upstream" behält die Rohsemantik bei und kann HTTP 200 mit einem upstream Geschäftsfehler liefern; prüfen Sie den upstream payload.

Die Bestellvorschau ist schreibgeschützt. Sowohl im Self- als auch im Warehouse-Beschaffungsmodus verwendet Gateway das passende Channel-Token der App und ruft die Marketplace-preview/render-API direkt auf. Im Warehouse-Modus stammt das Token aus warehouse_channel_tokens; preview wird nicht an /procurement/preview weitergeleitet. Create, detail, pay, cancel und logistics bleiben über das Warehouse geroutet.

Get Support

Need integration help? Contact Developer Support at support@hiobuy.com · Response within 1–2 business days

Email support