Get a URL for file upload.
curl --request POST \
--url https://api.staging.payrails.io/analytics/files/upload \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-idempotency-key: <x-idempotency-key>' \
--data '
{
"datasetType": "transactions",
"file": {
"name": "testprovider_transactions_2025-01-01.csv",
"type": "csv"
}
}
'import requests
url = "https://api.staging.payrails.io/analytics/files/upload"
payload = {
"datasetType": "transactions",
"file": {
"name": "testprovider_transactions_2025-01-01.csv",
"type": "csv"
}
}
headers = {
"x-idempotency-key": "<x-idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-idempotency-key': '<x-idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
datasetType: 'transactions',
file: {name: 'testprovider_transactions_2025-01-01.csv', type: 'csv'}
})
};
fetch('https://api.staging.payrails.io/analytics/files/upload', 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/files/upload",
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([
'datasetType' => 'transactions',
'file' => [
'name' => 'testprovider_transactions_2025-01-01.csv',
'type' => 'csv'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-idempotency-key: <x-idempotency-key>"
],
]);
$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/files/upload"
payload := strings.NewReader("{\n \"datasetType\": \"transactions\",\n \"file\": {\n \"name\": \"testprovider_transactions_2025-01-01.csv\",\n \"type\": \"csv\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-idempotency-key", "<x-idempotency-key>")
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/files/upload")
.header("x-idempotency-key", "<x-idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"datasetType\": \"transactions\",\n \"file\": {\n \"name\": \"testprovider_transactions_2025-01-01.csv\",\n \"type\": \"csv\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.staging.payrails.io/analytics/files/upload")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-idempotency-key"] = '<x-idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"datasetType\": \"transactions\",\n \"file\": {\n \"name\": \"testprovider_transactions_2025-01-01.csv\",\n \"type\": \"csv\"\n }\n}"
response = http.request(request)
puts response.read_body{
"datasetType": "transactions",
"file": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "testprovider_transactions_2025-01-01.csv",
"type": "csv"
},
"uploadUrl": "https://s3.amazonaws.com/bucket-name/uploads/merchant-name/landing/transactions/2025-03-15/123e4567-e89b-12d3-a456-426614174000/testprovider_transactions_2025-01-01.csv?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=ACCESS_KEY%2F20250315%2Fus-central-1%2Fs3%2Faws4_request&X-Amz-Date=20250315T120000Z&&X-Amz-SignedHeaders=host&x-id=PutObject&X-Amz-Signature=example-signature",
"expiresAt": "2025-03-15T12:00:00Z"
}{
"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"
}
]
}Get a URL for file upload.
Request a presigned “PUT” URL to upload a file. The maximum file size allowed is 5 GB.
POST
https://api.staging.payrails.io
/
analytics
/
files
/
upload
Get a URL for file upload.
curl --request POST \
--url https://api.staging.payrails.io/analytics/files/upload \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-idempotency-key: <x-idempotency-key>' \
--data '
{
"datasetType": "transactions",
"file": {
"name": "testprovider_transactions_2025-01-01.csv",
"type": "csv"
}
}
'import requests
url = "https://api.staging.payrails.io/analytics/files/upload"
payload = {
"datasetType": "transactions",
"file": {
"name": "testprovider_transactions_2025-01-01.csv",
"type": "csv"
}
}
headers = {
"x-idempotency-key": "<x-idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-idempotency-key': '<x-idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
datasetType: 'transactions',
file: {name: 'testprovider_transactions_2025-01-01.csv', type: 'csv'}
})
};
fetch('https://api.staging.payrails.io/analytics/files/upload', 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/files/upload",
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([
'datasetType' => 'transactions',
'file' => [
'name' => 'testprovider_transactions_2025-01-01.csv',
'type' => 'csv'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-idempotency-key: <x-idempotency-key>"
],
]);
$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/files/upload"
payload := strings.NewReader("{\n \"datasetType\": \"transactions\",\n \"file\": {\n \"name\": \"testprovider_transactions_2025-01-01.csv\",\n \"type\": \"csv\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-idempotency-key", "<x-idempotency-key>")
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/files/upload")
.header("x-idempotency-key", "<x-idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"datasetType\": \"transactions\",\n \"file\": {\n \"name\": \"testprovider_transactions_2025-01-01.csv\",\n \"type\": \"csv\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.staging.payrails.io/analytics/files/upload")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-idempotency-key"] = '<x-idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"datasetType\": \"transactions\",\n \"file\": {\n \"name\": \"testprovider_transactions_2025-01-01.csv\",\n \"type\": \"csv\"\n }\n}"
response = http.request(request)
puts response.read_body{
"datasetType": "transactions",
"file": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "testprovider_transactions_2025-01-01.csv",
"type": "csv"
},
"uploadUrl": "https://s3.amazonaws.com/bucket-name/uploads/merchant-name/landing/transactions/2025-03-15/123e4567-e89b-12d3-a456-426614174000/testprovider_transactions_2025-01-01.csv?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=ACCESS_KEY%2F20250315%2Fus-central-1%2Fs3%2Faws4_request&X-Amz-Date=20250315T120000Z&&X-Amz-SignedHeaders=host&x-id=PutObject&X-Amz-Signature=example-signature",
"expiresAt": "2025-03-15T12:00:00Z"
}{
"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.
Headers
Idempotency key to be used. Sending again the same key would return the same result without re-executing the update.
Body
application/json
Dataset type.
Available options:
transactions, transactionsV1, ordersV1, checkout.reports.financial_actions_by_daterange, checkout.reports.payments, checkout.reports.authentication, adyen.reports.payments_accounting, adyen.reports.received_payments Response
Created.
Dataset type.
Available options:
transactions, transactionsV1, ordersV1, checkout.reports.financial_actions_by_daterange, checkout.reports.payments, checkout.reports.authentication, adyen.reports.payments_accounting, adyen.reports.received_payments Presigned "PUT" URL to upload a file.
The time when the uploadUrl will expire.
Last modified on October 7, 2026