lineofflight / peddler

Amazon Selling Partner API (SP-API) in Ruby
MIT License
307 stars 130 forks source link

Not Retrieving All Reports? #69

Closed systemnate closed 8 years ago

systemnate commented 8 years ago

Hey, hakanensari, not sure where/how else to ask this but I'm using peddler to load a list of MWS settlement reports into my application. After properly setting the client, I am writing this to request up to 100 reports (the max) starting at 2 years ago:

reports = client.get_report_list(available_from_date: 2.years.ago.iso8601, report_type_list: "_GET_V2_SETTLEMENT_REPORT_DATA_XML_", max_count: 100)

For the life of me, I cannot figure out why only 5 reports are getting returned (HasNext is set to false so it is not an issue of using the next token which I am doing). I have way more than 5 settlement reports in Amazon. It seems to be taking in the parameters just fine: if I change available_from_date to say 1.day.ago.iso8601, nothing is returned. It is also properly returning only reports with a report_type_list of "_GET_V2_SETTLEMENT_REPORT_DATAXML". It just seems like when I expand the available_from_date, it still goes back only 90 days (the default). Is that the max? The docs from Amazon say "The GetReportList operation returns a list of reports that were created in the previous 90 days that match the query parameters", but also says that the AvailableFromDate is "The earliest date you are looking for".

If the maximum is 90 days, can you think of another way that I could retrieve all my settlement reports?

Thanks in advance!

hakanensari commented 8 years ago

If you indeed have 5 settlement reports in the last 90 days, the API is returning correctly within its maximum scope.

If that's not the case, you should write to them. You can run the query with EXCON_DEBUG=1 to get a detailed output of the request.

And no, I don't know a work-around.

systemnate commented 8 years ago

Thanks for the reply. Definitely seems like it's just a limitation of Amazon's API. Thanks for the tip on getting a more detailed output. I'm sure that will come in handy soon!

urirahimi commented 5 years ago

What was the fix for this? Am getting the same issue where only the settlement data for the last couple of months is being displayed.