各位大佬,我在创建货件的时候,需要传递运输方式给亚马逊,SHIPPING_MODE也已经传过去了,前后端交互也没问题,但是现在亚马逊的后台看货件的时候,运输方式是空的,各位大佬是怎么解决的,可以教一下吗
具体请求信息给一下看看。
在 Fulfillment Inbound API v2024-03-20 里,shippingMode 只出现在两个 schema 里,全都是响应:
整个 API 里没有任何一个请求体接受 shippingMode / SHIPPING_MODE。所以你前后端传得再顺畅,这个值也只是在你自己系统里打转,亚马逊那边压根没收到 → 后台运输方式当然是空的。
正确的写入方式:选 ID,不是传 mode
运输方式是通过选中一个 transportationOptionId 隐式确定的,三步:
generateTransportationOptions (POST, 异步)
↓
listTransportationOptions (GET) → 拿到一堆 option,每个带 shippingMode + shippingSolution
↓ 在这里用你前端传来的 SHIPPING_MODE 做【筛选】
confirmTransportationOptions (POST, 异步) → 只提交 shipmentId + transportationOptionId
confirmTransportationOptions 的请求体只有这几个字段,没别的:
{
"transportationSelections": [
{
"shipmentId": "sh1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"transportationOptionId": "to1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"contactInformation": { "name": "xxx", "phoneNumber": "1234567890" }
}]
}
所以代码改法是:前端传的 SHIPPING_MODE 拿去 filter 列表,而不是塞进请求体。