首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用peddler创建出站履行的错误请求

使用peddler创建出站履行的错误请求
EN

Stack Overflow用户
提问于 2016-08-01 15:41:31
回答 1查看 356关注 0票数 2

我正在尝试使用Peddler gem在MWS中创建出站实现。我得到的唯一反馈是Excon::Error::BadRequest (Expected(200) <=> Actual(400 Bad Request),因此很难找出哪里出了问题。下面是调用API的代码行(解析后的值):

代码语言:javascript
复制
@client.create_fulfillment_order("186", "186", 2016-08-01T07:35:48Z, "Test shipment number: 186", "Standard", {"Name"=>"Bert the Destroyer", "Line1"=>"Teststreet", "Line2"=>"123", "Line3"=>"", "DistrictOrCounty"=>"", "City"=>"Testcity", "StateOrProvinceCode"=>"CO", "CountryCode"=>"US", "PostalCode"=>"60401", "PhoneNumber"=>"12345678"}, [{"SellerSKU"=>"4785000045", "SellerFulfillmentOrderItemId"=>"4785000045", "Quantity"=>15}], {:fulfillment_policy=>"FillAll", :notification_email_list=>["bertthedestroyer@gmail.com"]})

我好像想不出怎么才能拿回200块钱。有人能帮上忙吗?

实际代码:

代码语言:javascript
复制
address = {
  "Name" => shipment.order.ship_to_name.to_s,
  "Line1" => shipment.order.ship_to_address_1.to_s,
  "Line2" => shipment.order.ship_to_address_2.to_s,
  "Line3" => "",
  "DistrictOrCounty" => "",
  "City" => shipment.order.ship_to_city.to_s,
  "StateOrProvinceCode" => shipment.order.ship_to_state_code.to_s,
  "CountryCode" => shipment.order.ship_to_country_code.to_s,
  "PostalCode" => shipment.order.ship_to_zipcode.to_s,
  "PhoneNumber" => shipment.order.ship_to_phonenumber.to_s
}

items = []
shipment.m2m_line_item_shipments.each do |m2m|
  items << {"SellerSKU" => m2m.vendor_sku.name.to_s, "SellerFulfillmentOrderItemId" => m2m.vendor_sku.name.to_s, "Quantity" => m2m.line_item.actual_quantity }
end

order_comment = "#{shipment.order.store.name} shipment number: " + shipment.id.to_s
opts = {:fulfillment_policy => "FillAll", :notification_email_list => [shipment.order.ship_to_email.to_s] }
created_at = shipment.order.created_at.iso8601

response = @client.create_fulfillment_order(shipment.id.to_s, shipment.id.to_s, created_at, order_comment.to_s, 'Standard', address, items, opts)
order = response.parse
logger.debug "order.inspect: #{order.inspect}"

编辑:经过进一步的挖掘,我发现了这个。我尝试以整数和字符串的形式发送项目数量,但仍然出现相同的错误:

代码语言:javascript
复制
  <Error>
    <Type>Sender</Type>
    <Code>InvalidRequestException</Code>
    <Message>Value AllQuantityZero for parameter  is invalid.</Message>
  </Error>
EN

回答 1

Stack Overflow用户

发布于 2016-08-01 17:06:12

经过进一步的搜索,我找到了答案。事实证明,此错误意味着SKU脱销。亚马逊的错误信息!来源:https://sellercentral.amazon.com/forums/message.jspa?messageID=2745103

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/38693380

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档