post https://mercury-uat.phonepe.com/v3/merchant/otp/send
API to send otp to customer’s mobile number and otpToken to merchant’s server side. This doesn’t involve any UI flow. Merchant needs to implement their own UI.
Header Name | Header Value |
---|---|
Content-Type | application/json |
X-VERIFY | SHA256(base64 encoded payload + '/v3/merchant/otp/send' + salt key) + '###' + salt index |
{
"merchantId": "MID",
"mobileNumber": "9876543210",
"email": "[email protected]",
"shortName": "Nishant Mittal"
"requestType": "WALLET"
}
{
"request" : "ew0KCeKAnG1lcmNoYW50SWTigJ06IOKAnEpJT+KAnSwNCgnigJx0cmFuc2FjdGlvbklk4oCdOiDigJxUWE4xMjM0NeKAnSwNCgnigJxtZXJjaGFudE9yZGVySWTigJ0gOiDigJxPNDIzODTigJ0sDQoJ4oCcbW9iaWxlTnVtYmVy4oCdOiDigJw5ODc2NTQzMjEw4oCdLA0KCeKAnG1lcmNoYW50VXNlcklk4oCdOiDigJxVU0VSMTIzNDXigJ0sDQoJ4oCcZW1haWw6IOKAnG5pc2hhbnQubUBnbWFpbC5jb23igJ0sDQoJ4oCcc2hvcnROYW1l4oCdIDog4oCcTmlzaGFudCBNaXR0YWzigJ0NCn0="
}
Parameter Name | Type | Description | Mandatory |
---|---|---|---|
merchantId | string | Unique merchantId assigned to the merchant | Yes |
mobileNumber | string | Mobile Number on which OTP will be sent | Yes |
email | string | Email ID of the customer | No |
shortName | string | Name of the customer | No |
requestType | Enum | Type of linking to be done. Will always be WALLET for DIRECT DEBIT flow, CREDIT for M2C/Instant Payout flow | No |
Parameter Name | Type | Description |
---|---|---|
success | boolean | Denotes if API call is successful. |
code | string | See below for list of values |
data | Object | See below table |
DATA JSON OBJECT
Parameter Name | Type | Description |
---|---|---|
merchantId | string | merchantId assigned to merchant. |
otpToken | string | OTP token (need to be passed while verifying the OTP) |
otpToken should be stored in the server side and should not be passed to the client side.
Code Value | Description |
---|---|
SUCCESS | Success scenario |
AUTHORIZATION_FAILED | Value of X-VERIFY is incorrect |
BAD_REQUEST | Invalid request payload |
INTERNAL_SERVER_ERROR | The server is busy or the server is not responding |
USER_BLACKLISTED | Customer is blacklisted on PhonePe side |
USER_BLOCKED | User is blocked for 1 day. |
OTP_LIMIT_EXCEEDED | There is a limit on number of times OTP can be sent on a mobile number. This code will be received is that limit is crossed. |
TOO_MANY_REQUESTS | If we are getting too many requests from merchant for this API |