Tutorial: Retrieve Automatically Generated Reports
Get reports from Amazon to help selling partners manage their business.
API Version: 2021-06-30
Use the following process for requesting an automatically generated report:
-
Periodically poll the 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
The following items are required to successfully complete this tutorial:
-
One or more report types to download after the report data is available. Refer to reportType values for a list of report types.
-
Authorization from the selling partner for whom you are making calls. Refer to Authorizing Selling Partner API applications for more information.
-
A working Java Development Kit (JDK) installation to run sample code.
Steps
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 How to verify that the report processing is complete.
The REPORT_PROCESSING_FINISHED
notification event contains the reportDocumentId
, 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.
Response example:
{
"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 5 months ago