Get Transactions by Reference Number
The 'Get Transactions by Reference Number' API enables to retrieve the details of specific transaction using the reference number of transaction.
Method: POST
{{URL}}/jsonrpc
Example
Request Parameters
Parameter | Description |
---|---|
method | String API method that is being called to get transaction details through ledger service. Constant Value : "TransactionService.GetTransactionsByRef" |
id | String Unique ID of API request. Sample Value : "1" |
params | Object Container for API parameters. |
api | Object Container for authentication and credential fields. |
signature Mandatory | String Sign the request payload (params.payload) using private key. Sample value: "MEQCIAbpxHpdOyBEVlmxPYv7m4Z1OvWJJYw7g7u3GE3T9nmvAiBjKHckSvb1M6O4t7FeWsn2z9Y3dMeYn3HyX/k28ek/Dw==" |
keyId Mandatory | String Key ID is provided at the time of device registration. Sample value: "348076" |
credential Mandatory | String Basic (space) ("<Username>:<apiKey>") as Base64 encoded value to be provided Sample value: "Basic bmF2eWEubitlbXBAbmV0eGQuY29tOmY1OWIwY2NlOTU4ZTQ1YTc4MGVhZWIzYWVjOWVjZDAx" |
payload | Object Container for request data. |
ReferenceId | String Unique reference ID of the transaction. Sample Value : "10000000272005" |
- cURL
- C#
- Go
- NodeJS
curl --location --globoff '{{URL}}/jsonrpc' \
--header 'Content-Type: application/json' \
--data '{"method":"TransactionService.GetTransactionsByRef","id":"1","params":{"api":{"signature":"{{signature}}","keyId":"{{ApplicationKeyId}}","credential":"{{Credential}}"},"payload":{"ReferenceId":"10000000272005"}}}'
var options = new RestClientOptions("{{URL}}/jsonrpc")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Post);
request.AddHeader("Content-Type", "application/json");
var body = @"{
" + "\n" +
@" ""method"": ""TransactionService.GetTransactionsByRef"",
" + "\n" +
@" ""id"": ""1"",
" + "\n" +
@" ""params"": {
" + "\n" +
@" ""api"": {
" + "\n" +
@" ""signature"": ""{{signature}}"",
" + "\n" +
@" ""keyId"": ""{{ApplicationKeyId}}"",
" + "\n" +
@" ""credential"": ""{{Credential}}""
" + "\n" +
@" },
" + "\n" +
@" ""payload"": {
" + "\n" +
@" ""ReferenceId"": ""10000000272005""
" + "\n" +
@" }
" + "\n" +
@" }
" + "\n" +
@"}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "{{URL}}/jsonrpc"
method := "POST"
payload := strings.NewReader(`{`+"
"+`
"method": "TransactionService.GetTransactionsByRef",`+"
"+`
"id": "1",`+"
"+`
"params": {`+"
"+`
"api": {`+"
"+`
"signature": "{{signature}}",`+"
"+`
"keyId": "{{ApplicationKeyId}}",`+"
"+`
"credential": "{{Credential}}"`+"
"+`
},`+"
"+`
"payload": {`+"
"+`
"ReferenceId": "10000000272005"`+"
"+`
}`+"
"+`
}`+"
"+`
}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var https = require('follow-redirects').https;
var fs = require('fs');
var options = {
'method': 'POST',
'hostname': '{{URL}}',
'path': '/jsonrpc',
'headers': {
'Content-Type': 'application/json'
},
'maxRedirects': 20
};
var req = https.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function (chunk) {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
res.on("error", function (error) {
console.error(error);
});
});
var postData = JSON.stringify({
"method": "TransactionService.GetTransactionsByRef",
"id": "1",
"params": {
"api": {
"signature": "{{signature}}",
"keyId": "{{ApplicationKeyId}}",
"credential": "{{Credential}}"
},
"payload": {
"ReferenceId": "10000000272005"
}
}
});
req.write(postData);
req.end();
Body
{
"method": "TransactionService.GetTransactionsByRef",
"id": "1",
"params": {
"api": {
"signature": "{{signature}}",
"keyId": "{{ApplicationKeyId}}",
"credential": "{{Credential}}"
},
"payload": {
"ReferenceId": "10000000272005"
}
}
}
Response: 200
Response Parameters
Parameter | Description |
---|---|
id | String Unique ID of API request Sample Value : "1" |
result | Object |
type | Enum Type of transaction Valid values: REMITTANCE, CARDPAY, INTERNAL_TRANSFER, WITHDRAW, DEPOSIT, INTERNAL, EFT, BILLPAY, R2P, VOID, OPENING_BALANCE, FEE_REFUND, ISSUE_CARD, TAX_REFUND, BILLPAY_SADAD, ACH_OUT, ACH_PULL, WIRE_OUT, DISBURSEMENT, KYC_TRANSACTION, GL_TRANSFER, WIRE_DD, ACH_RETURN, RTP_OUT, RTP_REVERSAL, RTP_IN, ICS_DEPOSIT, RTP_RFR_OUT, RTP_RFR_IN, FEDNOW_RFP_OUT, FEDNOW_RFR_OUT Sample Value : "DEPOSIT" |
mode | Enum Mode of transfer Valid values: PG, ACH, QRCODE, EFT, TELLER, BENEFIT, CHEQUE Sample Value : "PG" |
Status | Enum Status of the transaction Valid values: COMPLETED, PENDING, FAILED, DECLINED, REJECTED, CANCELLED Sample Value : "PENDING" |
ReferenceId | String Unique reference ID of the transaction Sample Value : "REF0000000002" |
CustomerId | String Unique ID of the customer Sample Value : "123465789" |
TimeStamp | String Date and time transaction is initiated Sample Value : "2020-04-22T07:44:55-05:00" |
TransactionId | String Unique transaction identification number Sample Value : "5ea0164ed6571f12242d575c" |
credit | Boolean Indicates if transaction is a credit transaction Sample Value : false |
InstructedAmount | Object |
Amount | Number Amount of the transaction Sample Value : 7 |
Currency | String Currency of the transaction Sample Value : "USD" |
Fees | Array |
Fees[].Amount | Number Fee amount Sample Value : 2 |
Fees[].Currency | String Currency of fee Sample Value : "USD" |
TransactionNumber | Number Unique transaction number assigned Sample Value : "QA00000000000362" |
Tax | String Tax amount Sample Value : 500 |
DebtorAccount | Object |
AccountNumber | String Debtor account number Sample Value : "98652221851" |
InstitutionId | String Debtor's bank ID Sample Value : "101115302" |
Reference | String Reference ID Sample Value : "txn000013" |
Party | Object |
AccountVerificationId | String Account verification ID Sample Value : "5e9f246bd6571f2280d3d7b4" |
KycId | String KYC check ID Sample Value : "5e9f1696d6571f272c5bcc0f" |
IdentificationType | Enum Debtor account type Valid values: SAVINGS, CHECKING Sample Value : "SAVINGS" |
CreditorAccount | Object |
AccountNumber | String Creditor account number Sample Value : "9865321478" |
InstitutionId | String Creditor bank ID Sample Value : "011000028" |
IdentificationType | Enum Creditor account type Valid values: SAVINGS, CHECKING Sample Value : "SAVINGS" |
CardNumber | String Creditor card number Sample Value : "5102589999999913" |
Reference | String Reference ID Sample Value : "txn000013" |
ExpiryDate | String Card expiry date (YYYY-MM) Sample Value : "2022-12" |
Party | Object |
Name | String Full name Sample Value : "John Deo" |
Identification | String Identification value Sample Value : "859630248" |
IdentificationType | Enum Identification type Valid values: SSN, TIN Sample Value : "SSN" |
DateOfBirth | String Date of birth Sample Value : "19930222" |
Address | Object |
Line1 | String Address line 1 Sample Value : "1200 street" |
Line2 | String Address line 2 Sample Value : "2nd main road" |
TownName | String City Sample Value : "Chennai" |
PostCode | String ZIP code Sample Value : "600042" |
State | String State Sample Value : "TN" |
Country | String Country Sample Value : "IN" |
{
"id": "1",
"result": {
"type": "DEPOSIT",
"mode": "PG",
"Status": "PENDING",
"ReferenceId": "REF0000000002",
"CustomerId": "123465789",
"TimeStamp": "2020-04-22T07:44:55-05:00",
"TransactionId": "5ea0164ed6571f12242d575c",
"credit": false,
"InstructedAmount": {
"Amount": 7,
"Currency": "USD"
},
"Fees": [
{
"Amount": 2,
"Currency": "USD",
"TransactionNumber": "QA00000000000362",
"Tax": 500
}
],
"DebtorAccount": {
"AccountNumber": "98652221851",
"InstitutionId": "101115302",
"Reference": "txn000013",
"Party": {
"AccountVerificationId": "5e9f246bd6571f2280d3d7b4",
"KycId": "5e9f1696d6571f272c5bcc0f"
},
"IdentificationType": "SAVINGS"
},
"CreditorAccount": {
"AccountNumber": "9865321478",
"InstitutionId": "011000028",
"IdentificationType": "SAVINGS",
"CardNumber": "5102589999999913",
"Reference": "txn000013",
"ExpiryDate": "2022-12",
"Party": {
"Name": "John Deo",
"Identification": "859630248",
"IdentificationType": "SSN",
"DateOfBirth": "19930222",
"Address": {
"Line1": "1200 street",
"Line2": "2nd main road",
"TownName": "chennai",
"PostCode": "600042",
"State": "TN",
"Country": "IN"
}
}
}
},
"jsonrpc": "2.0"
}
Error Codes
Error Codes
Error Code | Error Message | Recommended Action |
---|---|---|
BAD_INPUT | ID is invalid or missing | ReferenceId is missing. Please provide a valid Reference Id |
UNAUTHORIZED | Access Denied | Access Denied. Please Check with Support Team |
NOT_FOUND_TRANSACTION | No transaction found with reference | Please provide a valid Reference Id of a transaction and try again |
INVALID_SIGNATURE | Invalid Signature | Signature is invalid. Please ensure correct key, algorithm and signature process is followed |
NOT_FOUND_USER_DEVICE | User device not found | Invalid Key Id. please provide valid Key ID |
BAD_CREDENTIAL | Invalid Credential | Invalid credential. Please verify the credentials provided. |