Validate VPA API

This API (validateVPA) will let you validate VPA if it is a valid VPA or not.

After the customer enters VPA on the merchant page, you need to call this API to check for VPA validation. If VPA is valid only then, the second call should be made.

Environment

Sample request

Validate VPA

curl -X POST "https://test.payu.in/merchant/postservice?form=2"-H "accept: application/json" -H "Content-Type: application/x-www-form-urlencoded" -d"key=JP***g&command=validateVPA&var1=9999999999@upi&hash=75bb573dce34375a5fa2970afa21023d53e1cf5b8cd80a6472fff9b7c964c7a5da9146c9007df8b7391cbaf2d7d7d91dcaae8bf1d19d1837315a3376d6dc827e""

Validate VPA for Recurring Payment

curl -X POST "https://test.payu.in/merchant/postservice?form=2"-H "accept: application/json" -H "Content-Type: application/x-www-form-urlencoded" -d"key=JP***g&command=validateVPA&var1=9999999999@upi&var2={"validateAutoPayVPA":"1"}&hash=75uy573dce34375a5fa2970afa21023d53e1cf5b8cd80a6472poy9b7c964c7a5da9146c9007df8b7391cbaf2d7d7d91dcaae8bf1d19d1837315a3376d6dc827e""
Sample response

Success scenario

if successfully validated:

{
   "status":"SUCCESS",
   "vpa":"9999999999@upi",
   "isVPAValid":1,
   "isAutoPayVPAValid":1,
   "isAutoPayBankValid":"NA",
   "payerAccountName":"ABC"
}

📘

Notes:

  • The payerAccountName parameter can be empty or NA or will have a payer name based on the value given by the bank.
  • If both isVPAValid and isAutoPayVPAValid is 1, you must initiate payment for Recurring Payments.
  • Ignore the isAutoPayBankValid parameter in the response.

Failure scenarios

  • If invalid VPA, the response is similar to the following:
{
 "status":"SUCCESS","vpa":""abc@upi","isVPAValid":0,"payerAccountName":"NA"
}  
  • Invalid VPA but handle supporting SI (Autopay):
{
 "status":"SUCCESS","vpa":""abc@upi","isVPAValid":0,"isAutoPayVPAValid":1,"isAutoPayBa
nkValid":NA,"payerAccountName":"NA"
}
  • Customer valid but handle not supporting SI (Autopay):
{
  "status":"SUCCESS","vpa":""xyz@freecharge","isVPAValid":1,"isAutoPayVPAValid":0,"isAuto
PayBankValid":NA,"payerAccountName":"XYZ"
}
  • Neither customer valid nor handle supporting Autopay:
{
  "status":"SUCCESS","vpa":""xyz@freecharge","isVPAValid":0,"isAutoPayVPAValid":0,"isAuto
PayBankValid":NA,"payerAccountName":"NA"
}
Response parameters
ParameterDescription
statusThis parameter returns any of the following based on whether the API was successful or failure:

- Successful
- Failure
vpaThis parameter returns the VPA ID.
isVPAValidThis parameter returns any of the following to indicate whether the VPA is valid or not:
- 1: Indicates that VPA is valid

- 0: Indicates the VPA is invalid
isAutoPayVPAValidThis parameter returns any of the following to indicate whether the VPA has registered for Recurring Payments or Autopay:

- 1: Indicates that VPA has registered for Recurring Payments
- 0: Indicates that VPA has not registered for Recurring Payments
isAutoPayBankValidThis parameter returns any of the following to indicate whether the corresponding bank account has registered for Recurring Payments or Autopay:

- 1: Indicates that bank account has registered for Recurring Payments
- 0: Indicates that bank account has not registered for Recurring Payments
payerAccountNameThis parameter returns the name of the account holder (corresponding VPA).

Request parameters

You can use any valid VPA while trying out the API:

Additional information for request parameters
ParameterReference
keyFor more information on how to generate the Key and Salt, refer to any of the following:

- Production: Generate Merchant Key and Salt

- Test: Generate Test Merchant Key and Salt
hashHash logic for this API is:
sha512(key|command|var1|salt)
sha512
var1For JSON fields description, refer to Additional Info for General APIs
Language
Click Try It! to start a request and see the response here!