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.

Request Headers

Header NameHeader Value
Content-Typeapplication/json
X-VERIFYSHA256(base64 encoded payload +
'/v3/merchant/otp/send' + salt key) +
'###' + salt index

Sample Request for Generic Flow

{
 "merchantId": "UATMERCHANT",
 "mobileNumber": "9876543210",
 "requestType" : "WALLET"
}
{
 "request" : "ewogIm1lcmNoYW50SWQiOiAiVUFUTUVSQ0hBTlQiLAogIm1vYmlsZU51bWJlciI6ICI5ODc2NTQzMjEwIiwKICJyZXF1ZXN0VHlwZSIgOiAiV0FMTEVUIgp9Cg=="
}

Sample Request for M2C Flow

{
 "merchantId": "UATMERCHANT",
 "mobileNumber": "9876543210",
 "requestType" : "CREDIT"
}

🚧

NOTE

A token generated with type: CREDIT cannot be used for the usual debit flows and the one with type: WALLET cannot be used for the M2C flow.

Sample Request for Direct Debit & Auth Capture Flow

{
 "merchantId": "UATMERCHANT",
 "mobileNumber": "9876543210",
 "requestType" : "WALLET"
}

🚧

NOTE

A token generated with type: WALLET cannot be used in any other userAuthToken supporting flows (Credit). This linking acts as consent from the user for the merchant to view their wallet balance & debit from their wallet.

Request Parameters

Parameter NameTypeDescriptionMandatory
merchantIdstringUnique merchantId assigned to the merchantYes
mobileNumberstringMobile Number on which OTP will be sentYes
requestTypestringShould take the value CREDIT or WALLET
Note:
Pass CREDIT for M2C Flow
Pass WALLET for Direct Debit & Auth Capture Flow
Yes
emailstringEmail ID of the customerNo
shortNamestringName of the customerNo

Response Parameters

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

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

Response Data

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.

Language
Click Try It! to start a request and see the response here!