Skip to Content
Docs

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 wantUse
Each transaction and change as it happensWebhooks
The transactions in a time window, or the ones that match a filterBulk queries, on this page
One file a day, for your finance team or data warehouseDaily reports
Cleared transactions with their fees, by settlement or clearing dayReconcile 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:

ListEndpointOther filters
ChargesGET /v1/chargescustomer_reference_id, id, currency, created, amount and amount.*, payment_method_details.card.bin and .last_four_digits, underlying_network_details.auth_code and .arn
HoldsGET /v1/holdscustomer_reference_id, status
RefundsGET /v1/refundscustomer_reference_id
PayoutsGET /v1/payoutscustomer_reference_id
Cash flow transactionsGET /v1/cashflow/transactionscustomer_reference_id, settlement_id
Payment sessionsGET /v1/sessions/paymentcustomer_reference_id
DisputesGET /v1/disputesNone
Fraud warningsGET /v1/fraud_warningscustomer_reference_id
SettlementsGET /v1/settlementsNone

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.data is empty, amount_refunded is 0, and refunded is false. No retry attempts. Captures of holds are listed as charges.
  • Holds: no captures in charges.data, and no retry attempts.
  • Disputes: reason_code, arn, and processor_dispute_id are null, 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:

LimitWhat happensWhat to do
One query at a timeA 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 sizelimit is at most 100.Page through with starting_after.
Repeated queriesPay.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 offOn 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:

  1. Back-fill with a list for each past window, such as one day at a time.
  2. Add a webhook endpoint for the events that change your objects, such as charge.refunded, charge.updated, the dispute.* events, and cashflow_transaction.created. See Reporting webhooks.
  3. 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

Was this page helpful?