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

Fetching GET_FBA_FULFILLMENT_CURRENT_INVENTORY_DATA report results in status of FATAL, but no errors are given #742

Closed jlevers closed 1 year ago

jlevers commented 3 years ago

I'm generating reports with createReport, then getting the generated report data with getReport. This is working just fine for most report types that I have access to based on the roles I'm approved for, but the GET_FBA_FULFILLMENT_CURRENT_INVENTORY_DATA report results in a processingStatus of FATAL. The errors field is still null, so I'm not sure how to debug the issue. Any insights here?

Thanks!

charliecode commented 3 years ago

@jlevers I'm literally writing code right now to get the exact same report. I'll let you know how it goes so you have that to go off. Especially if I have a similar issue.

jlevers commented 3 years ago

I think the issue may be that daily reports can only be generated every 4 hours, per this section of the docs. I'll try again in 4 hours and let you know if that's the issue.

jlevers commented 3 years ago

Update on this -- the FATAL issue does appear to be as a result of trying to call the report more than once per hour, but after waiting 4 hours, I get CANCELLED when I try to generate the report. When I log into Seller Central directly and generate the report as a .txt file, it works as expected.

petergzli commented 3 years ago

Hey @charliecode @jlevers any updates on this issue? I am seeing a bunch of fatals and cancelled among the FBA inventory reports like GET_FBA_FULFILLMENT_MONTHLY_INVENTORY_DATA

Is the 1 hour limit for fetching any combination of report_type commutatively or is that counted per single report_type?

jlevers commented 3 years ago

I believe the 1 hour limit is per report type, not cumulative, although I don't know that for sure.

I think the reason I was getting CANCELLED was because there wasn't actually any data to put in the report, so instead of returning an empty report, the report was just being cancelled before it was generated. That said, this was a while ago so I'm not totally sure I'm remembering the details correctly.

petergzli commented 3 years ago

Hey @jlevers thanks for the response. I'm not sure if the no data reason makes sense. I've generated reports where the report came up blank, yet it still completed, i.e. the headers show up after decrypting, but no values under the headers therefore no data.

These reports straight up just come up as FATAL or CANCELLED.

Just curious what report options and full request are you using? I've tried sending nothing and then trying to set a dataStartTime but the results are the same.

jlevers commented 3 years ago

I'm not actually fetching any FBA reports anymore, but I can give you an example of a Reports request that I'm making for a different report type -- are you looking for an example of the createReport request or the getReport request, or something else?

rugved1991 commented 3 years ago

Hi @jlevers,

Does this issue still persists? If yes, please open up a support case so that we can investigate this issue further. Feel free to add the case ID here for tracking.

Thanks, Rugved Solutions Architect, SP API

YFBook commented 3 years ago

i have the some issue.

I have hundreds of sller, some seller will get this error when fetching GET_RESTOCK_INVENTORY_RECOMMENDATIONS_REPORT report .

The Country codes for these seller are BR,SG,IN,AE,TR,AU,NL .

jlevers commented 3 years ago

Hi @rugved1991, I know it's been a while since I opened this -- but I'm running into the issue of having most GET_FBA_FULFILLMENT_CURRENT_INVENTORY_DATA reports coming back cancelled (among issues with several other report types).

I've opened a case related to these problematic reports: 8412495111. My client and I have been waiting on a real response to this case for over a month.

davit-b commented 3 years ago

Hi, I'm having these FATAL error popping up with no description of why. Would it be possible to open an issue with the engineering team to add some descriptive error messages on this API?

Is there another API I can call to view the error messages?

wbmgaye commented 2 years ago

Hi @rugved1991 ,

I am also getting this same error, with no descriptive message of why the processingStatus is FATAL. Does the Selling Partner team have a Jira support ticket system similar to the Advertising team?

jlevers commented 2 years ago

Edit -- sorry, ignore the below -- that only has worked for me for Vendor reports. Sorry for the misleading info.

Quick update on my end -- I found that if I made the start date at least 2 days before the current date, the reports stopped coming back FATAL. Not a perfect solution, but hope it helps someone else out.

wbmgaye commented 2 years ago

Anyone still having an issue with this, I was able to resolve mine yesterday based on a couple of documentation I found and hopefully this helps you too.

1 - There is a throttling limit of 4 hours for daily reports and 30 minutes for near real-time reports. You can tell if the report type is daily or near real-time by cmd+f and search near real-time and you should see it in the report description.

I also suspect you can't make the exact same report request in the time constraint. So if you made a request with these params

{
reportType: 'GET_FBA_FULFILLMENT_CURRENT_INVENTORY_DATA',
dataStartTime: moment.utc().subtract(4, 'day').startOf('day').toISOString(),
dataEndTime: moment.utc().subtract(1, 'day').endOf('day').toISOString(),
marketplaceIds: ['ATVPDKIKX0DER],
}

and your report is daily and then you tried to make that same request before the 4 hour limit, you will get the fatal error. I haven't verified if changing the params allows you to by pass the time constraint, so maybe someone else can look into that.

2 - Report generation takes time and you need to use polling. Followed these steps, documentation is linked below.

Here are the high-level steps for requesting a report:

Call the createReport operation, specifying the type of report and the marketplaces that you are requesting, and any optional parameters that you want.

Amazon receives the report request. If the operation is successful, the response includes a reportId value.

Periodically call the getReport operation, passing the reportId value from the previous step, until the processingStatus value in the response indicates that processing has ended. Processing will have ended when the processingStatus equals CANCELLED, DONE or FATAL. At this point the response includes a reportDocumentId value if there is report data available.

Call the getReportDocument operation, passing the reportDocumentId value from the previous step.

Amazon returns a pre-signed URL for the location of the report document, and the compression algorithm used if the report document contents have been compressed.

Download the report.

If you're testing make sure to save the reportId and any other responses (reportDocumentId, url) you get back from the API. Once you have any of these you can always go back and call the specific step in the chain of requests to get the next response.

https://developer-docs.amazon.com/sp-api/docs/reports-api-v2021-06-30-use-case-guide#tutorial-request-and-retrieve-a-report.

3 - If you're using javascript/typescript my company uses this and it make it a lot easier to work with the API https://github.com/whitebox-co/selling-partner-api-sdk