Transaction Query

Transaction Query searches the gateway transaction history and returns a list of transactions matching the filters you provide. Use it for specific transaction lookups (looking up a single payment by reference or card), batch reports over a date range, or settlement reconciliation reports.

This page covers transaction-level queries. For deposit-level queries, see Deposit Query.

When to Use Transaction Query

GoalApproach
Look up a specific transactionQuery by REFNUM, AUTHNUM, or INV
Find transactions for a specific cardQuery by LAST4
Pull all transactions in a date rangeQuery with STARTDATE and ENDDATE
Retrieve batch settlement recordsQuery with SETT=Y
Get declined transactions onlyQuery with APPR=N

All queries use TYPE=Q, SUBTYPE=T.

Filters

All filter parameters are optional. Combine them to narrow the result set. When no filters are provided, the gateway returns the most recent approved transactions.

ParameterDescription
REFNUMMatch transactions with this reference number
INVMatch transactions with this invoice number
AUTHNUMMatch transactions with this authorization number
LAST4Match transactions where the card number ends in these 4 digits
AMTMatch transactions with this exact amount
STARTDATEStart of date range (inclusive)
ENDDATEEnd of date range (inclusive)
APPRY for approved only (default), N for declined only
SETTY to query settlement records instead of regular transactions. When set, transaction-specific filters (REFNUM, LAST4, AMT, INV, AUTHNUM) are ignored.

For field formats (date format, amount precision, character limits), see the API Reference.

Pagination

Transaction Query returns 10 records per call, ordered by date/time (newest first). To retrieve more, include a SKIP parameter to offset the results.

  • First call: SKIP=0 (or omit) — returns records 1-10
  • Second call: SKIP=10 — returns records 11-20
  • Third call: SKIP=20 — returns records 21-30, and so on

Continue paging until the response returns fewer than 10 records or a CODE=8340 (no records).

Example: Look Up a Transaction by Reference

curl --request POST --url {gateway_endpoint}/ \
  --header 'Content-Type: application/json' \
  --data '{
    "TERMID":  "your_termid",
    "PASS":    "your_pass",
    "TYPE":    "Q",
    "SUBTYPE": "T",
    "REFNUM":  "reg-20260411-045",
    "JSON":    "Y"
  }'

Example: Date Range Report

curl --request POST --url {gateway_endpoint}/ \
  --header 'Content-Type: application/json' \
  --data '{
    "TERMID":    "your_termid",
    "PASS":      "your_pass",
    "TYPE":      "Q",
    "SUBTYPE":   "T",
    "STARTDATE": "20260401",
    "ENDDATE":   "20260412",
    "JSON":      "Y"
  }'

To page through a large date range, include SKIP:

{
  "TERMID":    "your_termid",
  "PASS":      "your_pass",
  "TYPE":      "Q",
  "SUBTYPE":   "T",
  "STARTDATE": "20260401",
  "ENDDATE":   "20260412",
  "SKIP":      "10",
  "JSON":      "Y"
}

Example: Find All Transactions for a Card

Useful when a cardholder contacts you about a transaction and you don't have the reference number.

curl --request POST --url {gateway_endpoint}/ \
  --header 'Content-Type: application/json' \
  --data '{
    "TERMID":    "your_termid",
    "PASS":      "your_pass",
    "TYPE":      "Q",
    "SUBTYPE":   "T",
    "LAST4":     "1111",
    "STARTDATE": "20260301",
    "JSON":      "Y"
  }'

Example: Settlement Report

Include SETT=Y to retrieve settlement (batch close) records rather than individual transactions.

curl --request POST --url {gateway_endpoint}/ \
  --header 'Content-Type: application/json' \
  --data '{
    "TERMID":    "your_termid",
    "PASS":      "your_pass",
    "TYPE":      "Q",
    "SUBTYPE":   "T",
    "SETT":      "Y",
    "STARTDATE": "20260401",
    "ENDDATE":   "20260412",
    "JSON":      "Y"
  }'

Example Response

{
  "CODE": "0000",
  "TEXT": "OK",
  "RESULT": [
    {
      "DATETIME": "2026-04-11 14:24:17",
      "TYPE":     "SALE",
      "APPROVED": "Y",
      "CARDTYPE": "V",
      "CARDMASK": "************1111",
      "AMOUNT":   "125.00",
      "REFNUM":   "reg-20260411-045",
      "INVOICE":  "AW123456",
      "AUTHNUM":  "123456",
      "RESPONSE": "APPROVED",
      "GATEREF":  "20260411-000182",
      "MERCHID":  "M12345",
      "TERMID":   "your_termid"
    },
    /* up to 9 more records */
  ],
  "DATE": "20260412",
  "TIME": "14:25:10",
  "DUR":  "0.218"
}

Response fields per transaction

FieldDescription
DATETIMEDate and time the transaction was processed
TYPETransaction type — SALE, RETN (refund), XFER (transfer), XREV (transfer reversal), POST (force post), PRCO (pre-auth completion), SETT (settlement)
APPROVEDY for approved, N for declined
CARDTYPECard type code (V Visa, M Mastercard, A Amex, D Discover)
CARDMASKPCI-safe masked card number
AMOUNTTransaction amount
REFNUMReference number
INVOICEInvoice number
AUTHNUMAuthorization number
RESPONSEHuman-readable response text
GATEREFGlobally unique gateway reference
MERCHIDMerchant identifier
TERMIDTerminal identifier

No Records

If no transactions match your filters, the response returns CODE=8340 with TEXT=NO RECORDS and no RESULT array. Treat this as a normal empty result, not an error.

Tips

  • Most transactions return in the default 10-per-page window — pagination matters for broad date-range reports but rarely for targeted lookups.
  • Combine filters for speed. A query by REFNUM alone is very fast. Date ranges without other filters can return thousands of rows and require paging.
  • Use GATEREF from Transaction Query to cross-reference with Deposit Query — it's the common key between the two.
  • APPR=N returns only declined transactions. Most reconciliation jobs want approved only (the default).

API Reference

For the full parameter and response field catalog, see the Transaction Query API Reference.