Safepay list endpoints use limit and offset query parameters. Many responses include a count field and an array of resources inside data.
Query parameters
| Parameter | Description | Example |
|---|
limit | Max records to return in a page. | limit=10 |
offset | Number of records to skip before returning results. | offset=0 |
Parameter types vary between endpoints (string or integer). Follow the OpenAPI schema for each endpoint.
Example: list payments
curl --request GET "{{base_url}}/v1/aggregators/{{aggregator_id}}/payments?limit=10&offset=0" \
--header "X-SFPY-AGGREGATOR-SECRET-KEY: {{secret_key}}"
const baseUrl = '{{base_url}}';
const aggregatorId = '{{aggregator_id}}';
const secretKey = '{{secret_key}}';
const res = await fetch(
`${baseUrl}/v1/aggregators/${aggregatorId}/payments?limit=10&offset=0`,
{
headers: {
'X-SFPY-AGGREGATOR-SECRET-KEY': secretKey,
},
},
);
if (!res.ok) {
throw new Error(`Payment list failed: ${res.status}`);
}
const payload = await res.json();
console.log('Total payments', payload.data.count);
Response shape
List responses return a data object containing count and a list for the resource type. Examples include payments, keys, refunds, and qrs.
{
"api_version": "v1",
"data": {
"count": "605",
"payments": []
}
}
See also