The Update Profile API allows you to update a customer's profile information including name, email, mobile number, address, and other personal details. This API is useful for maintaining accurate customer information and compliance requirements.
Environment
Environment | URL |
---|---|
Test | https://apitest.payu.in/loyalty-points/v1/wallet/onboarding/v3/updateProfile |
Production | https://api.payu.in/loyalty-points/v1/wallet/onboarding/v3/updateProfile |
HTTP Method: POST
Authentication
This API uses HMAC-SHA512 authentication on header.
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 Unique IDentifier. |
1280 |
clientTxnIdmandatory |
string(100) Unique ID generated by the calling application for each API request. |
statementinqtes21 |
requestDateTimemandatory |
Numeric(14) Request local timestamp in YYYYMMDDHHMMSS with time in 24-hour format. |
2022061314719 |
productIdmandatory |
String(10) Product ID of the product the Customer holds. Wibmo to share. |
16 |
customerIdconditional |
string(20) Unique identifier for the customer. |
98645 |
urnconditional |
Numeric(20) Unique reference number for the customer. |
7000000008 |
profileIdchangedateoptional |
numeric(14) Local timestamp when the profile change is done YYYYMMDDHHMMSS with time in 24 hours format. |
20161031214559 |
cardProfileIdmandatory |
numeric(3) Present KYC Profile ID. 150 - full KYC, 30 - Min KYC, 300 - Shortfall KYC |
Default value is 30 |
firstNameoptional |
string(50) First Name of the Customer. Below are validations for this field1. Start and end with valid characters (no extra characters outside the allowed set). 2. Contain only: Uppercase letters (A-Z) Lowercase letters (a-z) Periods (.) Spaces ( ) Have at least one character and no invalid symbols like numbers, special characters outside the allowed set, etc. |
Jacob |
lastNameoptional |
string(50) Last Name of the Customer. Below are validations for this field1. Start and end with valid characters (no extra characters outside the allowed set). 2. Contain only: Uppercase letters (A-Z) Lowercase letters (a-z) Periods (.) Spaces ( ) Have at least one character and no invalid symbols like numbers, special characters outside the allowed set, etc. |
James |
emailIdoptional |
string(50) Email Address of the Customer |
[email protected] |
dateOfBirthoptional |
numeric(8) Date of Birth of the Customer in YYYYMMDD format. |
11-07-1995 |
genderoptional |
string(20) Gender Of the Customer. |
Male |
updateVectorsoptional |
String(50) Pass any for update: emailId,address,city,state,country,zipcode,alternateEmailId |
emailId,address,city,state,country,zipcode,alternateEmailId |
updateDateoptional |
numeric(14) The Date on which parameters are updated. |
20220616214559 |
Note: Either
customerId
orurn
must be provided.
Response Parameters
Parameter | Description |
---|---|
encdatamandatory |
String Encrypted request body containing all the decrypted parameters |
Sample Request
Encrypted Packet
curl --location --request POST 'https://apitest.payu.in/loyalty-points/v1/wallet/onboarding/v3/updateProfile' \
--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": 1280,
"clientTxnId": "ABC0987654321",
"requestDateTime": "20230804182306",
"productId": "9",
"customerId": "62508",
"firstName": "Jacob",
"lastName": "James",
"emailId": "[email protected]",
"mobileNumber": "919988776655",
"dateOfBirth": "19951201",
"gender": "Male",
"address": {
"line1": "123 Main Street",
"line2": "Apartment 4B",
"city": "Mumbai",
"state": "Maharashtra",
"country": "India",
"pincode": "400001"
},
"updateVectors": "emailId,address"
}
Sample Response
Encrypted Response
{
"result": "h/0YSUd9jKOQ8+2Dc3Phr4s7vxyz789..."
}
Decrypted Response
{
"responseCode": "00",
"messageCode": 1281,
"clientTxnId": "ABC0987654321",
"customerId": "62508",
"urn": 7000000008,
"bankId": "123",
"cardProfileId": "CP001",
"responseMessage": "PROFILE UPDATED 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 not found |
500 | Internal Server Error |
Error Codes
Error Code | Description |
---|---|
1281 | Profile updated successfully |
1010 | Invalid message code |
1020 | Missing required parameters |
1040 | Customer not found |
1282 | Invalid update vector |
1283 | Profile update failed |