amzn / selling-partner-api-models

This repository contains OpenAPI models for developers to use when developing software to call Selling Partner APIs.
Apache License 2.0
580 stars 730 forks source link

How set metric system in getCatalogItem? (GET /catalog/2020-12-01/items/{asin}) #198

Closed NeftaliAcosta closed 2 years ago

NeftaliAcosta commented 2 years ago

I am migrating the Amazon API to its new version (SP-API), the problem is when you query the information of a specific ASIN the measurement units are different by default on "item_package_dimensions". Is there a way to set it?

image

However, the same does not happen with the "item_dimensions" of the ASIN.

image

chapmanjw commented 2 years ago

The attributes of the the v2020-12-01 version are the "raw" reconciled attributes of an ASIN. Item dimensions get normalized for each marketplace (i.e., inches in the US, centimeters in the UK, etc.). The v0 (and MWS APIs) are returning only the normalized dimensions.

In the v2020-12-01 version (and subsequent versions), the attributes section will always be the raw attributes as those are the values provided by selling partners and that can be affected by listings submissions. However, we are considering expanding which properties are included in the item summary section. Item dimensions has been a common request for the summary data. However, we haven't gotten much feedback on whether those should be the "raw" dimensions or the marketplace-normalized dimensions. Sounds like you would prefer the latter?

chapmanjw commented 2 years ago

Also, to clarify, the data accessible to us for these APIs is the "raw" data and the marketplace-specific normalized data. We don't have anything doing per-request calculations on that. I would suggest handling that on the client side if you are wanting to normalize to a specific unit type, regardless of what the API returns. Java and other languages have some built-in utilities for doing such conversions. There are also some open-source utilities for this, like: https://github.com/digidemic/UnitOf.

NeftaliAcosta commented 2 years ago

@chapmanjw thanks for your answer.

The attributes of the the v2020-12-01 version are the "raw" reconciled attributes of an ASIN. Item dimensions get normalized for each marketplace (i.e., inches in the US, centimeters in the UK, etc.). The v0 (and MWS APIs) are returning only the normalized dimensions.

I understand this, but, this ASIN is in US. The strange thing is that "item_dimensions" if it is correctly in inches and "item_package_dimensions" appears in centimetres. I insist, the ASIN is in the US marketplace. Even adding the parameter "locale=en_US" still appears the same way.

chapmanjw commented 2 years ago

In this particular instance, the raw values were likely provided in inches for item_dimensions and provided in centimeters for item_package_dimensions (i.e., different selling partners providing the data, etc.). As you can see in the v0 operation, they are being normalized to inches for both. If we added normalized item/package dimensions to the summary view, they would both be in inches for the US marketplace, but likely be in centimeters for most other marketplaces.

NeftaliAcosta commented 2 years ago

@chapmanjw Thanks for your kind help. We will work on a measurement converter to be able to standardize the answer.