lineofflight / peddler

Amazon Selling Partner API (SP-API) in Ruby
MIT License
307 stars 130 forks source link

get_prep_instructions_for_asin throws Validation error #122

Closed yubrew closed 5 years ago

yubrew commented 5 years ago

I am getting a validation error when getting prep instructions using ASINList, but there are no problems using SKUList:

response = client.get_prep_instructions_for_asin('US', 'asinexample') Peddler::Errors::ValidationError: 1 validation error detected: Value null at 'asinList' failed to satisfy constraint: Member must not be null from /Users/ylee/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/peddler-2.0.4/lib/peddler/client.rb:152:inhandle_http_status_error'`

response = client.get_prep_instructions_for_sku('US', 'sku1example', 'sku2example') # works successfully

If I were to guess, it's coming from differences in Amazon naming convention vs Ruby naming convention of ASINList vs asinList.

Edit: Oddly other methods using ASINList seem to work fine: response = client.get_inbound_guidance_for_asin('marketplace_example', 'asinexample')

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

hakanensari commented 5 years ago

@yubrew, it seems Amazon has a bug upstream and is expecting AsinList instead of ASINList as a request parameter. I'll implement a workaround.

samror commented 4 years ago

@yubrew @hakanensari I was also working on a same problem i.e. same error while fetching FbaFee for a particular ASIN and even requesting on AMAZON ScratchPad was not working, I did some more research and found out that ASIN may lack some information, because of which AMAZON cannot identify your requested data. As for me, it was DIMENSIONS missing for that ASIN, so you won't know what the problem is.