The Statement Inquiry API allows you to retrieve wallet transaction details, including both financial and non-financial transactions, within a specific date range. This is useful for generating account statements and transaction history.
Environment
Environment | URL |
---|---|
Test | https://apitest.payu.in/loyalty-points/v1/wallet/statement-inquiry |
Production | https://api.payu.in/loyalty-points/v1/wallet/statement-inquiry |
HTTP Method: POST
Request Headers
This API uses HMAC-SHA512 authentication on the header.
Parameter | Description |
---|---|
walletIdentifier mandatory |
String Program Type (e.g., CLW)
|
date mandatory |
String GMT formatted date (e.g., Thu, 17 Feb 2022 08:17:59 GMT)
|
Authorization mandatory |
String HMAC-SHA512-based authentication token
|
Content-Type mandatory |
String application/json
|
If you do not post the authentication, you will get error in response. For the list of error codes, refer to Status Codes
hmac authentication logic
hmac username="smsplus", algorithm="sha512", headers="date", signature="7ff938849aa79265a3de63fe241dfecb1c680f58c6d11e9f9ca08512afea374705eb9f8995ef6c4584e16eca2e1dc688262bb0937a36cc0f75ec22a9eea33523"
Where, the fields in this example are:
- username: The merchant key of the merchant.
- algorithm: This must have the value as hmac-sha512 that is used for this API.
- headers: This must have the value as date digest.
- signature: This must contain the hmacsha512 of (signing_string, merchant_secret), where:
- signing_string: It must be in the "date: {dateValue}"format. Here, the dateValue is the same values in the fields listed in this table For example, "date: Thu, 17 Feb 2022 08:17:59 GMT"
- merchant_secret: The merchant Salt of the merchant. For more information on getting the merchant Salt, refer to Generate Merchant Key and Salt.
Request Parameters
Parameter | Description | Example |
---|---|---|
messageCode mandatory |
Numeric (4) - API Code to uniquely identify 'statement Inquiry' API | 1072 |
clientTxnId mandatory |
String (100) - Unique Id generated by the calling application for each transaction. This ID should always unique in all API Requests. | 20150701235959xhstiesqfdscheck |
responseDateTime mandatory |
Numeric (14) - Local Date and time stamp when the transaction originated from the client in YYYYMMDDHHMMSS with time in 24 hr format | 20161031214559 |
customerId conditional |
String (20) - Customer Id, which uniquely identifies the walletholder in the client system | IN2016201611 |
fromDate mandatory |
String (10) - Statement Details from Date(DD/MM/YYYY) | 10/10/2015 |
toDate mandatory |
String (10) - Statement Details to Date(DD/MM/YYYY) | 07/08/2016 |
urn mandatory |
Numeric (10) - URN of the wallet | 1000058915 |
pageNumber optional |
Numeric (5) - page number indexed from 1 | 1 |
Count optional |
Numeric (5) - max count should be 100 | 50 |
fromRowId optional |
String (100) - to counter change in the search set, key to identify the last record for the previous set | 20161061214556 |
Response Parameters
Parameter | Description | Example |
---|---|---|
responseCode | Response status code | 00 |
messageCode | API response code | 1073 |
clientTxnId | Echoes the request's clientTxnId | StatementReq2023 |
urn | Wallet reference number | 7000123456 |
availableBalance | Current balance in the wallet | 10000 |
openingBalance | Wallet balance at the beginning of the specified period | 5000 |
closingBalance | Wallet balance at the end of the specified period | 15000 |
statementDetails | Array of transaction details within the date range. For the field descriptions in this object, refer to[ statementDetails object fields description](#statementDetails object-fields-description). | [...] |
responseMessage | Response message | SUCCESS |
statementDetails object fields description
Parameter | Description | Example |
---|---|---|
transactionId | Unique transaction identifier | TXN123456789 |
transactionDate | Date of transaction (DD/MM/YYYY) | 15/07/2023 |
transactionTime | Time of transaction (HH:MM:SS) | 14:30:25 |
transactionType | Type of transaction (CREDIT/DEBIT) | CREDIT |
transactionAmount | Transaction amount in implied decimals | 5000 |
availableBalance | Balance after this transaction | 10000 |
merchantName | Name of merchant or source | Amazon |
description | Transaction description | Cashback reward |
status | Transaction status | SUCCESS |
referenceNumber | Reference number for the transaction | REF789012345 |
Sample Request
curl --location --request POST 'https://apitest.payu.in/loyalty- points/v1/wallet/statement-inquiry' \
--header 'walletIdentifier: CLW' \
--header 'authorization: hmac username="smsplus", algorithm="sha512", headers="date", signature="v15rnvh1InSEWRq6EW9BCfXlxO0QI/4Sxxmdxd2f4Q0="' \
--header 'date: Wed, 12 Jun 2024 08:53:43 GMT' \
--header 'Content-Type: application/json' \
--header 'Cookie: PHPSESSID=s4uujktf7gm484pt7uk7bdhv55' \
--data-raw '{
"messageCode": "1072",
"requestDateTime": "20191009030456",
"clientTxnId": "statementinqtes21",
"fromDate": "01/01/2024",
"toDate": "19/03/2024", "last4Digits": "3877",
"urn": 1000000,
"customerId": "22019",
"count": "100"
}'
Sample Response
{
"urn": 1000020,
"customerId": "220555",
"responseCode": "00",
"messageCode": 1073,
"clientTxnId": "statementinqtes22",
"clientId": "7310",
"responseDateTime": "20240522120617",
"responseMessage": "SUCCESS",
"bankId": 6060,
"availableBalance": "100000",
"availableCashLimit": "0",
"pageNumber": 1,
"count": 100,
"openingBalance": "0",
"closingBalance": "0",
"statementDetails": [
{
"transactionId": "TXN123456789",
"transactionDate": "15/07/2023",
"transactionTime": "14:30:25",
"transactionType": "CREDIT",
"transactionAmount": 5000,
"availableBalance": 10000,
"merchantName": "Amazon",
"description": "Cashback reward",
"status": "SUCCESS",
"referenceNumber": "REF789012345"
}
]
}