如何通过ShipStation API的Create/Update Order调用设置现有订单Customs Item的SKU
解决方案
要给现有订单的International Options下的Customs Item设置SKU值,你可以通过Create/Update Order API的PUT请求实现,具体步骤如下:
1. 确定请求方式与端点
使用PUT请求调用订单更新接口,通过已知的OrderKey定位目标订单(OrderKey可唯一识别订单,无需额外订单ID)。
2. 构造请求体
请求体需嵌套包含orderKey、internationalOptions以及customsItems字段,核心是在customsItems数组中为每个报关项指定sku值。
注意:由于你的账户设置为「从订单项生成报关单」,建议确保customsItems中的条目与订单原有orderItems一一对应,避免报关信息与订单商品不一致。
请求体示例
{ "orderKey": "你的订单唯一标识OrderKey", "internationalOptions": { "customsItems": [ { "sku": "PROD-001", "description": "商品描述", "quantity": 1, "value": 29.99, "weight": { "value": 0.5, "units": "pounds" }, "countryOfOrigin": "US" }, { "sku": "PROD-002", "description": "另一商品描述", "quantity": 2, "value": 19.99, "weight": { "value": 0.3, "units": "pounds" }, "countryOfOrigin": "CN" } ] } }
3. 关键注意事项
- 确保请求中
orderKey与目标订单的OrderKey完全匹配,否则会创建新订单而非更新现有订单。 customsItems中的每个字段需符合ShipStation API要求(如value为商品申报价值,countryOfOrigin为两位国家代码)。- 若订单已有报关项,此请求会覆盖原有
customsItems数据,建议先通过Get Order接口获取现有报关信息,再做增量修改。
内容的提问来源于stack exchange,提问作者ShamilS
相关产品推荐
相关产品推荐

