Trigger OTP

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.

<html-block html=”

Request Headers

“>

Header NameHeader Value
Content-Typeapplication/json
X-VERIFYSHA256(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="
}

<html-block html=”

Request Parameters

“>

Parameter NameTypeDescriptionMandatory
merchantIdstringUnique merchantId assigned to the merchantYes
mobileNumberstringMobile Number on which OTP will be sentYes
emailstringEmail ID of the customerNo
shortNamestringName of the customerNo
requestTypeEnumType of linking to be done. Will always be WALLET for DIRECT DEBIT flow, CREDIT for M2C/Instant Payout flowNo

<html-block html=”

Response Parameters

“>

Parameter NameTypeDescription
successbooleanDenotes if API call is successful.
codestringSee below for list of values
dataObjectSee below table

DATA JSON OBJECT

Parameter NameTypeDescription
merchantIdstringmerchantId assigned to merchant.
otpTokenstringOTP 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.

<html-block html=”

Response Codes

“>

Code ValueDescription
SUCCESSSuccess scenario
AUTHORIZATION_FAILEDValue of X-VERIFY is incorrect
BAD_REQUESTInvalid request payload
INTERNAL_SERVER_ERRORThe server is busy or the server is not responding
USER_BLACKLISTEDCustomer is blacklisted on PhonePe side
USER_BLOCKEDUser is blocked for 1 day.
OTP_LIMIT_EXCEEDEDThere 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_REQUESTSIf we are getting too many requests from merchant for this API

<html-block html=”

Response Data

“>

{“method”:”post”,”url”:”/v3/merchant/otp/send”,”auth”:”required”,”results”:{“codes”:[{“status”:200,”language”:”json”,”code”:”{\n \”success\”: true,\n \”code\”: \”SUCCESS\”,\n \”message\”: \”Your request has been successfully completed.\”,\n \”data\”: {\n \”merchantId\”: \”M2306160483220675579140\”,\n \”otpToken\”: \”OTP7c8d7de8-5d16-46b7-a269-45afeafb5f8e\”\n }\n}”,”name”:”Success Response”},{“status”:400,”language”:”json”,”code”:”{}”,”name”:””}]},”params”:[{“name”:”request”,”type”:”string”,”enumValues”:””,”default”:””,”desc”:”base64 encoded payload”,”required”:true,”in”:”body”,”ref”:””,”_id”:”5a97d96f9bd97200459f1ef8″},{“name”:”Content-Type”,”type”:”string”,”enumValues”:””,”default”:”application/json”,”desc”:””,”required”:true,”in”:”header”,”ref”:””,”_id”:”5a97d96f9bd97200459f1ef7″},{“name”:”X-VERIFY”,”type”:”string”,”enumValues”:””,”default”:””,”desc”:”sha256(base64encodedpayload + “/v3/merchant/otp/send” + saltKey) + \”###\” + saltIndex”,”required”:true,”in”:”header”,”ref”:””,”_id”:”5a97d96f9bd97200459f1ef6″}],”apiSetting”:”5ecf9143b5bd210023b3b738″,”examples”:{“codes”:[]}}
https://mercury-uat.phonepe.com