Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Value null at 'marketplaceId' failed to satisfy constraint: Member must not be null) #148

Closed
egimenos opened this issue Jun 4, 2020 · 2 comments

Comments

@egimenos
Copy link

egimenos commented Jun 4, 2020

Hello,

peddler 2.4.1
Rails: 6.0.3.1
Ruby: 2.7.1

I'm just trying to replicate in irb a test that is working in Amazon Scratchpad:

I define my client (the error remains the same either using the marketplace shortcut or not)

client = MWS.orders(marketplace: "ES", merchant_id: ENV["MERCHANT_ID"])

Inspecting the client object, everything looks as expected:

#<MWS::Orders::Client:0x00007f061c893e78 @marketplace=#<Peddler::Marketplace:0x000055eae794ec60 @id="A1RKKUPIHCS9HS", @country_code="ES", @host="mws-eu.amazonservices.com">, @merchant_id="...">

Then if I try to retrieve the orders: client.list_orders(created_after: 1.month.ago)

I got this error:

Traceback (most recent call last):
        1: from (irb):10
Peddler::Errors::InvalidParameterValue (1 validation error detected: Value null at 'marketplaceId' failed to satisfy constraint: Member must not be null)

I'm sorry if I missing something obvious, thanks in advance.

@hakanensari
Copy link
Owner

It's somewhat counterintuitive, but this operation does not default to your primary marketplace (because the Amazon API doesn't), so you need to specify which marketplace you're querying. See this example.

hakanensari added a commit to hakanensari/mws-orders that referenced this issue Jun 4, 2020
@egimenos
Copy link
Author

egimenos commented Jun 4, 2020

It's somewhat counterintuitive, but this operation does not default to your primary marketplace (because the Amazon API doesn't), so you need to specify which marketplace you're querying. See this example.

You are totally right, that solved my problem.

Thanks a lot!!

@egimenos egimenos closed this as completed Jun 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants