A Query request is used to obtain the transaction history of a specific orderID with the specified date range.
Transaction Administration - Query Transaction
Overview
The Query Transaction operation allows retrieval of transaction payment and settlement data from the system. It supports filtering by date range, transaction type, result status, and additional metadata fields.
Request Parameters
| Variable | Requirement | Type | Max Size | Possible Values / Example | Description | Notes |
|---|---|---|---|---|---|---|
publisher-name |
Mandatory | string | N/A | Example: gatewayuser |
Gateway account username issued to you. | |
publisher-password |
Mandatory | string | N/A | Example: securepassword |
Remote Client Password used for API authentication. | This differs from the administrative login password. |
mode |
Mandatory | string | N/A | query_trans |
Specifies transaction query operation. | Must be set to query_trans. |
orderID |
Optional | string | 20 | Example: 1234567890 |
Transaction identifier used for similar/single lookups. | Optional filter for looking up a specific transaction. |
startdate |
Mandatory | string | 8 | 20240101 |
Start date for transaction search. | Format: YYYYMMDD. |
enddate |
Optional | string | 8 | 20240131 |
End date for transaction search. | Format: YYYYMMDD. |
accttype |
Optional | string | 8 | checking, savings |
Filters results by account type. | Defaults to all account types if omitted. |
operation |
Optional | string | N/A | auth, postauth, forceauth, return, void, chargeback, storedata |
Filters results by transaction operation type. | Defaults to all operations. |
result |
Optional | string | N/A | success, pending, badcard, problem |
Filters results by transaction status. | Defaults to all results if omitted. |
notify-email |
Optional | string | 39 | user@example.com |
Email address for query-related alerts. | Used for error notifications. |
gresp |
Optional | string | N/A | simple |
Returns abbreviated result format. | Reduces response payload size. |
ordersummary |
Optional | integer | 1 | 1 |
Includes order-level summary data. | Requires full order data to have been stored at authorization time. |
orderdetails |
Optional | integer | 1 | 1 |
Includes itemized product-level details. | Requires full itemized order data to be available. |
batchid |
Optional | string | N/A | Example: 1234567890 |
Settlement batch identifier. | Filters results to transactions in the specified batch. When used, related batchtotal_* aggregates may be returned. |
auth-code |
Optional | string | 6 | A1B2C3 |
Processor authorization code to search for. | 6 characters; A–Z and 0–9 only. |
acct_code |
Optional | string | 20 | ABC123 |
Custom reporting/grouping field. | Exact match on a single account code value. |
acct_code2 |
Optional | string | 20 | ABC123 |
Additional custom grouping field. | Exact match on a single account code value. |
acct_code3 |
Optional | string | 20 | ABC123 |
Additional custom grouping field. | Exact match on a single account code value. |
qacct_code |
Optional | string | N/A | ABC123,DEF456 |
One or more acct_code values to match. |
Comma-separated list. Matches transactions with any listed account code. |
qacct_code2 |
Optional | string | N/A | ABC123,DEF456 |
One or more acct_code2 values to match. |
Same usage as qacct_code, applied to acct_code2. |
qacct_code3 |
Optional | string | N/A | ABC123,DEF456 |
One or more acct_code3 values to match. |
Same usage as qacct_code, applied to acct_code3. |
Response Parameters
| Variable | Value | Description | Notes |
|---|---|---|---|
FinalStatus |
success, problem |
Indicates whether the query succeeded. | |
success |
yes, no |
Indicates overall request success. | |
Mstatus |
success, problem |
Legacy status field. | Deprecated in favor of FinalStatus. |
MErrMsg |
string | Error message returned on failure. | Example: no records found. |
Transaction Record Response (axxxx)
Each transaction record is returned as a URL-encoded string in a dynamically numbered field.
| Variable | Value | Description | Notes |
|---|---|---|---|
axxxx |
00001–99999 indexed record |
Encoded transaction data payload. | Field order is not fixed. |
Example format:
trans_date=data&
operation=data&
FinalStatus=data&
card-amount=data&
card-name=data&
card-address1=data&
card-city=data&
card-state=data&
card-zip=data&
card-country=data&
card-number=data&
card-exp=data&
result=data&
MErrMsg=data&
acct_code=data&
acct_code2=data&
acct_code3=data&
acct_code4=data&
auth-code=data&
avs-code=data
Aggregate Response Fields
| Variable | Value | Description | Notes |
|---|---|---|---|
opertotal_xxxxx |
numeric total | Sum of all transactions for a given operation type. | Example values include auth, postauth, return, void. |
batchtotal_xxxxx |
numeric total | Total amount for a specific batch ID. | Requires batch query mode; includes adjustments for postauths and returns. |
datetotal_YYYYMMDD |
numeric total | Total amount grouped by transaction date. | Similar to batch totals but grouped by date. |
Notes
- When performing batch settlement analysis, fields such as
batchtotal_xxxxxxanddatetotal_YYYYMMDDare dynamically generated. Parsing requires scanning response keys for matching patterns. - For single transaction lookups, using
orderIDis strongly recommended for optimal performance. - The
ordersummaryandorderdetailsparameters require that full order data was originally submitted during authorization. - Use
qacct_code,qacct_code2, orqacct_code3when filtering by multiple account codes at once; useacct_code,acct_code2, oracct_code3for a single exact value.