Skip to Content
Docs

Pagination and filtering

List charges, refunds, disputes, and other resources, filter them, and read every page.

Pay.com supports bulk requests of certain resources. You query these resources by sending a GET request to each resource's endpoint. Each request accepts query parameters to filter and paginate the search results. The endpoints below use cursor-based pagination. Four additional endpoints use page-number pagination.

Results filtering

All bulk endpoints accept the created.* date filters and cursor pagination. customer_reference_id filters charges, holds, refunds, payouts, payment sessions, fraud warnings, and cash flow transactions. Disputes reject it with 400. Some endpoints add their own filters, for example status on holds and settlement_id on cash flow transactions. See each endpoint's reference page for its full list. See Pagination for result limits.

Filter the results based on the creation date, using the created query parameter with comparison operators.

ParameterDescription
created.greater_thanReturns results created after the specified date
created.greater_than_or_equalsReturns results created on or after the specified date
created.less_thanReturns results created before the specified date
created.less_than_or_equalsReturns results created on or before the specified date

greater_than and greater_than_or_equals are mutually exclusive, as are less_than and less_than_or_equals.

Example

This request returns refunds created in January 2025.

curl -X GET \
  'https://api.sandbox.pay.com/v1/refunds?created.greater_than_or_equals=2025-01-01&created.less_than=2025-02-01' \
  -u ':sk-pay-com-sandbox-…'

Pagination

Bulk endpoints use cursor-based pagination and return results oldest first. Each response includes a has_more field that tells you whether more results exist beyond the current page.

ParameterTypeDescription
limitintegerMaximum number of results to return. Default: 10, maximum: 100.
starting_afterstringReturns results created after the given resource ID. Use the ID of the last object from the previous page to fetch the next page. The ID must be of the resource you are listing (for example, rfnd_… for refunds), or the request returns 400.
ending_beforestringReturns results created before the given resource ID. Use this to paginate backwards.

starting_after and ending_before are mutually exclusive. You can't use both in the same request.

Cursor-based pagination is stable under concurrent writes. Unlike offset-based pagination, adding or removing records between requests won't cause you to skip or duplicate results.

Run one bulk query at a time. A query while another one for the same merchant is running returns 429 with code: request_in_progress and a Retry-After header. The same query within 10 minutes returns the same page. On accounts where Pay.com turns off bulk queries, the charges, holds, refunds, payouts, and cash flow transactions lists return 403. See Bulk queries.

Paginate through results

To retrieve all results, repeat requests using starting_after until has_more is false.

curl -X GET 'https://api.sandbox.pay.com/v1/refunds?limit=25' \
  -u ':sk-pay-com-sandbox-…'

To fetch the next page, pass the last object's ID as starting_after:

curl -X GET 'https://api.sandbox.pay.com/v1/refunds?limit=25&starting_after=rfnd_685125114794084399' \
  -u ':sk-pay-com-sandbox-…'

Continue until has_more is false.

Lists that use page numbers

These lists take page and limit in place of cursors, and their own filters. They don't accept starting_after or ending_before.

ResourceEndpointFilters
AdjustmentsGET /v1/adjustmentssettlement_id
Value listsGET /v1/value_listsfrom_date, to_date
Card blacklistGET /v1/value_lists/card_blacklistNone
Reconciliation transactionsGET /v1/reconciliation/transactionssettlement_id, date, from_date, to_date

page starts at 1. limit defaults to 10, and you can set it up to 100. Each response has page, total_pages, total_records, and last_page, which is true on the last page.

Response structure

All bulk endpoints return a consistent response shape. Amounts are integers in the minor currency unit (the smallest unit), for example 10000 for $100.00.

FieldTypeDescription
resourcestringThe type of resource returned, for example "refunds" or "payouts".
has_morebooleantrue if more results exist beyond this page.
dataarrayThe list of resource objects.
{
  "resource": "refunds",
  "has_more": true,
  "data": [
    {
      "id": "rfnd_296645958265997314",
      "resource": "refund",
      "amount": 10000,
      "amount_human_readable": "100.00",
      "charge": "chrg_296645958265997312",
      "created": "2025-01-15T10:30:00Z",
      "currency": "usd",
      "status": "succeeded"
    },
    {
      "id": "rfnd_296645958265997422",
      "resource": "refund",
      "amount": 5000,
      "amount_human_readable": "50.00",
      "charge": "chrg_296645958265997418",
      "created": "2025-01-16T14:22:00Z",
      "currency": "usd",
      "status": "succeeded"
    }
  ]
}
Was this page helpful?