Statement Inquiry API - CLW

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

EnvironmentURL
Testhttps://apitest.payu.in/loyalty-points/v1/wallet/statement-inquiry
Productionhttps://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

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

Body Parameters

The request body contains both encrypted and decrypted parameters.

Encrypted

ParameterDescription
token
mandatory
String AES-192-CBC encrypted request body containing all the decrypted parameters

Decrypted

Parameter Description Example
messageCode
mandatory
Numeric(4) API identifier for statement inquiry 1072
clientTxnId
mandatory
String(100) Unique identifier for this inquiry transaction StatementReq2023
fromDate
mandatory
String(10) Start date of the statement period (DD/MM/YYYY format) 01/07/2023
toDate
mandatory
String(10) End date of the statement period (DD/MM/YYYY format) 31/07/2023
urn
mandatory
Numeric(11) Unique wallet reference number 7000123456

Response Parameters

ParameterDescriptionExample
responseCodeResponse status code00
messageCodeAPI response code1073
clientTxnIdEchoes the request's clientTxnIdStatementReq2023
urnWallet reference number7000123456
availableBalanceCurrent balance in the wallet10000
openingBalanceWallet balance at the beginning of the specified period5000
closingBalanceWallet balance at the end of the specified period15000
statementDetailsArray of transaction details within the date range[...]
responseMessageResponse messageSUCCESS

Statement Details Object

ParameterDescriptionExample
transactionIdUnique transaction identifierTXN123456789
transactionDateDate of transaction (DD/MM/YYYY)15/07/2023
transactionTimeTime of transaction (HH:MM:SS)14:30:25
transactionTypeType of transaction (CREDIT/DEBIT)CREDIT
transactionAmountTransaction amount in implied decimals5000
availableBalanceBalance after this transaction10000
merchantNameName of merchant or sourceAmazon
descriptionTransaction descriptionCashback reward
statusTransaction statusSUCCESS
referenceNumberReference number for the transactionREF789012345

Sample Request

Encrypted Packet

curl --location --request POST 'https://apitest.payu.in/loyalty-points/v1/wallet/statement-inquiry' \
--header 'walletIdentifier: CLW' \
--header 'date: Wed, 12 Jun 2024 08:53:43 GMT' \
--header 'authorization: hmac username="smsplus", algorithm="sha512", headers="date", signature="hmac_generated_signature"' \
--header 'Content-Type: application/json' \
--data-raw '{
  "token": "h/0YSUd9jKOQ8+2Dc3Phr4s7vxyz123..."
}'

Decrypted Packet

{
  "messageCode": "1072",
  "clientTxnId": "StatementReq2023",
  "fromDate": "01/07/2023",
  "toDate": "31/07/2023",
  "urn": "7000123456"
}

Sample Response

Encrypted Response

{
  "result": "h/0YSUd9jKOQ8+2Dc3Phr4s7vxyz789..."
}

Decrypted Response

{
  "responseCode": "00",
  "messageCode": 1073,
  "clientTxnId": "StatementReq2023",
  "urn": 7000123456,
  "availableBalance": 10000,
  "openingBalance": 5000,
  "closingBalance": 15000,
  "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"
    }
  ],
  "responseMessage": "SUCCESS"
}

HTTP Status Codes

Status CodeDescription
200OK - Request processed successfully
400Bad Request - Invalid request parameters
401Unauthorized - Authentication failed
404Not Found - Wallet not found
500Internal Server Error

Error Codes

Error CodeDescription
1073Statement inquiry successful
1010Invalid message code
1020Missing required parameters
1040Wallet not found
1074Invalid date range

Transaction Types

TypeDescription
CREDITMoney added to the wallet
DEBITMoney deducted from the wallet

Transaction Status Values

StatusDescription
SUCCESSTransaction completed successfully
FAILEDTransaction failed
PENDINGTransaction is still in progress
CANCELLEDTransaction was cancelled

Date Range Limitations

  • Maximum date range: 90 days
  • Date format: DD/MM/YYYY
  • Both fromDate and toDate are inclusive
  • Future dates are not allowed
Ask AI Beta

Hi! I am an AI Assistant. Ask me about PayU and get help with your integration.
Responses are generated by AI, may contain some mistakes.

EXAMPLE QUESTIONS