Transaction Queries

The transaction query request allows the registration platform to search the gateway transaction history and retrieve a list of transactions according to a set of filters.

All transaction query message requests require specific fields so they can be validated by the InterPay™ gateway and used to search the appropriate merchant account.

There are two options for querying:

  • Using at least one of the optional fields to select the applicable transactions, or
  • Requesting batch settlement reports with option to add a date range.

Option 1: Query using the required fields plus at least one of the optional fields:

Required
Request Field
Description
N
TERMID
8 character terminal ID assigned by SportsPay (this must be the first field)
N
TYPE
Q for all queries
N
SUBTYPE
T for transaction queries
N
PASS
Password for the TERMID
INV
All transactions tagged with a specific invoice number
REF
The unique REFNUM of a transaction
LAST4
The last 4 digits of the card number
AMT
The amount with cents (e.g. 2.00)
AUTH
The authorization number
APPR
Y for approved, N for not approved
SKIP
Number of transactions to skip

Option 2: Query using the required fields plus the below:

Required
Request Field
Description
N
TERMID
8 character terminal ID assigned by SportsPay (this must be the first field)
N
TYPE
Q for all queries
N
SUBTYPE
T for transaction queries
N
PASS
Password for the TERMID
N
SETT
Report batch settlements
STARTDATE
Starting date in YYYYMMDD format as of 00:00:01
ENDDATE
Ending date in YYYYMMDD format up to 23:59:59
SKIP
Number of transactions to skip
s

You should limit the number of SKIPs

Query Response Fields

All responses will include the following fields:

Data Field
Description
Description
CODE
0000 indicates success, 8340 indicates no records found, and any other four digit code indicates an error
0000 indicates success, 8340 indicates no records found, and any other four digit code indicates an error
TEXT
OK, NO RECORDS or description of the error
OK, NO RECORDS or description of the error
REFNUM
A list of the returned transactions.

Each transaction in the list is delimited by [ and ] and contains the following fields:

A list of the returned transactions.

Each transaction in the list is delimited by [ and ] and contains the following fields:

REFNUM
DATE TIME
Gateway date and time of the transaction in YYYYMMDDhhmmss format
REFNUM
TYPE
Transaction type (Refer to Transaction Type list)
REFNUM
APPROVED
Y for approved, N for not approved
REFNUM
CARDTYPE
Type of card used:
V – Visa
M – Mastercard
A – Amex
D – Debit
REFNUM
CARDMASK
Masked card number of the card
REFNUM
AMOUNT
Amount of transaction
REFNUM
REFNUM
Reference number of transaction
REFNUM
INVOICE
Invoice number tagged to transaction
REFNUM
AUTHNUM
Authorization number
REFNUM
RESPONSE
Text of the transaction response
ECHO
If included in the request
If included in the request
DATE TIME
Gateway date and time of the transaction
Gateway date and time of the transaction
DUR
Amount of time the gateway spent processing the request
Amount of time the gateway spent processing the request
p

All returned transactions are sorted in reverse Date/Time order (newest first)

Example

Request:
TERMID=TESTTERM&PASS=mypass&TYPE=Q&SUBTYPE=T&LAST4=6781TEXT=OK&CODE=0000&RESULT[DATETIME=20120131163339&TYPE=PREA&APPROVED=Y&CARDTYPE=VISA&CARDMASK=****6781&AMOUNT=45.56&REFNUM=3245897625342&INVOICE&AUTHNUM=T63339&RESPONSE=T63339$45.56]
Response:
[DATETIME=20120131155621&TYPE=PREA&APPROVED=N&CARDTYPE=VISA&CARDMASK=****6781&AMOUNT=45.56&REFNUM=3245897625342860&INVOICE&AUTHNUM&RESPONSE=DUPLICATEREF]&DATE=2020‑10‑09&TIME=14:11:08&DUR=0.399