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

GET_V2_SETTLEMENT_REPORT_DATA_FLAT_FILE_V2 403, but everything else works. #2370

Closed bjpierre closed 2 years ago

bjpierre commented 2 years ago

Hey, I'm attempting to use the Selling Partner Reports API to obtain the GET_V2_SETTLEMENT_REPORT_DATA_FLAT_FILE_V2 or GET_V2_SETTLEMENT_REPORT_DATA_XML reports. I get a '403 Unauthorized' when reaching out to the reports api.

I'm able to get 'GET_V2_SETTLEMENT_REPORT_DATA_FLAT_FILE' and many other reports with the same code simply by changing the name of the parameter. I'm also able to make calls to the FBA API, and the Fulfillment Inbound API with the SDK I've written.

I notice on the documentation that GET_V2_SETTLEMENT_REPORT_DATA_XML and GET_V2_SETTLEMENT_REPORT_DATA_FLAT_FILE_V2 are for Seller Central Sellers only. I believe the account I am using and have used to generate the LWA token etc is a SellerCentral account, we do buisness activities through sellercentral.

The developer account in charge of the application is also the SellerCentral account, and has been granted the 'Finance and Accounting' role. We gave that to the application as well, and regenerated a refresh token.

Like I said, this setup is able to make calls all over SP without issue, including endpoints on this API, and even get reports in the same role. I don't do an RDT token for this request as I can't find anywhere that states I need to. Is that my issue?

We're in the NA region.

steven-so commented 2 years ago

Is the account you are using able to download the flat file v2 or xml from amazon seller central manually?

I saw this article which indicates some accounts could not have access to V2 reports: https://support.a2xaccounting.com/en/articles/1828440-amazon-settlement-formats-v1-and-v2-flat-file

Since you were able to get the regular flat file, that seems like a potential explanation.

("GET_V2_SETTLEMENT_REPORT_DATA_FLAT_FILE_V2" is working for me.)

bjpierre commented 2 years ago

Yeah, I'm able to download them and run them through my parser just fine. Oddly enough I re ran my test cases and I can no longer access an reports. I swear I've changed nothing (not likely I know, but.. I promise).

bjpierre commented 2 years ago

Sitting here, repeatedly clicking the run test in sure defeat, a state of pure exasperation, and suddenly it just works. It just works. I haven't had this level of weirdness with any of the other endpoints or APIs and every single call gets routed through a single CallEndPointAsync method that hasn't been touched since January. Here's to hoping it continues to just work.