Transaction Query
URL Endpoint: https://easypay5.com/APIcardProcREST/v1.0.0/Query/Transaction
Request Method: POST
Headers:
Session Key is passed to the API via the header:
Content-Type: application/json
Accept: application/json
SessKey: A1842D663E9A4A72XXXXXXXX303541303234373138
Easy Pay provides a variety of ways to search for and query transactions. To view a complete list of options, view the https://easypaysoftware.com/en/Querying Query Guide.
Use this call to search for transactions based on one or more parameters. A collection of transaction objects is returned. Transactions can be searched using several different parameters including the following.
- ID ( TxID ) ( Unique Identifier for the transaction )
- TRANSACTION STATUS ( OPEN , VOID, SETTLED, FAILED )
- DATE CREATED
- CARDHOLDER LAST NAME / FIRST NAME
- BATCH NUMBER ( Settlement group )
- TRANSACTION TYPE ( CCSALE, CCCREDIT , CCAUTHONLY)
- APPROVAL CODE / DECLINE CODE
- AMOUNT
- Reference ID (User defined field which can be searchable)
- RPGUID (Another user defined field which can be searchable)
- Last 4 Digits of the Card
Copied
{
"Query": "(A=-1)&&(B=-1)&&(C>='4/13/2023')&&(C<'4/29/2023')"
}
{
"Transaction_QueryResult": {
"ErrCode": 0,
"ErrMsg": "",
"FunctionOk": true,
"NumRecords": 5,
"RespMsg": "Successfully Returned Transaction Records : 5",
"Transactions": [
{
"ACCT_FIRST_NAME": "Sean",
"ACCT_LAST_NAME": "Wood",
"ACCT_NO": "4788XXXXXXXX8291",
"AMOUNT": 10.0000,
"AVSr": " ",
"AcctHolderID": 3,
"BatchLogID": 0,
"BatchNO": 0,
"BatchStatus": "N",
"CARD_TYPE": "VI",
"CASHBACK": 0.0000,
"CVVr": "",
"CardPresent": true,
"ConsentID": 0,
"CreatedOn": "\/Date(1556079511300-0400)\/",
"Credits": 0.0000,
"EMVPresent": false,
"EMVRecTags": "",
"EXP_DATE": "1028",
"EndCustID": 44,
"Flags": "",
"HAuthorizedAmount": -1.0000,
"ID": 44,
"IsLocked": false,
"IsPartialApproval": false,
"LAST_CHANGED_BY": "vidya_Venkatraman",
"LastChangedOn": "\/Date(1556079511300-0400)\/",
"MerchID": 1,
"Origin": "API",
"PAYMENT_TYPE": "C",
"PartialAuthApproved": -1.0000,
"PreAuthID": 0,
"PrepaidBalance": -1.0000,
"REF_ID": "",
"RPGUID": "a8e2bbfc-e423-4a84-a9e9-2a6e08153368",
"RefTxID": 0,
"SALE_TAX": 0.0000,
"SEQ_NO": 51,
"SERVER": "",
"SURCHARGE": 0.0000,
"TIP": 0.0000,
"TXN_CODE": "092682",
"TXN_DATE": "042419",
"TXN_DATETIME": "\/Date(1556079944000-0400)\/",
"TXN_TIME": "082544",
"TxLOCK": "0",
"TxSTATUS": "OPEN",
"TxType": "CCSALE",
"UserID": 2547
},
{
"ACCT_FIRST_NAME": "Sean",
"ACCT_LAST_NAME": "Wood",
"ACCT_NO": "4788XXXXXXXX8291",
"AMOUNT": 10.0000,
"AVSr": " ",
"AcctHolderID": 3,
"BatchLogID": 0,
"BatchNO": 0,
"BatchStatus": "N",
"CARD_TYPE": "VI",
"CASHBACK": 0.0000,
"CVVr": "",
"CardPresent": true,
"ConsentID": 0,
"CreatedOn": "\/Date(1556079460297-0400)\/",
"Credits": 0.0000,
"EMVPresent": false,
"EMVRecTags": "",
"EXP_DATE": "1028",
"EndCustID": 43,
"Flags": "",
"HAuthorizedAmount": -1.0000,
"ID": 43,
"IsLocked": false,
"IsPartialApproval": false,
"LAST_CHANGED_BY": "vidya_Venkatraman",
"LastChangedOn": "\/Date(1556079460297-0400)\/",
"MerchID": 1,
"Origin": "API",
"PAYMENT_TYPE": "C",
"PartialAuthApproved": -1.0000,
"PreAuthID": 0,
"PrepaidBalance": -1.0000,
"REF_ID": "",
"RPGUID": "bd7f1db8-00fc-457b-84de-32ca85997d40",
"RefTxID": 0,
"SALE_TAX": 0.0000,
"SEQ_NO": 50,
"SERVER": "",
"SURCHARGE": 0.0000,
"TIP": 0.0000,
"TXN_CODE": "092675",
"TXN_DATE": "042419",
"TXN_DATETIME": "\/Date(1556079893000-0400)\/",
"TXN_TIME": "082453",
"TxLOCK": "0",
"TxSTATUS": "OPEN",
"TxType": "CCSALE",
"UserID": 2547
},
{
"ACCT_FIRST_NAME": "Sean",
"ACCT_LAST_NAME": "Wood",
"ACCT_NO": "4788XXXXXXXX8291",
"AMOUNT": 10.0000,
"AVSr": " ",
"AcctHolderID": 3,
"BatchLogID": 0,
"BatchNO": 0,
"BatchStatus": "N",
"CARD_TYPE": "VI",
"CASHBACK": 0.0000,
"CVVr": "",
"CardPresent": true,
"ConsentID": 0,
"CreatedOn": "\/Date(1556079249337-0400)\/",
"Credits": 0.0000,
"EMVPresent": false,
"EMVRecTags": "",
"EXP_DATE": "1028",
"EndCustID": 42,
"Flags": "",
"HAuthorizedAmount": -1.0000,
"ID": 42,
"IsLocked": false,
"IsPartialApproval": false,
"LAST_CHANGED_BY": "vidya_Venkatraman",
"LastChangedOn": "\/Date(1556079249337-0400)\/",
"MerchID": 1,
"Origin": "API",
"PAYMENT_TYPE": "C",
"PartialAuthApproved": -1.0000,
"PreAuthID": 0,
"PrepaidBalance": -1.0000,
"REF_ID": "",
"RPGUID": "e4d9cd81-c210-41fb-a93c-9f38f11426a5",
"RefTxID": 0,
"SALE_TAX": 0.0000,
"SEQ_NO": 49,
"SERVER": "",
"SURCHARGE": 0.0000,
"TIP": 0.0000,
"TXN_CODE": "092650",
"TXN_DATE": "042419",
"TXN_DATETIME": "\/Date(1556079682000-0400)\/",
"TXN_TIME": "082122",
"TxLOCK": "0",
"TxSTATUS": "OPEN",
"TxType": "CCSALE",
"UserID": 2547
},
{
"ACCT_FIRST_NAME": "Sean",
"ACCT_LAST_NAME": "Wood",
"ACCT_NO": "4111XXXXXXXX1111",
"AMOUNT": 10.0000,
"AVSr": "Z",
"AcctHolderID": 1,
"BatchLogID": 0,
"BatchNO": 0,
"BatchStatus": "N",
"CARD_TYPE": "VI",
"CASHBACK": 0.0000,
"CVVr": "N",
"CardPresent": false,
"ConsentID": 0,
"CreatedOn": "\/Date(1555525026500-0400)\/",
"Credits": 0.0000,
"EMVPresent": false,
"EMVRecTags": "",
"EXP_DATE": "1028",
"EndCustID": 41,
"Flags": "",
"HAuthorizedAmount": -1.0000,
"ID": 41,
"IsLocked": false,
"IsPartialApproval": false,
"LAST_CHANGED_BY": "vidya_Venkatraman",
"LastChangedOn": "\/Date(1555525026500-0400)\/",
"MerchID": 1,
"Origin": "API",
"PAYMENT_TYPE": "C",
"PartialAuthApproved": -1.0000,
"PreAuthID": 0,
"PrepaidBalance": -1.0000,
"REF_ID": "",
"RPGUID": "a10af478-f868-4185-afc5-c64fdcb170da",
"RefTxID": 0,
"SALE_TAX": 0.0000,
"SEQ_NO": 48,
"SERVER": "",
"SURCHARGE": 0.0000,
"TIP": 0.0000,
"TXN_CODE": "099804",
"TXN_DATE": "041719",
"TXN_DATETIME": "\/Date(1555525467000-0400)\/",
"TXN_TIME": "222427",
"TxLOCK": "0",
"TxSTATUS": "OPEN",
"TxType": "CCSALE",
"UserID": 2547
},
{
"ACCT_FIRST_NAME": "",
"ACCT_LAST_NAME": "Doe",
"ACCT_NO": "4111XXXXXXXX1111",
"AMOUNT": 10.0000,
"AVSr": "A",
"AcctHolderID": 1,
"BatchLogID": 0,
"BatchNO": 0,
"BatchStatus": "N",
"CARD_TYPE": "VI",
"CASHBACK": 0.0000,
"CVVr": "N",
"CardPresent": false,
"ConsentID": 0,
"CreatedOn": "\/Date(1555475913250-0400)\/",
"Credits": 0.0000,
"EMVPresent": false,
"EMVRecTags": "",
"EXP_DATE": "1028",
"EndCustID": 40,
"Flags": "",
"HAuthorizedAmount": -1.0000,
"ID": 40,
"IsLocked": false,
"IsPartialApproval": false,
"LAST_CHANGED_BY": "vidya_Venkatraman",
"LastChangedOn": "\/Date(1555475913250-0400)\/",
"MerchID": 1,
"Origin": "API",
"PAYMENT_TYPE": "C",
"PartialAuthApproved": -1.0000,
"PreAuthID": 0,
"PrepaidBalance": -1.0000,
"REF_ID": "A18403849",
"RPGUID": "",
"RefTxID": 0,
"SALE_TAX": 0.0000,
"SEQ_NO": 47,
"SERVER": "",
"SURCHARGE": 0.0000,
"TIP": 0.0000,
"TXN_CODE": "096179",
"TXN_DATE": "041719",
"TXN_DATETIME": "\/Date(1555476354000-0400)\/",
"TXN_TIME": "084554",
"TxLOCK": "0",
"TxSTATUS": "OPEN",
"TxType": "CCSALE",
"UserID": 2547
}
]
}
}
Copied
private void RESTTransactionQuery(string SessKey, string Query) {
/// return all records from merchant record 1 which were created in JUNE and are SETTLED.
Query = "(A=1)&&(C>='6/1/2023')&&(C<'7/1/2023')&&(B=2)";
/// Session Key gathered using the Authenticate Command.
SessKey = "70826FC89809414BB4303231333441303331343335";
string json = JsonConvert.SerializeObject(new { Query });
byte[] data = Encoding.UTF8.GetBytes(json);
// create Request
WebRequest request = WebRequest.Create("https://easypay5.com/APIcardProcREST/v1.0.0/Query/Transaction");
request.Method = "POST";
request.ContentType = "application/json";
request.ContentLength = data.Length;
// use your session key obtained when you authenticated
request.Headers.Add("SessKey: " + SessKey);
string Myheaders = request.Headers.ToString();
string responseContent = null;
// Using the Try block will catch communication errors
try {
using (Stream stream = request.GetRequestStream()) {
stream.Write(data, 0, data.Length);
}
using (WebResponse response = request.GetResponse()) {
using (Stream stream = response.GetResponseStream()) {
using (StreamReader sr99 = new StreamReader(stream)) {
responseContent = sr99.ReadToEnd();
}
}
}
} catch (Exception ee) {
MessageBox.Show("Problem communicating with EasyPay Service:" + ee.Message);
/// important to insert your Logging function here
return;
}
// Check for null Response as this would be a critical communication error as well
if (responseContent == null) {
MessageBox.Show("Critical Error!");
/// important to insert your Logging function here
return;
}
/// develop Response Object
var Result = JsonConvert.DeserializeObject<dynamic>(responseContent);
bool FunctionOk = (bool)Result.Transaction_QueryResult.FunctionOk;
int ErrCode = (int)Result.Transaction_QueryResult.ErrCode;
string ErrMsg = (string)Result.Transaction_QueryResult.ErrMsg;
string RespMsg = (string)Result.Transaction_QueryResult.RespMsg;
//Check for unexpected Errors on cloud servers. If errors found Stop Processing and check ErrorCodes
if (!FunctionOk) {
MessageBox.Show(RespMsg + " " + ErrCode + " " + ErrMsg);
/// important to insert your Logging function here
return;
}
/// retrieve desired transactions
var Transactions = Result.Transaction_QueryResult.Transactions;
foreach (var Tx in Transactions) {
/// iterate through records if neccesary
/// Transaction ID
int Txid = Tx.ID;
// Approval Code
string TxnCode = Tx.TXN_CODE;
}
}