Processing Reports
Requesting & Downloading Processing Exports
Partners can request an export of processing reports programmatically at an interval that fits their needs. After receiving a report export request, PPRO queues the work and generates the bulk file asynchronously. Once ready, the partner is notified via Webhooks, and a URL becomes available for downloading the CSV file.
1. Request a Report Export
Whenever you want to receive a payments processing report, make a request to PPRO's Reporting API endpoint:
POST /v1/payment-reports
In the request body, specify:
Field | Value | Description |
---|---|---|
operationType | Enum: AUTHORIZATION , CAPTURE , REFUND or VOID | The type of payment charge operation to be included in the report. |
startDate | ISO 8601 date-time. Example: "2022-11-03T11:23:47.123Z" | The report cutoff start date. Payments earlier than this time will not be included in the report. |
endDate | ISO 8601 date-time. Example: "2022-12-03T11:23:47.123Z" | The report cutoff end date. Payments later than this time will not be included in the report. |
A single payments report can cover a maximum of 6 months of data. If you would like to get data for a greater time range, you'll need to create additional reports and combine them.
Example Request:
POST /v1/payment-reports HTTP/1.1
Host: api.sandbox.eu.ppro.com
{
"operationType": "REFUND",
"startDate": "2022-11-23T11:23:47.123Z",
"endDate": "2022-12-23T11:23:47.123Z"
}
Response:
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": "rprt_kBw1dhKO20PzjJT0ltERA",
"createdAt": "2023-03-03T18:40:54.123Z",
"status": "PENDING",
"operationType": "REFUND",
"startDate": "2022-11-23T11:23:47.123Z",
"endDate": "2022-12-23T11:23:47.123Z",
"updatedAt": "2023-03-03T19:40:54.123Z",
}
The Payment Report status will start out asPENDING
, and transition to PROCESSED
, FAILED
or EXPIRED
afterwards. You can receive webhooks to be notified of each of these state changes.
2. Download the Reporting File
After a few minutes, the report status changes to PROCESSED
, and a download URL is available. You can retrieve this downloadUrl
field from the REPORT_PROCESSED
webhook payload, or call the API on the report id:
GET /v1/payment-reports/{report-id}
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": "rprt_kBw1dhKO20PzjJT0ltERA",
"createdAt": "2023-03-03T18:40:54.123Z",
"status": "PROCESSED",
"operationType": "REFUND",
"startDate": "2022-11-23T11:23:47.123Z",
"endDate": "2022-12-23T11:23:47.123Z",
"updatedAt": "2023-03-03T19:40:54.123Z",
"downloadUrl": "https://url-to-reports.com/?nonce=abc"
}
Note: The payment report entity will change toEXPIRED
and become unusable 2 hours after creation, so ensure you have downloaded the CSV before this time.
Updated 11 months ago