jlevers / selling-partner-api

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

report keep getting cancel #545

Open btdesign opened 1 year ago

btdesign commented 1 year ago

Hi,

I'm not sure what went wrong. Report keep getting cancel, any idea?

                                [report_id] => 383023019497
                                [report_type] => GET_FLAT_FILE_RETURNS_DATA_BY_RETURN_DATE
                                [data_start_time] => 2023-05-09T00:00:00+00:00
                                [data_end_time] => 2023-05-18T23:59:59+00:00
                                [report_schedule_id] => 
                                [created_time] => 2023-05-20T01:11:34+00:00
                                [processing_status] => CANCELLED
                                [processing_start_time] => 2023-05-20T01:11:41+00:00
                                [processing_end_time] => 2023-05-20T01:11:48+00:00
                                [report_document_id] => 

Let me know if anyone have this problem?

Thank you

jlevers commented 1 year ago

Is it always cancelled, or just most or the time? There are (very confusingly) rate limits on how often you can generate certain reports that are different (and lower) than the rate limits for the Reports API endpoints themselves.

ansgarbecker commented 1 year ago

I recall I had the same issue with MWS some time ago. Could be that report is also scheduled, and the requested one is therefore cancelled? At least Jesse's definition says it can be requested and scheduled: https://github.com/jlevers/selling-partner-api/blob/42c3ed813782d88053e0eb739930f1b785937649/lib/ReportType.php#L335

ansgarbecker commented 1 year ago

I would have a look into Amazon's backend / seller central, and try to find whether that GET_FLAT_FILE_RETURNS_DATA_BY_RETURN_DATE report is already scheduled. If yes, that could be the cause. If not, then there might just be no data for the report.

HeBuguM commented 1 year ago

CANCELLED in most cases means there is no data available for the selected timespan. You can verify that by going to the Seller Central Reports -> Return Reports where you can browse the generated reports, it should say "No records" on this one.

jlevers commented 1 year ago

@btdesign have you resolved this issue?