UPI Address Validate API
Use this API to validate whether the UPI address (VPA) or UPI number provided by the customer is valid and ready to accept payments.
Environment
| Environment | HTTP Method | API |
| Sandbox | POST | https://api-preprod.phonepe.com/apis/pg-sandbox/v2/validate/upi |
| Production | POST | https://api.phonepe.com/apis/pg/v2/validate/upi |
⚠️ Setup Required to Avoid Errors!
Before initiating a payment, install the PhonePe Test App and configure the payment template. Skipping this step may result in HTTP 500 errors.
Request
Request Header
| Header Name | Header Value |
| Content-Type | application/json |
Authorization | O-Bearer <access_token> |
⚠️ For Partner Integrations!
It is mandatory to include the X-MERCHANT-ID header with the MerchantID of the end merchant.
Request Parameters
| Parameter Name | Data Type | Mandatory | Description | Constraints |
| String | Yes | Type of UPI Payment Address. | Values allowed: • VPA • UPI_NUMBER |
vpa | String | Conditional | VPA of user to validate. | Max Length = 255 Pass only if “type” = “VPA” |
upiNumber | String | Conditional | UPI Number of user to validate. | Pass only if “type” = “UPI_NUMBER” |
Sample Request with VPA
{
"type": "VPA",
"vpa": "success@ybl"
}Sample Request with UPI Number
{
"type": "UPI_NUMBER",
"upiNumber": "XXXXXXXXXX"
}Response
Sample Response for Case 1: VPA is Valid
{
"valid": true,
"name": "<Name of User>"
}Sample Response for Case 2: Invalid VPA
{
"valid": false
}| Field Name | Data Type | Description |
|---|---|---|
valid | Boolean | • true → UPI address is valid. • false → UPI address is not valid. |
name | String | Name of the user. |
Try it yourself!
Request Payload with VPA
headers
body params
Request Payload with UPI Number
headers
body params
What’s Next?
In the next section, you will learn how to initiate a payment using UPI Collect. This will include sending a collect request to the customer’s UPI ID, allowing them to authorize the payment directly from their UPI app.