post https://api-preprod.phonepe.com/apis/merchant-simulator/pg/v1/vpa/validate
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 Name | Header Value |
---|---|
Content-Type | application/json |
X-VERIFY | SHA256(base64 encoded payload + "/pg/v1/vpa/validate" + salt key) + ### + salt index |
{
"merchantId":"JUSPAYUAT",
"vpa":"[email protected]"
}
{
"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": "[email protected]"
}
}
{
"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 |