VPA Validate API

In UPI collect flow, users have to enter a Virtual Payment Address (VPA) to make the payment. The VPA can be verified using this API.

Request Headers

Header NameHeader Value
Content-Typeapplication/json
X-VERIFYSHA256(base64 encoded payload + “/pg/v1/vpa/validate” + salt key) + ### + salt index
{
  "merchantId":"JUSPAYUAT",
  "vpa":"9999999999@ybl"
}

Convert the JSON Payload to Base64 Encoded Payload

The above JSON request payload should be converted to the Base64 Encoded Payload and then the request should be sent in the below format.

{
  "request": "ewogICJtZXJjaGFudElkIjoiSlVTUEFZVUFUIiwKICAidnBhIjoiOTk5OTk5OTk5OUB5YmwiCn0K"
}

Request Parameters

Parameter NameTypeDescriptionMandatory
merchantIdSTRINGUnique Merchant ID assigned to the merchant by PhonePeYes
vpaSTRINGThe virtual payment address you want to validateYes

Sample Response

{
    "success": true,
    "code": "SUCCESS",
    "message": "Your request has been successfully completed.",
    "data": {
        "name": "ABC",
        "vpa": "9999999999@ybl"
    }
}
{
    "success": false,
    "code": "INVALID_VPA",
    "message": "Incorrect UPI details. Please check the UPI ID entered.",
    "data": {}
}

Response Parameters

Parameter NameTypeDescription
successBOOLEANSuccess/Failure of request processing
codeSTRINGResponse code explaining reason for status.
For status SUCCESS, only one possible response code is present – SUCCESS
For status FAILURE, following response codes are possible:
INTERNAL_SERVER_ERROR
BAD_REQUEST
AUTHORIZATION_FAILED
INVALID_VPA
messageSTRINGMessage giving more information about the code.
nameSTRINGThe name linked to VPA
vpaSTRINGThe VPA sent in the request

Error Codes

CodeDescription
BAD_REQUESTInvalid request
AUTHORIZATION_FAILEDX-VERIFY header is incorrect
INTERNAL_SERVER_ERRORSomething went wrong
SUCCESSSuccessful request
INVALID_VPAIncorrect VPA entered by the user
{“method”:”post”,”url”:”/pg/v1/vpa/validate”,”auth”:”required”,”results”:{“codes”:[{“name”:””,”code”:”{\n \”success\”: true,\n \”code\”: \”SUCCESS\”,\n \”message\”: \”Your request has been successfully completed.\”,\n \”data\”: {\n \”name\”: \”ABC\”,\n \”vpa\”: \”9999999999@ybl\”\n }\n}”,”language”:”json”,”status”:200},{“name”:””,”code”:”{\n \”success\”: false,\n \”code\”: \”INVALID_VPA\”,\n \”message\”: \”Incorrect UPI details. Please check the UPI ID entered.\”,\n \”data\”: {}\n}”,”language”:”json”,”status”:417}]},”params”:[{“name”:”Content-Type”,”type”:”string”,”enumValues”:””,”default”:”application/json”,”desc”:””,”required”:true,”in”:”header”,”ref”:””,”_id”:”62ac570be562f80072fe97ed”},{“name”:”X-VERIFY”,”type”:”string”,”enumValues”:””,”default”:””,”desc”:”SHA256(base64 encoded payload + \”/pg/v1/vpa/validate\” + salt key) + ### + salt index”,”required”:true,”in”:”header”,”ref”:””,”_id”:”62ac570be562f80072fe97ec”}],”apiSetting”:”63bb01b11abcf7046d98754c”,”examples”:{“codes”:[]}}
https://api-preprod.phonepe.com/apis/pg-sandbox