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
585 stars 730 forks source link

[BUG] [SP-API] [Issue] Product category tree #502

Closed adamGitTest closed 3 months ago

adamGitTest commented 8 months ago

I'm having trouble downloading the Amazon category tree for Marketplace A1C3SOZRARQ6R3 I'm just testing SP-Api, so I send most of the requests to the sandbox environment (https://sandbox.sellingpartnerapi-eu.amazon.com). Unfortunately, many of the responses are: image

This message doesn't mean much considering that according to the documentation it should be fine. Example

  1. /catalog/v0/categories (https://developer-docs.amazon.com/sp-api/docs/catalog-items-api-v0-reference#listcatalogcategories) The documentation says that only MarketplaceId is the required parameter. So I was hoping to return all categories and thus get a full Amazon category tree. image 2) /reports/2021-06-30/reports (https://developer-docs.amazon.com/sp-api/docs/reports-api-v2021-06-30-tutorial-request-a-report). The documentation says reportType and marketplaceIds are required image

Interestingly, using https://sellingpartnerapi-eu.amazon.com, the message is different. 1) 400 "message": "Report type 316 does not support account ID of type class com.amazon.partner.account.id.VendorGroupId.", 2) 404 "message": "The requested resource doesn\u0027t exist." image

Now the questions

  1. Why is the same message returned in every case in a sandbox environment? "Could not match input arguments" and not in production.? I use a token generated on the vendor central account, not seller central. Could this actually be the reason for the messages?
  2. Is there any better way to get product category tree using API?. On seller central there is a Browse Tree Guide (BTG) is the only option to download the csv file with each branch and copy the categories manually?? image
rugved1991 commented 8 months ago

Hi @adamGitTest,

While using sandbox endpoints, you need to check the API model to understand the sandbox behavior for each API operation. You can search for "x-amzn-api-sandbox" in the API model to learn the sandbox behavior. Catalog V0 model Reports 2021-06-30 model

For XML Browse Tree, you can download the report through the reports API.

Please note that this report is only available through seller authorization and not vendor authorization.

Best, Rugved Solutions Architect, SP-API

adamGitTest commented 7 months ago

I managed to generate a report with an Amazon category tree. But I still don't understand why the report was able to be generated and downloaded in the production environment (https://sellingpartnerapi-eu.amazon.com/reports/2021-06-30/reports) But it failed in test environment (https://sandbox.sellingpartnerapi-eu.amazon.com/reports/2021-06-30/reports) image

I don't want to receive static data, so I fill in the appropriate parameters. Ultimately, I want to end the tests and run production with one change of the URL address, but in such a situation it is not possible. I'm also worried about what will happen when I start making offers. If the sandbox behaves the same when creating offers, how to test it? Sandbox will show me an error and as a test I will try it in production, it will give me an offer and I will have to quickly remove it from Amazon's website so that no one accidentally buys a fictitious product? Shouldn't sandbox work identically to prod?

shreeharsh-a commented 3 months ago

Thanks for your question @adamGitTest, the current behavior of sandbox APIs is to return static data. If you need to submit a feature request or need additional help, please reach out to developer support so that we can better help you with issues related to SP API.

Note: SP API or docs related issues / troubleshooting support is managed by a different team. We can help if the issue is related to the content published on this repo.