타오바오 API는 유효한 유료 구독이 필요합니다. 7일 무료 체험에는 1688과 Weidian만 포함됩니다. 필요한 구독이 없으면 타오바오 호출은 HTTP 403과 PAID_SUBSCRIPTION_REQUIRED를 반환합니다. 개발자 센터에서 유료 플랜으로 업그레이드한 후 같은 API 키를 계속 사용하세요.

주문 Preview API

구매 주문 미리보기와 생성은 1688/Taobao 단축 경로를 포함하여 Self Fulfillment와 HIOBuy Fulfillment 모두 0 API Units입니다. 구독 할당량이나 추가 사용량 팩을 차감하지 않으며 API Units를 모두 사용한 뒤에도 호출할 수 있습니다. API 키, 권한, 구독/채널 접근, 구매 자격 및 호출 빈도 제한은 계속 적용됩니다. 주문 금액과 구매 서비스 수수료는 기존대로 부과됩니다.

POST /v1/orders/preview는 생성 전에 구매 가능 여부, 가격, 중국 내 배송비를 확인합니다. create 및 배송비 견적과 receiver + lines 구조를 공유하지만 Taobao create에는 preview가 반환한 ID 쌍을 사용합니다.

관련 문서: 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

Taobao: Gateway가 mi_id + traffic sku_id를 자동으로 배치 확인한 뒤 upstream render를 호출합니다. lines[].id에는 최신 id / mi_id를 쓰세요. 주기적으로 바뀌므로 장기 캐시하지 마세요.

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.

Taobao: 상세 SKU, preview, create

spec_id는 주문 요청 필드명입니다. preview에서는 product.id(mi_id)를 lines[].id에, 선택한 product.variants[].sku_id를 lines[].spec_id에 넣습니다. Taobao source_product_id(원래 item_id)는 사용하지 마세요. Gateway가 render 전에 batch-check로 변환하므로 클라이언트의 별도 batch-check 호출은 필요 없습니다.

standard preview 성공 후 각 sellers[].lines[].offer_id를 create lines[].id에, 같은 행의 spec_id를 lines[].spec_id에 복사합니다. Taobao에서는 변환된 mpId + mpSkuId입니다. ID 쌍, 수량, 수취인을 유지하세요. self 통합 생성은 원래 상세 ID 쌍도 변환하지만 HIOBuy Fulfillment(warehouse) create는 Gateway에서 batch-check를 다시 하지 않고 창고로 전달합니다. 이 흐름에는 변환된 preview 쌍을 사용하세요.

변환된 create 행을 구성할 때: 행마다 상품 ID 필드를 하나만 보내세요. id와 offer_id가 함께 있으면 offer_id가 우선합니다. 오래된 별칭을 남기거나 상세 상품 ID와 구매 SKU ID를 섞지 마세요. 숫자로만 된 상품 ID는 변환된 mpId로 취급하며 임의의 Taobao URL item_id로 대체할 수 없습니다.

const createLine = {
  id: previewLine.offer_id,
  spec_id: previewLine.spec_id,
  quantity: previewLine.quantity,
};

카탈로그와 견적, 모드, 위안/펀 변환은 Taobao SKU 가격을 참조하세요.

예시

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.

금액은 CNY fen 단위입니다. total에는 항상 merchandise, shipping, payment가 포함됩니다. 알려진 0은 amount:0인 Money 객체로 표시하며, null은 금액을 실제로 알 수 없을 때만 사용합니다.

주문 생성 전 success === true인지 확인하세요. Gateway는 양수 결제 총액, 판매자 그룹, 요청한 모든 라인, 구매 불가 라인, 그리고 1688의 경우 op_support:true인 거래 방식을 검증합니다. 해석 가능하지만 불완전한 결과는 HTTP 200, success:false와 LINE_UNAVAILABLE, UNSUPPORTED_TRADE_MODE, PREVIEW_INCOMPLETE 등의 code를 반환합니다.

호환성을 위해 1688이 명시적으로 반환하는 SKU, 재고, MOQ 및 마켓 제한 오류는 기존 HTTP 502 오류 envelope를 유지합니다. response_format:"upstream"은 원본 의미를 유지하므로 HTTP 200에도 upstream 비즈니스 실패가 포함될 수 있습니다. upstream payload를 확인하세요.

주문 preview는 읽기 전용 작업입니다. self 및 warehouse 구매 모드 모두에서 Gateway가 App에 해당하는 채널 토큰으로 marketplace preview/render API를 직접 호출합니다. warehouse 모드에서는 warehouse_channel_tokens를 사용하며 warehouse /procurement/preview로 전달하지 않습니다. create, detail, pay, cancel, logistics 작업은 계속 warehouse를 통해 처리됩니다.

Get Support

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

Email support