Overview
The Query API enables merchants to retrieve transaction information from the payment gateway. Look up previously processed transactions and obtain detailed information about their status, amounts, and other transaction details.Use the Query API to verify transactions, reconcile accounts, and retrieve transaction history.
API Endpoint
Authentication
All Query API requests require your API Security Key:Generate new security keys from the merchant control panel: Settings > Security Keys
Query Types
- Transaction Query
- Batch Query
- Date Range Query
Look up a specific transaction by ID.Request:Response:
Implementation Examples
Query Parameters
Transaction Query
| Parameter | Description | Required |
|---|---|---|
security_key | Your API security key | Yes |
transaction_id | Transaction ID to query | Yes |
Batch Query
| Parameter | Description | Required |
|---|---|---|
security_key | Your API security key | Yes |
batch_id | Batch ID to query | Yes |
Date Range Query
| Parameter | Description | Required | Format |
|---|---|---|---|
security_key | Your API security key | Yes | String |
start_date | Beginning date | Yes | YYYYMMDD |
end_date | Ending date | Yes | YYYYMMDD |
limit | Max results to return | No | Integer |
offset | Pagination offset | No | Integer |
Response Format
Transaction responses are returned in query string format:& and then on =:
Response Fields
Transaction Information
| Field | Description |
|---|---|
transaction_id | Unique transaction identifier |
transaction_type | Type: sale, auth, capture, void, refund, credit |
condition | Transaction status: complete, pending, failed, unknown |
amount | Transaction amount |
currency | Currency code (USD, etc.) |
processor_id | Processor that handled transaction |
Payment Method
| Field | Description |
|---|---|
cc_number | Masked card number (e.g., 4xxxxxxxxxxx1111) |
cc_exp | Card expiration (MMYY) |
card_type | Card brand: Visa, Mastercard, Amex, Discover |
check_account | Masked account number (for ACH) |
check_aba | Routing number (for ACH) |
account_type | checking or savings |
Customer Information
| Field | Description |
|---|---|
first_name | Customer first name |
last_name | Customer last name |
company | Company name |
address1 | Billing address line 1 |
address2 | Billing address line 2 |
city | City |
state | State |
zip | Postal code |
country | Country code |
phone | Phone number |
email | Email address |
Response Details
| Field | Description |
|---|---|
response | 1=success, 2=decline, 3=error |
responsetext | Response description |
authcode | Authorization code from processor |
avsresponse | AVS response code |
cvvresponse | CVV response code |
orderid | Merchant order ID |
Additional Fields
| Field | Description |
|---|---|
created | Transaction timestamp |
settled | Settlement timestamp |
batch_id | Settlement batch ID |
customer_vault_id | Customer vault ID (if used) |
partial_payment_id | Partial payment ID (if applicable) |
Transaction Status
Thecondition field indicates transaction status:
- complete
- pending
- failed
- unknown
Transaction processed successfully and is settled or pending settlement.Action: No action needed
Batch Queries
Query all transactions in a settlement batch:Date Range Queries
Query transactions within a date range:start_date: Beginning date (YYYYMMDD)end_date: Ending date (YYYYMMDD)limit: Maximum results per request (default: 100, max: 1000)offset: Pagination offset for large result sets
Error Handling
Common query errors:| Error | Description | Resolution |
|---|---|---|
Invalid transaction ID | Transaction not found | Verify transaction ID |
Invalid security key | Authentication failed | Check API key |
Access denied | Transaction belongs to different merchant | Verify merchant account |
Invalid date format | Date format incorrect | Use YYYYMMDD format |
Rate Limiting
The Query API implements rate limiting:- 100 requests per minute per API key
- 10,000 requests per day per merchant account
Use Cases
Transaction Verification
Transaction Verification
Verify transaction status after processing:
Account Reconciliation
Account Reconciliation
Reconcile transactions against your records:
Customer Transaction History
Customer Transaction History
Retrieve customer’s transaction history:
Reporting
Reporting
Generate transaction reports:
Best Practices
Cache Results
Cache query results to reduce API calls and improve performance
Batch Processing
Use batch queries instead of individual transaction queries when possible
Error Handling
Implement robust error handling and retry logic
Rate Limiting
Respect rate limits and implement exponential backoff

