Retrieve automatically generated reports
Learn how to use the Reports API to retrieve automatically generated reports.
Learn how to use the Reports API to retrieve automatically generated reports. Use the following process for requesting an automatically generated report:
-
Periodically poll the Amazon Simple Queue Service (Amazon SQS) queue for
REPORT_PROCESSING_FINISHED
notification event which provides information when the report processing isCANCELLED
,DONE
orFATAL
. The notification event includes areportDocumentId
value if there is report data available. -
For each
reportDocumentId
that represents a report that you want to retrieve:-
Call the
getReportDocument
operation, passing thereportDocumentId
value.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.
-
Prerequisites
To complete these tutorials, you need:
- Authorization from the selling partner for whom you are making calls. For more information, refer to Authorizing Selling Partner API applications.
- One of the required roles for the Reports API assigned to your developer profile.
- One of the required roles for the Reports API selected in the app registration page for your application.
- The report type that you will request. Refer to Report Type Values for a list of the available report types.
- A working Java Development Kit (JDK) installation to run sample code.
Step 1. Retrieve information about reports that can be downloaded
-
You can periodically poll the Amazon SQS queue to check if you have received a notification regarding the Amazon generated reports. To confirm that report processing is complete, refer to Verify that the report processing is complete.
The
REPORT_PROCESSING_FINISHED
notification event contains thereportDocumentId
, which can be used to download the report. -
For each
reportDocumentId
that represents a report that you want to retrieve, save thereportDocumentId
and go to Step 2 to retrieve the report.
The following response example contains the reportDocumentId
that you need to retrieve the report.
{
"reports": [
{
"reportType": "GET_V2_SETTLEMENT_REPORT_DATA_FLAT_FILE",
"processingEndTime": "2021-08-03T01:02:25+00:00",
"processingStatus": "DONE",
"marketplaceIds": [
"ATVPDKIKX0DER"
],
"reportDocumentId": "DOC-b8b0-4226-b4b9-0ee058ea5760",
"reportId": "ID222",
"dataEndTime": "2021-08-03T01:02:25+00:00",
"createdTime": "2021-08-03T01:02:25+00:00",
"processingStartTime": "2021-08-03T01:02:25+00:00",
"dataStartTime": "2021-08-03T01:02:25+00:00"
}
]
}
Step 2. Retrieve the report
To retrieve a report, refer to Retrieve a report.
Updated about 17 hours ago