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
Language
Click Try It! to start a request and see the response here!