运输渠道 API

GET /v1/fulfillment/shipping/channels 返回当前应用所绑定仓库中已启用且拥有有效价格配置的国际运输渠道。

用此接口做渠道选择器或查看能力。地址级可用性与金额必须通过 运费试算 确认。这里的价卡只解释计价方式,不锁价

GEThttps://open.hiobuy.com/v1/fulfillment/shipping/channels

需要 仓库履约。沙箱 hio_test_* 密钥返回确定性 mock 数据。

运价是预算,不是锁价。仓库称重、体积测量、重新包装和服务审核都可能改变最终费用。

金额与单位 {#units}

  • 所有金额 amount 均为人民币整数1000 表示 ¥10.00。
  • 响应顶层 monetary_unit 固定为 CNY_minor
  • 金额对象格式:
{
  "amount": 1000,
  "currency": "CNY"
}
  • KG = 千克,CM = 厘米,M3 = 立方米,KG_PER_M3 = 千克/立方米。
  • 渠道、分区、服务请使用稳定 code,不要依赖 name
  • 不公开仓库数据库 ID、Developer Code、内部鉴权或供应商接口地址。

请求 {#request}

GET /v1/fulfillment/shipping/channels?country_code=US&include=regions,services,rate_cards&page=1&page_size=20
Authorization: Bearer hio_live_xxx
Language: zh-CN

展示语言只通过 Language Header 传递。支持:en(默认)、en-USzhzh-CNzh-TWcnhk不要language 写在 Query 或 JSON Body 里。

Query 参数

参数必填默认值说明
channel_code稳定渠道代码精确筛选(最长 64)
country_codeISO 3166-1 alpha-2 目的国家代码
include逗号分隔展开:regionsservicesrate_cards
page1页码,从 1 开始
page_size20每页条数,最大 50

include 展开

不传 include 时只返回轻量渠道摘要

include返回字段用途
regionsregions配送分区与参考时效
servicesvalue_added_services渠道增值服务,供 试算 使用
rate_cardsrate_cards参考价格表,只解释计价方式

可组合,例如 include=regions,services,rate_cards。未知值返回 400 VALIDATION_ERROR

rate_cardsreference_only,不能代替 POST /v1/fulfillment/shipping/quotes。只有 include=rate_cards 才会向仓库拉取价格表。

只有已启用并且拥有有效价格配置的渠道才会返回。items 为空表示当前筛选条件下没有匹配渠道。

响应 {#response}

响应示例与英文档同一结构。关键顶层字段:itemspaginationmonetary_unitCNY_minor)、generated_atrequest_id

{
  "items": [
    {
      "code": "US-SEA",
      "name": "美线海运",
      "description": "普货线路",
      "status": "ACTIVE",
      "tags": [
        "GREAT_VALUE"
      ],
      "warehouse": {
        "code": "SZ",
        "name": "深圳仓"
      },
      "capabilities": {
        "delivery_methods": [
          "DOOR_DELIVERY"
        ],
        "multi_package_supported": true,
        "tracking_supported": true,
        "shipping_label_supported": false
      },
      "requirements": {
        "weight": "REQUIRED",
        "dimensions": "CONDITIONAL",
        "postal_code": "OPTIONAL",
        "declared_value": "OPTIONAL",
        "customs_code": "OPTIONAL",
        "personal_customs_code": "OPTIONAL",
        "recipient_identity": "OPTIONAL"
      },
      "attribute_matching": {
        "mode": "ANY_OF",
        "accepted_attributes": [
          {
            "code": "GENERAL",
            "name": "普货"
          }
        ]
      },
      "billing": {
        "basis": "WEIGHT",
        "calculation_model": "FIRST_NEXT_WEIGHT",
        "quantity_unit": "KG",
        "supported_range": {
          "minimum": {
            "value": 0.5,
            "unit": "KG"
          },
          "maximum": {
            "value": 30,
            "unit": "KG"
          },
          "out_of_range_behavior": "UNAVAILABLE"
        },
        "minimum": {
          "value": 0.5,
          "unit": "KG",
          "ceil_to_minimum": true
        },
        "rounding": {
          "single_package_step": {
            "value": 0.5,
            "unit": "KG"
          },
          "multi_package_step": {
            "value": 0.5,
            "unit": "KG"
          },
          "ignore_below": {
            "value": 0.05,
            "unit": "KG"
          }
        },
        "volumetric_weight": {
          "enabled": true,
          "divisor": 6000,
          "average_with_actual": false,
          "exemption": null
        },
        "overweight_warning": {
          "enabled": false,
          "threshold": {
            "value": 0,
            "unit": "KG"
          },
          "notice": null
        }
      },
      "rule_summary": {
        "fee_aggregation": "SUM_ALL",
        "maximum_charge": {
          "amount": 0,
          "currency": "CNY"
        },
        "has_surcharges": true,
        "has_order_restrictions": false,
        "has_dispatch_restrictions": true,
        "evaluated_by_quote": true
      },
      "service_policy": {
        "warehouse_may_add_services": true,
        "warehouse_may_remove_services": true,
        "prices_may_change_after_inspection": true
      },
      "final_quote_required": true,
      "config_updated_at": "2026-09-07T08:00:00Z"
    }
  ],
  "pagination": {
    "page": 1,
    "page_size": 20,
    "total": 1,
    "has_more": false
  },
  "monetary_unit": "CNY_minor",
  "generated_at": "2026-09-07T09:00:00Z",
  "request_id": "req_xxx"
}

regionsvalue_added_servicesrate_cards 仅在对应 include 后出现。完整展开示例见英文文档或下方字段表。

响应字段 {#fields}

字段说明
items[]匹配渠道。无匹配时为空数组。
items[].code稳定渠道代码。试算 channel_codes 与创建发货单使用此值。
items[].name展示名称(Language Header)。
items[].description展示描述。
items[].status目录状态。返回的渠道为 ACTIVE
items[].tags稳定标签。
items[].warehouse绑定仓库 { code, name },不是数据库 ID。
items[].capabilities配送方式、多箱、轨迹、面单能力。
items[].requirements输入完整度:REQUIRED · OPTIONAL · CONDITIONAL · NOT_SUPPORTED
items[].attribute_matchingANY_OFALL_REQUIRED,以及 accepted_attributes[].code
items[].billing计价方式,见下表。
items[].rule_summary是否存在附加费或限制;规则由试算评估。
items[].regionsinclude=regions 时返回。
items[].value_added_servicesinclude=services 时返回。
items[].rate_cardsinclude=rate_cards 时返回,且 reference_only=true
items[].service_policy仓库处理后可能增删服务或改价。
items[].final_quote_requiredtrue 表示仍需票级试算。
items[].config_updated_at该渠道配置更新时间。
paginationpage / page_size / total / has_more
monetary_unit固定 CNY_minor
generated_at响应时间。
request_idx-request-id 对应。

billing {#billing}

字段含义
basisWEIGHTVOLUMEDENSITY
calculation_model渠道采用的计价模型
quantity_unitKGM3KG_PER_M3
supported_range支持的计价范围
out_of_range_behavior=UNAVAILABLE超出范围后渠道不可用,不能用最后一档外推
minimum最低计费量,以及是否向上取整
rounding单箱和多箱取整规则
volumetric_weight体积重规则与换算系数
multi_package多箱分别计费还是合并计费
overweight_warning超重提醒

regions {#regions}

字段含义
code / name稳定分区代码与名称
match_typeCOUNTRY_REGIONPOSTAL_CODE
countries覆盖的国家代码
postal_code_requiredtrue 时试算需传邮编
reference_transit_time参考时效
areas更细分区;目录不暴露完整邮编规则库

value_added_services {#value-added-services}

code 是调用 shipping/quotes 时使用的稳定服务代码。

  • request_modeMANDATORY 强制,OPTIONAL 可选(即是否 required)。
  • pricing_type:固定价格或动态计算。
  • pricing_scope:服务适用范围。
  • 仓库可能在实际处理时增加、删除或调整服务。

BASIS_POINT500 表示 5%。

rate_cards {#rate-cards}

包含 region_codebilling_basiscalculation_modelquantity_unitprice_rowsreference_only=true 表示仅供参考。

缓存 {#caching}

config_updated_at 变化时重新拉取展开数据。创建发货前始终调用 运费试算。当前没有锁价版本。

错误 {#errors}

某个筛选条件下没有渠道不是 HTTP 错误,而是 items: []

HTTPerror.code说明
400VALIDATION_ERROR分页、国家代码语法或 include 无效
401INVALID_API_KEY缺少或无效的 Bearer
403FULFILLMENT_MODE_NOT_SUPPORTED应用不是仓库履约模式
403WAREHOUSE_AUTH_INVALID仓库授权缺失、无效或过期
422INVALID_COUNTRY_CODE国家代码无效或不支持
502WAREHOUSE_UPSTREAM_ERROR仓库服务异常,请退避重试

公开接口没有单独的 AUTHENTICATION_ERRORWAREHOUSE_AUTH_REQUIREDWAREHOUSE_SERVICE_UNAVAILABLE。鉴权失败用 401 INVALID_API_KEY,未绑定仓库用 403 WAREHOUSE_AUTH_INVALID,仓库不可用用 502 WAREHOUSE_UPSTREAM_ERROR

下一步:按目的地做运费试算

获取支持

需要集成帮助?请联系开发者支持 support@hiobuy.com · 预计 1–2 个工作日内回复

发送邮件