Available report types
You can list all reports available to your organization using the Search & list reports endpoint.
Download reports via API
Generating a report is an asynchronous process. Follow these steps:Step 1: Get an access token
Authenticate using your API credentials to obtain a bearer token. See Authentication for details.Step 2: Create a report run
Submit aPOST request to /analytics/reportRuns with your desired report type and date range.
When requesting settlements reports, please do not specify any Workspace Id as settlements report is only available on organization level.
workspaceId field is optional. Include it only if you want to scope the report to a specific workspace. Omitting it returns data across all workspaces your credentials have access to.
Parameters
The API responds with
202 Accepted and a report run object in pending status:
Step 3: Poll for completion
Report generation runs asynchronously. PollGET /analytics/reportRuns/{id} using the id from the previous response until status changes from pending to successful.
result object with a pre-signed download URL:
Step 4: Download the CSV
Execute aGET request on result.url to download the file. This URL is pre-signed and expires at result.expiresAt — make sure to download the file before it expires.
Download reports via Portal
- Log in to the Payrails Portal.
- Navigate to Reports.
- Select the report type and date range.
- Click Download to export a CSV file.
Limitations
- File format: Reports are only available as CSV files.
- File size: Reports are capped at 5 GB per file. If your date range produces a report that exceeds this limit, the report run will fail. Reduce the date range and re-run the report.
- File expiry: The pre-signed download URL expires after a fixed TTL. Download the file before
result.expiresAt. If it has expired, calling theGET /analytics/reportRuns/{id}endpoint will generate a new pre-signed download URL. - No webhook or push notification: There is currently no callback or event mechanism to notify you when a report run is ready. Polling
GET /analytics/reportRuns/{id}is the only way to check completion status. Build your integration to poll actively and handle bothSuccessfulandFailedterminal states. - Report availability: The report types available to your organization depend on your Payrails module configuration. Use the Search & list reports endpoint to confirm which report codes are enabled for your account.
Error handling
Report runs can complete with aFailed status. Your integration should handle this explicitly. Do not assume a run will always succeed.
When a run fails, the response includes an error field with a code describing the reason.
FAQ
How long does it take for a report run to complete?
How long does it take for a report run to complete?
Most report runs complete within 2–3 minutes. Polling every 5–10 seconds is
recommended.
Is there a way to be notified when a report is ready, without polling?
Is there a way to be notified when a report is ready, without polling?
Not currently. There is no webhook or callback mechanism available — polling
is the only way to check on a report run. Send a
GET request to
/analytics/reportRuns/{id} at a regular interval (every 5–10 seconds is
recommended) until the status is Successful or Failed. Make sure your
integration handles both terminal states explicitly.What happens if my report exceeds the 5 GB file size limit?
What happens if my report exceeds the 5 GB file size limit?
The report run will fail with an error. Reduce the date range in your request
and re-run the report. If you regularly need to export large volumes of data,
consider breaking your date range into smaller weekly or bi-weekly batches.
What timezone should I use?
What timezone should I use?
Use a TZ database name such as
Europe/Berlin or America/New_York. If you omit the timezone parameter,
it defaults to UTC. Choosing the right timezone ensures that day boundaries
in the report align with your local business hours.Can I re-download a report after the URL expires?
Can I re-download a report after the URL expires?
Yes. If it has expired, calling the
GET /analytics/reportRuns/{id}endpoint
will generate a new pre-signed download URL.Can I scope a report to a single workspace?
Can I scope a report to a single workspace?
Yes. Pass the
workspaceId field in the request body to filter results to a
specific workspace. Omit it to include data across all workspaces your
credentials have access to.What does the Search & list report runs endpoint return if I don't pass any parameters?
What does the Search & list report runs endpoint return if I don't pass any parameters?
The endpoint returns the most recent report runs in descending order by
createdAt, with a default page size of 10. You can paginate using
page[after], page[before], and page[size], and filter by
filters[status], filters[id], and filters[workspaceId].How do I match records across the different report types?
How do I match records across the different report types?
Each report includes three reference fields you can use to link records: