The Retrieve Customer Record API allows you to fetch customer details using various identifiers such as customerId, mobileNumber, email, or urn.
Environment
Environment | URL |
---|---|
Test | https://apitest.payu.in/loyalty-points/v1/wallet/retrieveCustRecord |
Production | https://api.payu.in/loyalty-points/v1/wallet/retrieveCustRecord |
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
Parameter | Description |
---|---|
tokenmandatory | String AES-192-CBC encrypted request body containing all the decrypted parameters |
Decrypted
Parameter | Description | Example |
---|---|---|
messageCodemandatory |
Numeric(4) API code to identify Retrieve Customer API |
1930 |
clientTxnIdmandatory |
Alphanumeric(100) Unique transaction ID from the calling application |
retrieval12 |
customerMobileconditional |
Numeric(15) Customer mobile number with country code |
918765432123 |
customerIdconditional |
String(20) Unique customer ID from the calling application |
620934850 |
urnconditional |
Numeric(11) Proxy wallet reference number |
70000000008 |
Note: At least one of
customerMobile
,customerId
, orurn
must be provided.
Response Parameters
Parameter | Description | Example |
---|---|---|
responseCode | Response status code | 00 |
messageCode | API response code | 1931 |
clientTxnId | Mirrors the request's clientTxnId | retrieval12 |
mobile | Customer mobile number | 918765432123 |
Customer email address | [email protected] | |
firstName | Customer first name | John |
lastName | Customer last name | Doe |
kycName | KYC verified name | John Doe |
urn | Wallet reference number | 70000000008 |
accountNumber | Account number | 72623345 |
walletStatus | Current wallet status | ACTIVE |
availableBalance | Current available balance | 5000 |
responseMessage | Response message | CUSTOMER RECORD RETRIEVED SUCCESSFULLY |
Sample Request
Encrypted Packet
curl --location --request POST 'https://apitest.payu.in/loyalty-points/v1/wallet/retrieveCustRecord' \
--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": 1930,
"clientTxnId": "retrieval12",
"customerMobile": "918765432123"
}
Sample Response
Encrypted Response
{
"result": "h/0YSUd9jKOQ8+2Dc3Phr4s7vxyz789..."
}
Decrypted Response
{
"responseCode": "00",
"messageCode": 1931,
"clientTxnId": "retrieval12",
"mobile": "918765432123",
"email": "[email protected]",
"firstName": "John",
"lastName": "Doe",
"kycName": "John Doe",
"urn": 70000000008,
"accountNumber": "72623345",
"walletStatus": "ACTIVE",
"availableBalance": 5000,
"responseMessage": "CUSTOMER RECORD RETRIEVED SUCCESSFULLY"
}
HTTP Status Codes
Status Code | Description |
---|---|
200 | OK - Request processed successfully |
400 | Bad Request - Invalid request parameters |
401 | Unauthorized - Authentication failed |
404 | Not Found - Customer record not found |
500 | Internal Server Error |
Error Codes
Error Code | Description |
---|---|
1931 | Customer record retrieved successfully |
1010 | Invalid message code |
1020 | Missing required parameters |
1040 | Customer not found |