Request Headers
Header Name | Header Value |
---|---|
Content-Type | application/json |
X-VERIFY | SHA256(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 Name | Type | Description | Mandatory |
---|---|---|---|
merchantId | STRING | Unique Merchant ID assigned to the merchant by PhonePe | Yes |
vpa | STRING | The virtual payment address you want to validate | Yes |
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 Name | Type | Description |
---|---|---|
success | BOOLEAN | Success/Failure of request processing |
code | STRING | Response 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 |
message | STRING | Message giving more information about the code. |
name | STRING | The name linked to VPA |
vpa | STRING | The VPA sent in the request |
Error Codes
Code | Description |
---|---|
BAD_REQUEST | Invalid request |
AUTHORIZATION_FAILED | X-VERIFY header is incorrect |
INTERNAL_SERVER_ERROR | Something went wrong |
SUCCESS | Successful request |
INVALID_VPA | Incorrect 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