Create Settlement Report Export
curl --request POST \
--url https://api.getsafepay.com/raastwire/v1/aggregators/{raast-aggregator-id}/settlements/report-exports \
--header 'Content-Type: application/json' \
--header 'X-SFPY-AGGREGATOR-SECRET-KEY: <api-key>' \
--data '
{
"settlement_batch_id": "sb_6eb80843-eb2b-4df2-b85f-25d50f03d2a1",
"merchant_id": "mer_e1a38d10-0064-4d7b-a700-f4ba483efb05",
"kind": "REPORT_KIND_BATCH"
}
'import requests
url = "https://api.getsafepay.com/raastwire/v1/aggregators/{raast-aggregator-id}/settlements/report-exports"
payload = {
"settlement_batch_id": "sb_6eb80843-eb2b-4df2-b85f-25d50f03d2a1",
"merchant_id": "mer_e1a38d10-0064-4d7b-a700-f4ba483efb05",
"kind": "REPORT_KIND_BATCH"
}
headers = {
"X-SFPY-AGGREGATOR-SECRET-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-SFPY-AGGREGATOR-SECRET-KEY': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
settlement_batch_id: 'sb_6eb80843-eb2b-4df2-b85f-25d50f03d2a1',
merchant_id: 'mer_e1a38d10-0064-4d7b-a700-f4ba483efb05',
kind: 'REPORT_KIND_BATCH'
})
};
fetch('https://api.getsafepay.com/raastwire/v1/aggregators/{raast-aggregator-id}/settlements/report-exports', 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.getsafepay.com/raastwire/v1/aggregators/{raast-aggregator-id}/settlements/report-exports",
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([
'settlement_batch_id' => 'sb_6eb80843-eb2b-4df2-b85f-25d50f03d2a1',
'merchant_id' => 'mer_e1a38d10-0064-4d7b-a700-f4ba483efb05',
'kind' => 'REPORT_KIND_BATCH'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-SFPY-AGGREGATOR-SECRET-KEY: <api-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.getsafepay.com/raastwire/v1/aggregators/{raast-aggregator-id}/settlements/report-exports"
payload := strings.NewReader("{\n \"settlement_batch_id\": \"sb_6eb80843-eb2b-4df2-b85f-25d50f03d2a1\",\n \"merchant_id\": \"mer_e1a38d10-0064-4d7b-a700-f4ba483efb05\",\n \"kind\": \"REPORT_KIND_BATCH\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-SFPY-AGGREGATOR-SECRET-KEY", "<api-key>")
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.getsafepay.com/raastwire/v1/aggregators/{raast-aggregator-id}/settlements/report-exports")
.header("X-SFPY-AGGREGATOR-SECRET-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"settlement_batch_id\": \"sb_6eb80843-eb2b-4df2-b85f-25d50f03d2a1\",\n \"merchant_id\": \"mer_e1a38d10-0064-4d7b-a700-f4ba483efb05\",\n \"kind\": \"REPORT_KIND_BATCH\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getsafepay.com/raastwire/v1/aggregators/{raast-aggregator-id}/settlements/report-exports")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-SFPY-AGGREGATOR-SECRET-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"settlement_batch_id\": \"sb_6eb80843-eb2b-4df2-b85f-25d50f03d2a1\",\n \"merchant_id\": \"mer_e1a38d10-0064-4d7b-a700-f4ba483efb05\",\n \"kind\": \"REPORT_KIND_BATCH\"\n}"
response = http.request(request)
puts response.read_body{
"api_version": "v1",
"data": {
"report_export": {
"id": "55",
"token": "rpt_e71265de-6699-4a02-b99b-b985edb9b915",
"settlement_batch_id": "sb_6eb80843-eb2b-4df2-b85f-25d50f03d2a1",
"merchant_id": "",
"kind": "REPORT_KIND_SEED",
"status": "REPORT_STATUS_SEEDED",
"attempts": 1,
"error_message": "",
"s3_key": "",
"record_count": "0",
"file_size": "0",
"started_at": "2026-04-03T11:30:09Z",
"finished_at": null,
"created_at": "2026-04-03T11:30:04Z",
"updated_at": "2026-04-03T11:30:09Z",
"partner_id": "partner_37e414c3-c0cc-4541-9bea-ab5a22964bd8",
"version": 0
}
}
}{
"code": "error.bad_request",
"message": "Invalid request parameters"
}{
"api_version": "v1",
"error": {
"code": "error.unauthorized_access",
"message": "partner access key is required in request header"
}
}{
"api_version": "v1",
"error": {
"code": "error.internal_server_error",
"message": "rpc error code Internal desc = something went wrong"
}
}Settlement Reports
Create Settlement Report Export
Create an asynchronous settlement report export job for a batch or merchant scope.
POST
/
v1
/
aggregators
/
{raast-aggregator-id}
/
settlements
/
report-exports
Create Settlement Report Export
curl --request POST \
--url https://api.getsafepay.com/raastwire/v1/aggregators/{raast-aggregator-id}/settlements/report-exports \
--header 'Content-Type: application/json' \
--header 'X-SFPY-AGGREGATOR-SECRET-KEY: <api-key>' \
--data '
{
"settlement_batch_id": "sb_6eb80843-eb2b-4df2-b85f-25d50f03d2a1",
"merchant_id": "mer_e1a38d10-0064-4d7b-a700-f4ba483efb05",
"kind": "REPORT_KIND_BATCH"
}
'import requests
url = "https://api.getsafepay.com/raastwire/v1/aggregators/{raast-aggregator-id}/settlements/report-exports"
payload = {
"settlement_batch_id": "sb_6eb80843-eb2b-4df2-b85f-25d50f03d2a1",
"merchant_id": "mer_e1a38d10-0064-4d7b-a700-f4ba483efb05",
"kind": "REPORT_KIND_BATCH"
}
headers = {
"X-SFPY-AGGREGATOR-SECRET-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-SFPY-AGGREGATOR-SECRET-KEY': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
settlement_batch_id: 'sb_6eb80843-eb2b-4df2-b85f-25d50f03d2a1',
merchant_id: 'mer_e1a38d10-0064-4d7b-a700-f4ba483efb05',
kind: 'REPORT_KIND_BATCH'
})
};
fetch('https://api.getsafepay.com/raastwire/v1/aggregators/{raast-aggregator-id}/settlements/report-exports', 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.getsafepay.com/raastwire/v1/aggregators/{raast-aggregator-id}/settlements/report-exports",
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([
'settlement_batch_id' => 'sb_6eb80843-eb2b-4df2-b85f-25d50f03d2a1',
'merchant_id' => 'mer_e1a38d10-0064-4d7b-a700-f4ba483efb05',
'kind' => 'REPORT_KIND_BATCH'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-SFPY-AGGREGATOR-SECRET-KEY: <api-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.getsafepay.com/raastwire/v1/aggregators/{raast-aggregator-id}/settlements/report-exports"
payload := strings.NewReader("{\n \"settlement_batch_id\": \"sb_6eb80843-eb2b-4df2-b85f-25d50f03d2a1\",\n \"merchant_id\": \"mer_e1a38d10-0064-4d7b-a700-f4ba483efb05\",\n \"kind\": \"REPORT_KIND_BATCH\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-SFPY-AGGREGATOR-SECRET-KEY", "<api-key>")
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.getsafepay.com/raastwire/v1/aggregators/{raast-aggregator-id}/settlements/report-exports")
.header("X-SFPY-AGGREGATOR-SECRET-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"settlement_batch_id\": \"sb_6eb80843-eb2b-4df2-b85f-25d50f03d2a1\",\n \"merchant_id\": \"mer_e1a38d10-0064-4d7b-a700-f4ba483efb05\",\n \"kind\": \"REPORT_KIND_BATCH\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getsafepay.com/raastwire/v1/aggregators/{raast-aggregator-id}/settlements/report-exports")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-SFPY-AGGREGATOR-SECRET-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"settlement_batch_id\": \"sb_6eb80843-eb2b-4df2-b85f-25d50f03d2a1\",\n \"merchant_id\": \"mer_e1a38d10-0064-4d7b-a700-f4ba483efb05\",\n \"kind\": \"REPORT_KIND_BATCH\"\n}"
response = http.request(request)
puts response.read_body{
"api_version": "v1",
"data": {
"report_export": {
"id": "55",
"token": "rpt_e71265de-6699-4a02-b99b-b985edb9b915",
"settlement_batch_id": "sb_6eb80843-eb2b-4df2-b85f-25d50f03d2a1",
"merchant_id": "",
"kind": "REPORT_KIND_SEED",
"status": "REPORT_STATUS_SEEDED",
"attempts": 1,
"error_message": "",
"s3_key": "",
"record_count": "0",
"file_size": "0",
"started_at": "2026-04-03T11:30:09Z",
"finished_at": null,
"created_at": "2026-04-03T11:30:04Z",
"updated_at": "2026-04-03T11:30:09Z",
"partner_id": "partner_37e414c3-c0cc-4541-9bea-ab5a22964bd8",
"version": 0
}
}
}{
"code": "error.bad_request",
"message": "Invalid request parameters"
}{
"api_version": "v1",
"error": {
"code": "error.unauthorized_access",
"message": "partner access key is required in request header"
}
}{
"api_version": "v1",
"error": {
"code": "error.internal_server_error",
"message": "rpc error code Internal desc = something went wrong"
}
}Authorizations
Path Parameters
Aggregator identifier that owns the settlement report exports.
Example:
"agg_b49985f2-e099-412e-8eb2-98756059cc0d"
Body
application/json
Request body to create a settlement report export job.
Settlement batch identifier to export.
Example:
"sb_6eb80843-eb2b-4df2-b85f-25d50f03d2a1"
Export scope kind.
Available options:
REPORT_KIND_BATCH, REPORT_KIND_MERCHANT Example:
"REPORT_KIND_BATCH"
Optional merchant identifier for merchant-level report exports type REPORT_KIND_MERCHANT. Empty if the report exports are of type REPORT_KIND_BATCH.
Example:
"mer_e1a38d10-0064-4d7b-a700-f4ba483efb05"
Was this page helpful?
⌘I