Report API
The report API is used to retrieve daily transaction reports by month and retrieve reports available for download by date ranges.
All daily transaction reports generated by Azupay are available for download via our Report API. Daily transaction reports include all completed/settled transactions made to your business in a 24 hour period (12am - 11:59pm) and should be utilised to reconcile transactions with regular sweep amount.
API References
API | Description | Method |
---|---|---|
Get Reports | Allows you to query a month or date range for all available reports. A list of reports available for the queried period will be returned with unique reportIds that can be used as input for the Get Report download URL API. | GET |
Get Report download Url | Gets a short lived (1 minute) url to access a report for a reportId provided to the API. | GET |
Using the Report API
You can supply month + timezone
query parameters OR you can supply fromDate + toDate
. The former provides you a list of all reports automatically generated by Azupay in the specified month, whilst the latter provides you with a report for the date range specified.
All reports generated by Azupay are available for download via our API using three simple steps:
- Get the list of reports
- Get the report's temporary download URL
- Finally, download the report
sequenceDiagram participant Client participant SearchAPI as Azupay API<br/>/report participant DownloadAPI as Azupay API<br/>/report/download participant FileServer as Report File Server Note over Client,FileServer: Complete Report Search and Download Flow %% Phase 1: Search for Reports Client->>+SearchAPI: GET /report<br/>?clientId=CLIENT1&month=2024-01<br/>OR ?clientId=CLIENT1&fromDate=...&toDate=... Note right of Client: Authorization: SecretKey<br/>Search by month OR date range SearchAPI->>SearchAPI: Find available reports<br/>for client and criteria alt Reports Found SearchAPI-->>-Client: 200 OK<br/>{"reports": [<br/> {"reportId": "encoded-id-1", "type": "Transaction Report"},<br/> {"reportId": "encoded-id-2", "type": "MT940"}<br/>]} %% Phase 2: Get Download URL Client->>+DownloadAPI: GET /report/download<br/>?clientId=CLIENT1&reportId=encoded-id-1 Note right of Client: User selects specific report DownloadAPI->>DownloadAPI: Validate authorization<br/>Generate secure download URL alt Authorization Success DownloadAPI-->>-Client: 200 OK<br/>{"reportUrl": "https://secure-download-url"} %% Phase 3: Download File Note over Client,FileServer: Direct File Download Client->>+FileServer: GET Secure Download URL FileServer-->>-Client: Report File<br/>(CSV) end end
Get the list of reports
First, you have to get a list of reports available for a given month or date range.
GET https://api.azupay.com.au/v1/report?clientId=MYBUSINESSID&month=2020-01&timezone=Australia/Sydney
Authorization: SECR_MYBUSINESSID_myapikey
Where:
month
: Reports are for this month. Provide a value in the format YYYY-MMclientId
: Your clientId, in this case it'sMYBUSINESSID
timezone
: The timezone you wish to apply to the dates returned in the response body. Currently, we only support Australia/Sydney
OR you can get the list of reports within a date range (providing a 'from date' and 'to date'):
GET https://api.azupay.com.au/v1/report?clientId=MYBUSINESSID&fromDate=2024-01-02T12%3A11%3A00.999%2B0530&toDate=2024-01-02T12%3A11%3A00.999%2B0530
Authorization: SECR_MYBUSINESSID_myapikey
Where:
clientId
: Your clientId, in this case it'sMYBUSINESSID
fromDate
: the start of the date range for which you specify to search for daily transaction reports intoDate
: the end of the date range for which you specify to search for daily transaction reports in
This request will yield a response like the following:
{
"month": "2020-01",
"reports": [
{
"reportId": "string",
"type": "TXN_V2",
"fromDate": "2020-01-01T00:00:00.004+11:00",
"toDate": "2020-01-01T00:00:00.004+11:00",
"clientId": "string"
}
]
}
Where:
month
: Reports are for this monthreports
: The list of available reportsreports.type
: The type of report. Currently, we supplyTXN_V2
orMT940
(select customers only by request)reports.reportId
: This is the unique ID of the report. You need to parse the response based on the other fieldstype
,fromDate
,toDate
and identify thereportId
you are planning to downloadreports.clientId
: The clientId associated with this report.
Get the report's temporary download URL
Once you have identified the reportId
you are interested in, we can move to the next step
GET https://api.azupay.com.au/v1/report/download?clientId=MYBUSINESSID&reportId=report-id
Authorization: SECR_MYBUSINESSID_myapikey
Where:
clientId
: Your clientId, in this case it'sMYBUSINESSID
reportId
: ThereportId
you identified earlier
This will yield the following response:
{
"reportUrl": "https://azupay.com/reports/1234"
}
Where:
reportUrl
: This is a temporary URL you can use to download the file. It is only valid for a limited amount of time.- These signed links are only valid for 1 minute before expiring for security purposes, so should be consumed programatically as soon as they are generated.
Download the report
Using the reportUrl
, issue a simple GET
request and download the resulting report file:
GET https://azupay.com/reports/1234
This will yield a response with Content-Type
value of application/octet-stream
.
Daily transaction reports provide a different view from live transaction data that is available on the Azupay client dashboard. Daily transaction reports include all completed/settled transactions made to your business in a 24 hour period (12am - 11:59pm).Transaction search results on the dashboard and exported into a report can also include transactions in other statuses like expired, waiting, return_complete etc.
Updated 4 days ago