curl --request POST \
--url https://api.staging.payrails.io/analytics/reportRuns \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"reportCode": "transaction_details",
"parameters": {
"timezone": "Etc/UTC",
"intervalStart": "2025-12-01",
"intervalEnd": "2025-12-07"
}
}
'import requests
url = "https://api.staging.payrails.io/analytics/reportRuns"
payload = {
"reportCode": "transaction_details",
"parameters": {
"timezone": "Etc/UTC",
"intervalStart": "2025-12-01",
"intervalEnd": "2025-12-07"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
reportCode: 'transaction_details',
parameters: {timezone: 'Etc/UTC', intervalStart: '2025-12-01', intervalEnd: '2025-12-07'}
})
};
fetch('https://api.staging.payrails.io/analytics/reportRuns', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.staging.payrails.io/analytics/reportRuns",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'reportCode' => 'transaction_details',
'parameters' => [
'timezone' => 'Etc/UTC',
'intervalStart' => '2025-12-01',
'intervalEnd' => '2025-12-07'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.staging.payrails.io/analytics/reportRuns"
payload := strings.NewReader("{\n \"reportCode\": \"transaction_details\",\n \"parameters\": {\n \"timezone\": \"Etc/UTC\",\n \"intervalStart\": \"2025-12-01\",\n \"intervalEnd\": \"2025-12-07\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.staging.payrails.io/analytics/reportRuns")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"reportCode\": \"transaction_details\",\n \"parameters\": {\n \"timezone\": \"Etc/UTC\",\n \"intervalStart\": \"2025-12-01\",\n \"intervalEnd\": \"2025-12-07\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.staging.payrails.io/analytics/reportRuns")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"reportCode\": \"transaction_details\",\n \"parameters\": {\n \"timezone\": \"Etc/UTC\",\n \"intervalStart\": \"2025-12-01\",\n \"intervalEnd\": \"2025-12-07\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "cadb0015-3c26-4d7a-a9d3-2f8768b6d45a",
"createdAt": "2023-01-05T10:20:00.000Z",
"workspaceId": "7f9f1882-a103-408d-ac96-46a7021e537a",
"report": {
"id": "7f9f1882-a103-408d-ac96-46a7021e537a",
"code": "payments.itemized.1",
"name": "Payments",
"description": "The payments report."
},
"parameters": {
"timezone": "Etc/UTC",
"intervalStart": "2022-04-22",
"intervalEnd": "2022-04-24"
},
"status": "pending"
}{
"errors": [
{
"id": "a24bc325-3929-4d9d-9c08-b3aa532685b7",
"code": "request.malformed",
"detail": "The request has malformed syntax",
"docUrl": "https://docs.payrails.com/docs/resources/error-codes#requestmalformed"
}
]
}{
"errors": [
{
"id": "a24bc325-3929-4d9d-9c08-b3aa532685b7",
"code": "request.unauthorized",
"detail": "The request lacks necessary credentials to perform the specified action",
"docUrl": "https://docs.payrails.com/docs/resources/error-codes#requestunauthorized"
}
]
}{
"errors": [
{
"id": "e7db22b3-914e-4975-928e-9edfb0885bea",
"code": "request.forbidden",
"detail": "The request credentials lack the required permissions to perform the specified action",
"docUrl": "https://docs.payrails.com/docs/resources/error-codes#requestforbidden"
}
]
}{
"errors": [
{
"id": "a24bc325-3929-4d9d-9c08-b3aa532685b7",
"code": "request.not-found",
"detail": "The requested resource was not found",
"docUrl": "https://docs.payrails.com/docs/resources/error-codes#requestnot-found"
}
]
}Create a report run
Create a report run for the provided report.
curl --request POST \
--url https://api.staging.payrails.io/analytics/reportRuns \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"reportCode": "transaction_details",
"parameters": {
"timezone": "Etc/UTC",
"intervalStart": "2025-12-01",
"intervalEnd": "2025-12-07"
}
}
'import requests
url = "https://api.staging.payrails.io/analytics/reportRuns"
payload = {
"reportCode": "transaction_details",
"parameters": {
"timezone": "Etc/UTC",
"intervalStart": "2025-12-01",
"intervalEnd": "2025-12-07"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
reportCode: 'transaction_details',
parameters: {timezone: 'Etc/UTC', intervalStart: '2025-12-01', intervalEnd: '2025-12-07'}
})
};
fetch('https://api.staging.payrails.io/analytics/reportRuns', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.staging.payrails.io/analytics/reportRuns",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'reportCode' => 'transaction_details',
'parameters' => [
'timezone' => 'Etc/UTC',
'intervalStart' => '2025-12-01',
'intervalEnd' => '2025-12-07'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.staging.payrails.io/analytics/reportRuns"
payload := strings.NewReader("{\n \"reportCode\": \"transaction_details\",\n \"parameters\": {\n \"timezone\": \"Etc/UTC\",\n \"intervalStart\": \"2025-12-01\",\n \"intervalEnd\": \"2025-12-07\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.staging.payrails.io/analytics/reportRuns")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"reportCode\": \"transaction_details\",\n \"parameters\": {\n \"timezone\": \"Etc/UTC\",\n \"intervalStart\": \"2025-12-01\",\n \"intervalEnd\": \"2025-12-07\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.staging.payrails.io/analytics/reportRuns")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"reportCode\": \"transaction_details\",\n \"parameters\": {\n \"timezone\": \"Etc/UTC\",\n \"intervalStart\": \"2025-12-01\",\n \"intervalEnd\": \"2025-12-07\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "cadb0015-3c26-4d7a-a9d3-2f8768b6d45a",
"createdAt": "2023-01-05T10:20:00.000Z",
"workspaceId": "7f9f1882-a103-408d-ac96-46a7021e537a",
"report": {
"id": "7f9f1882-a103-408d-ac96-46a7021e537a",
"code": "payments.itemized.1",
"name": "Payments",
"description": "The payments report."
},
"parameters": {
"timezone": "Etc/UTC",
"intervalStart": "2022-04-22",
"intervalEnd": "2022-04-24"
},
"status": "pending"
}{
"errors": [
{
"id": "a24bc325-3929-4d9d-9c08-b3aa532685b7",
"code": "request.malformed",
"detail": "The request has malformed syntax",
"docUrl": "https://docs.payrails.com/docs/resources/error-codes#requestmalformed"
}
]
}{
"errors": [
{
"id": "a24bc325-3929-4d9d-9c08-b3aa532685b7",
"code": "request.unauthorized",
"detail": "The request lacks necessary credentials to perform the specified action",
"docUrl": "https://docs.payrails.com/docs/resources/error-codes#requestunauthorized"
}
]
}{
"errors": [
{
"id": "e7db22b3-914e-4975-928e-9edfb0885bea",
"code": "request.forbidden",
"detail": "The request credentials lack the required permissions to perform the specified action",
"docUrl": "https://docs.payrails.com/docs/resources/error-codes#requestforbidden"
}
]
}{
"errors": [
{
"id": "a24bc325-3929-4d9d-9c08-b3aa532685b7",
"code": "request.not-found",
"detail": "The requested resource was not found",
"docUrl": "https://docs.payrails.com/docs/resources/error-codes#requestnot-found"
}
]
}Authorizations
You can use an OAuth2 JWT bearer token in the Authorization header of your API requests for supported endpoints: Authorization: Bearer <YOUR_JWT_HERE>.
These tokens are valid for 10 minutes and can be requested via the access token endpoint endpoint.
Body
The unique code of the report.
Hide child attributes
Hide child attributes
Defaults to Etc/UTC. The output timezone for all timestamps in the report. A list of possible time zone values is maintained at the IANA Time Zone Database.
The start interval for the report.
The end interval for the report.
The date field that intervalStart and intervalEnd filter on. updatedAt is only supported for the payments and transactions reports.
createdAt, updatedAt Unique identifier of a workspace in Payrails.
Response
Accepted.
The unique identifier of the report run.
Time at which the reportRun was created.
Hide child attributes
Hide child attributes
Defaults to Etc/UTC. The output timezone for all timestamps in the report. A list of possible time zone values is maintained at the IANA Time Zone Database.
The start interval for the report.
The end interval for the report.
The date field that intervalStart and intervalEnd filter on. updatedAt is only supported for the payments and transactions reports.
createdAt, updatedAt The status of the report run.
pending, successful, failed Unique identifier of a workspace in Payrails.
If the report run is successful (i.e. status=successful), the details about the generated report file.
Hide child attributes
Hide child attributes
The suitable name for saving the file to a filesystem. Containing the directory and the name of the file (without the file extension).
The returned file type.
csv The URL from which to download the file.
The time at which the URL will expire and the file will no longer be accessible.
If the report run fails (i.e. status=failed), a message about the failure.
The time at which the report run completes.