Harsh Rana
Harsh Rana

Reputation: 1

Amazon SP Reports API Returns FATAL/CANCELLED Error

When I call a report in a loop and when we get the report data it always returns a FATAL status, what is the reason?

I am fetching reports of the whole week in a loop day by day, so I get the report id from createReport API, but when I call getReport it will always return FATAL, can anyone explain to me why it returns FATAL.

I have a logic for reports to check the whole week data in a loop day by day, and if it is found that any of the day's reports are not generated then it will call that particular date report data,

like let's say, my cron is running daily and it will execute the loop something like this

$firstday = date('Y-m-d', strtotime("this week"));
$end_date = date('Y-m-d');

while (strtotime($firstday) <= strtotime($end_date)) {
if($firstday <= $end_date){
//my logic to check the report is generated for that day if not then call create report
$startDate = date('Y-m-d', strtotime('-1 day', strtotime($firstday)));
$startDate .= " 00:02:00";
$endDate = $firstday;
$endDate .= " 00:01:59";
$reportType = 'GET_FBA_FULFILLMENT_INVENTORY_HEALTH_DATA';
}
$firstday = date ("Y-m-d", strtotime("+1 day", strtotime($firstday)));
}

So this is my logic that how I can fetch the report for a single day.

Below are the Reports that return FATAL/CANCELLED

  1. GET_FBA_MYI_UNSUPPRESSED_INVENTORY_DATA
  2. GET_RESERVED_INVENTORY_DATA
  3. GET_FBA_FULFILLMENT_REMOVAL_ORDER_DETAIL_DATA
  4. GET_FBA_FULFILLMENT_CUSTOMER_SHIPMENT_REPLACEMENT_DATA

Also, this same logic I was using in MWS and is working fine till now. I am facing this issue only in SP API.

Upvotes: 0

Views: 2317

Answers (1)

Max
Max

Reputation: 3

I know this is old, however there's a time period for which you cannot ask for new reports. I've experienced it the hard way. If you ask now then again in 5, it'll cancel itself. Check if that's not your issue.

Upvotes: 0

Related Questions