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

Endpoint 'productPricing', operation 'getCompetitivePricing' does not work correctly with Asins #143

Closed
altruer-old opened this issue Jul 5, 2022 · 4 comments

Comments

@altruer-old
Copy link
Contributor

When you add query parameters

ItemType: 'Asin',
Asins: ['B00WII52ZU', 'B08T68JQNP'],

You get

[
{
"ASIN": "B00WII52ZU, B08T68JQNP",
"status": "ClientError"
}
]

Problem is that lib does twice encoding (what is got from /amazon-sp-api/lib/resources/versions/product_pricing/productPricing_v0.js)

Single encoding is enough here
So I propose to remove encode_twice:true for this endpoint

Please check how it will behave with SKU array

Thanks!

@colin-brown
Copy link
Contributor

We get the same problem when submitting an array of Asins. Setting encode_twice:false fixes for us. As per OP unsure whether special characters in SKU might cause a problem with encode_twice:false?

@amz-tools
Copy link
Owner

Hi @altruer, @colin-brown,

we fixed the issue. The reason was actually that because of the necessary double encoding for skus with special chars for the two operations getPricing and getCompetitivePricing, the array delimiter , was also encoded twice, resulting in Amazon not being able to split up the array. Thats why the two ASINs were not received as two separate array values but as one: "ASIN": "B00WII52ZU, B08T68JQNP".

What still persists now is the issue of Amazon splitting up an array value containing a , into two values when part of the query. There's no real fix for it yet, but the issue is already communicated to Amazon.

@altruer-old
Copy link
Contributor Author

Thank you very much, works as expected now!

@wangjue666
Copy link
Contributor

Thanks a million!

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

4 participants