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
| Goal | Approach |
|---|---|
| Look up a specific transaction | Query by REFNUM, AUTHNUM, or INV |
| Find transactions for a specific card | Query by LAST4 |
| Pull all transactions in a date range | Query with STARTDATE and ENDDATE |
| Retrieve batch settlement records | Query with SETT=Y |
| Get declined transactions only | Query 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.
| Parameter | Description |
|---|---|
REFNUM | Match transactions with this reference number |
INV | Match transactions with this invoice number |
AUTHNUM | Match transactions with this authorization number |
LAST4 | Match transactions where the card number ends in these 4 digits |
AMT | Match transactions with this exact amount |
STARTDATE | Start of date range (inclusive) |
ENDDATE | End of date range (inclusive) |
APPR | Y for approved only (default), N for declined only |
SETT | Y 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
| Field | Description |
|---|---|
DATETIME | Date and time the transaction was processed |
TYPE | Transaction type — SALE, RETN (refund), XFER (transfer), XREV (transfer reversal), POST (force post), PRCO (pre-auth completion), SETT (settlement) |
APPROVED | Y for approved, N for declined |
CARDTYPE | Card type code (V Visa, M Mastercard, A Amex, D Discover) |
CARDMASK | PCI-safe masked card number |
AMOUNT | Transaction amount |
REFNUM | Reference number |
INVOICE | Invoice number |
AUTHNUM | Authorization number |
RESPONSE | Human-readable response text |
GATEREF | Globally unique gateway reference |
MERCHID | Merchant identifier |
TERMID | Terminal 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
REFNUMalone is very fast. Date ranges without other filters can return thousands of rows and require paging. - Use
GATEREFfrom Transaction Query to cross-reference with Deposit Query — it's the common key between the two. APPR=Nreturns 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.
Updated 13 days ago
