Download a report asynchronously
This guide walks you through the process of requesting and downloading reports asynchronously, which is ideal for larger reports that require more processing time.
Before You Start
Ensure you have the following:
- Valid authentication token (See Authenticate and retrieve accounts to learn how to authenticate)
- Identified which report type you need (see the list of reports in the reporting and reconciliation overview)
- Required parameters for your chosen report type
Step-by-Step Guide
Step 1: Request a Report
-
Prepare your request to the appropriate endpoint:
POST /api/v2/reports/requests/{report-type}
-
Include these headers:
Content-Type: application/json
Authorization: Bearer {your-access-token}
- The response will include a Location field in the header, e.g.
Location: api/v2/reports/requests/{request-id}/get-status
, allowing you to check the status of your report.
Step 2: Check Report Status
Use the Location
header field from the previous step to check status:
GET /api/v2/reports/{request-id}/get-status
Expected responses:
- 202 Processing: Indicates that the report is being generated. The response header will include a
retry-after
value in seconds and aLocation
string indicating the path to check the status again - 302 Complete: Indicates that the report has been generated. The response header will include a
Location
string indicating the path to download the report
Step 3: Download the Report
-
Once the report status endpoint returns a 302, prepare your download request:
GET /api/v1/reports/download-report/{reportId}
-
Include these headers:
Accept: application/json
Authorization: Bearer {your-access-token}
Congratulations! You have now successfully requested and downloaded a report asynchronously.
Updated about 2 months ago