Bulk queries
List your charges, refunds, payouts, and other transactions page by page, find transactions by card or network data, and keep a copy in sync.
The list endpoints return your transactions in pages, oldest first. Use them to back-fill a data store, to find transactions, and to check your copy against Pay.com's.
Choose a source
Bulk queries are one of four ways to get your transaction data.
| You want | Use |
|---|---|
| Each transaction and change as it happens | Webhooks |
| The transactions in a time window, or the ones that match a filter | Bulk queries, on this page |
| One file a day, for your finance team or data warehouse | Daily reports |
| Cleared transactions with their fees, by settlement or clearing day | Reconcile transactions |
List endpoints
Every list takes the created.* filters, limit, and the cursors
starting_after and ending_before. These lists also take their own filters:
| List | Endpoint | Other filters |
|---|---|---|
| Charges | GET /v1/charges | customer_reference_id, id, currency, created, amount and amount.*, payment_method_details.card.bin and .last_four_digits, underlying_network_details.auth_code and .arn |
| Holds | GET /v1/holds | customer_reference_id, status |
| Refunds | GET /v1/refunds | customer_reference_id |
| Payouts | GET /v1/payouts | customer_reference_id |
| Cash flow transactions | GET /v1/cashflow/transactions | customer_reference_id, settlement_id |
| Payment sessions | GET /v1/sessions/payment | customer_reference_id |
| Disputes | GET /v1/disputes | None |
| Fraud warnings | GET /v1/fraud_warnings | customer_reference_id |
| Settlements | GET /v1/settlements | None |
Each filter matches the whole value. See Pagination and filtering for the filters, and for the lists that use page numbers.
What a list returns
A list returns each object as it stands when you query it, in a shorter form than a retrieve by ID:
- Charges: no refunds, so
refunds.datais empty,amount_refundedis0, andrefundedisfalse. No retry attempts. Captures of holds are listed as charges. - Holds: no captures in
charges.data, and no retry attempts. - Disputes:
reason_code,arn, andprocessor_dispute_idarenull, and there's no evidence.
Retrieve an object by its ID for its full details, for example with
GET /v1/charges/{charge_id}.
Page through a list
Pass the last ID of a page as starting_after to get the next page, and stop
when has_more is false. limit is 10 by default, and up to 100.
This function lists every charge created in a time window, and waits after a
429:
const BASE_URL = 'https://api.sandbox.pay.com/v1';
// Basic auth: an empty username, then ":", then the key, in base64.
const AUTH = `Basic ${Buffer.from(`:${process.env.PAY_COM_API_KEY}`).toString('base64')}`;
async function listCharges(from, to) {
const charges = [];
let startingAfter;
for (;;) {
const params = new URLSearchParams({
'created.greater_than_or_equals': from,
'created.less_than': to,
limit: '100',
});
if (startingAfter) params.set('starting_after', startingAfter);
const response = await fetch(`${BASE_URL}/charges?${params}`, {
headers: { Authorization: AUTH },
});
if (response.status === 429) {
// Another list query is running. Wait, then ask for the same page again.
const seconds = Number(response.headers.get('retry-after') ?? 1);
await new Promise((resolve) => setTimeout(resolve, seconds * 1000));
continue;
}
if (!response.ok) throw new Error(`GET /v1/charges returned ${response.status}`);
const page = await response.json();
charges.push(...page.data);
if (!page.has_more) return charges;
startingAfter = page.data.at(-1).id;
}
}
const charges = await listCharges('2026-03-06T00:00:00Z', '2026-03-07T00:00:00Z');Limits
Bulk queries have these limits:
| Limit | What happens | What to do |
|---|---|---|
| One query at a time | A list request while another list request for the same merchant is running returns 429 with code: request_in_progress and Retry-After: 1. The limit covers every list endpoint above, together. | Request pages one after another. After a 429, wait the Retry-After seconds and send the request again. |
| Page size | limit is at most 100. | Page through with starting_after. |
| Repeated queries | Pay.com keeps the response to a list query for 10 minutes. The same query in that time returns the same page, even if new transactions arrived. An identical query sent while the first is still running can return 408. | Query a time window after it has ended. To read new transactions, change the window or the cursor. |
| Turned off | On some accounts, Pay.com turns off bulk queries on charges, holds, refunds, payouts, and cash flow transactions. These lists then return 403 with the message Bulk queries are disabled. | Use webhooks and daily reports, or contact your Pay.com account team. |
Keep a copy in sync
Objects change after they're created. A charge gets refunds, disputes, and its
ARN at clearing, and a list by created shows those changes only when you
query that window again. To keep a copy current:
- Back-fill with a list for each past window, such as one day at a time.
- Add a webhook endpoint for the events that change your objects, such as
charge.refunded,charge.updated, thedispute.*events, andcashflow_transaction.created. See Reporting webhooks. - Each day, list the previous day's window and compare it with your copy, to catch an event your endpoint missed.
Find a transaction
Filter charges by what you have, for example the card's BIN and last four digits from a customer's email:
curl -G https://api.sandbox.pay.com/v1/charges \
-u ":$PAY_COM_API_KEY" \
--data-urlencode 'payment_method_details.card.bin=424242' \
--data-urlencode 'payment_method_details.card.last_four_digits=4242' \
--data-urlencode 'created.greater_than_or_equals=2026-03-01T00:00:00Z'The underlying_network_details.auth_code and underlying_network_details.arn
filters find a charge from the authorization code or ARN on a customer's bank
statement. To find a charge by your own reference, use
GET /v1/charges/reference/{reference_id}.
Next steps
- Pagination and filtering: Every filter, and the lists that use page numbers.
- Read transaction data: The fields on each transaction, and when they're set.
- Reporting webhooks: The events that keep your copy current.