HomeDocumentationCode SamplesAnnouncementsModelsRelease NotesFAQVideos
Developer HubAPI StatusSupport
Documentation
Developer HubAPI StatusSupport

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:

  1. Periodically poll the Amazon SQS queue for REPORT_PROCESSING_FINISHED notification event which provides information when the report processing is CANCELLED, DONE or FATAL. The notification event includes a reportDocumentId value if there is report data available.

  2. For each reportDocumentId that represents a report that you want to retrieve:

    1. Call the getReportDocument operation, passing the reportDocumentId 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.

    2. 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

  1. Retrieve information about reports that can be downloaded

  2. Retrieve the report

Step 1. Retrieve information about reports that can be downloaded

  1. 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.

  1. For each reportDocumentId that represents a report that you want to retrieve, save the reportDocumentId 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.