jlevers / selling-partner-api

A PHP client library for Amazon's Selling Partner API
BSD 3-Clause "New" or "Revised" License
398 stars 185 forks source link

Scheduled reports with different time range than period possible? #587

Closed c-gross closed 1 year ago

c-gross commented 1 year ago

When I create a scheduled report about orders with the period set to 15min I'll get a report every 15min but each contains only the last 15mins the report was created at. If a cronjob was not running for any reason, I need to check all reports to make sure I don't miss any orders.

Is there an parameter to change the time range for the report but still use a different period value? Or is this a SP API limitation? I haven't found any parameter in the SP API docs. But they also don't list the possible ReportOptions params.

jlevers commented 1 year ago

Are you saying you'd like to be able to create a report that generates every 15min but contains orders from the past hour (or something like that)? If so, the answer is no, but it's possible to retrieve multiple past scheduled reports by calling the getReports endpoint, which should have a similar result. If you always grabbed the last 4 auto-generated 15min reports, you'd effectively be downloading the past hour's data.

c-gross commented 1 year ago

Hi, thank you for clarification. I almost expected that. The Amazon API has so many limitations and the documentation is big but not good...

That requires to save all reports to track if I'm missing something. So at the end it's not much less API calls than going for report requests instead of scheduled. It's also not clear based on what date the orders are added to the reports. At least for MWS it was not the updated date. We had problems, that a few orders were only paid after a couple of days (always expected that any Amazon order is instand paid) and thats why not part of the report when the order was placed. So we had to do reports with a longer timerange every day to check if something is missing. No clue if the SP API is different but I guess I'll go the same way again since it was working when we did short timerange reports very often and 1-2 times a day a 1 week report.

I'm still not sure if the GET_FLAT_FILE_ACTIONABLE_ORDER_DATA_SHIPPING is a good choice. It's missing paid product prices so I might need to run a 2nd report to get that informartion.