lineofflight / peddler

Amazon Selling Partner API (SP-API) in Ruby
https://lineofflight.github.io/peddler/
MIT License
307 stars 130 forks source link

Expected(200) <=> Actual(400 Bad Request) (Excon::Errors::BadRequest) on list_inventory_supply() #29

Closed mushfick closed 9 years ago

mushfick commented 9 years ago

Hi, I'm not sure if I'm doing something incorrectly but I keep on getting the 400 bad request error when using fulfillment.list_inventory_supply() I'm trying to use the :seller_sku_list argument to get a list of inventory for that SKU but I keep on getting the 400 error I've tried using a time range and that works fine. I've tried using an array and just a string value both, the same error still.

I've used this:

fulfillment_inventory.list_inventory_supply({ :seller_sku_list =>  %w(AB-BC-CD-33) })

and this:

fulfillment_inventory.list_inventory_supply({ :seller_sku_list => "AB-BC-CD-33 })

Using the code below works just fine.

fulfillment_inventory.list_inventory_supply({:query_start_date_time => (some_time).iso8601})

The exact error that I get is:

/home/.rvm/gems/ruby-2.2.0/gems/excon-0.44.1/lib/excon/middlewares/expects.rb:6:in `response_call': Expected(200) <=> Actual(400 Bad Request) (Excon::Errors::BadRequest)
    from /home/.rvm/gems/ruby-2.2.0/gems/excon-0.44.1/lib/excon/middlewares/response_parser.rb:8:in `response_call'
    from /home/.rvm/gems/ruby-2.2.0/gems/excon-0.44.1/lib/excon/connection.rb:372:in `response'
    from /home/.rvm/gems/ruby-2.2.0/gems/excon-0.44.1/lib/excon/connection.rb:236:in `request'
    from (eval):3:in `post'
    from /home/.rvm/gems/ruby-2.2.0/gems/peddler-0.12.1/lib/peddler/client.rb:91:in `run'
    from /home/.rvm/gems/ruby-2.2.0/gems/peddler-0.12.1/lib/mws/fulfillment_inventory/client.rb:27:in `list_inventory_supply'
    from get_fullfilment_inventory.rb:58:in `<main>'

Any help is appreciated. Thanks.

hakanensari commented 9 years ago

I had a bad keyword. seller_skus should work fine.

mushfick commented 9 years ago

Sweet, thanks! It's working fine now.