Direct Wallet Debit

API to debit the money directly from PhonePe wallet.

<html-block html=”

Request Headers

“>

Header NameHeader Value
Content-Typeapplication/json
X-VERIFYSHA256(base64 encoded payload +
‘ /v3/debit/instant’ + salt key) +
‘###’ + salt index
{
 "merchantId": "DemoMerchant",
 "transactionId": "TX123456789",
 "userAuthToken":"1604832205579140b0931ce0abbb450b9a40e81ed06ce216",
 "amount": 100,
 "merchantOrderId": "OD1234",
 "subMerchant": "DemoMerchant",
 "message": "Payment for order OD1234"
}
{
 "request" : "ew0KCeKAnG1lcmNoYW50SWTigJ06IOKAnEpJT+KAnSwNCgnigJx0cmFuc2FjdGlvbklk4oCdOiDigJxUWE4xMjM0NeKAnSwNCgnigJxtZXJjaGFudE9yZGVySWTigJ0gOiDigJxPNDIzODTigJ0sDQoJ4oCcbW9iaWxlTnVtYmVy4oCdOiDigJw5ODc2NTQzMjEw4oCdLA0KCeKAnG1lcmNoYW50VXNlcklk4oCdOiDigJxVU0VSMTIzNDXigJ0sDQoJ4oCcZW1haWw6IOKAnG5pc2hhbnQubUBnbWFpbC5jb23igJ0sDQoJ4oCcc2hvcnROYW1l4oCdIDog4oCcTmlzaGFudCBNaXR0YWzigJ0NCn0="
}

<html-block html=”

Request Parameters

“>

Parameter NameTypeDescriptionMandatory
merchantIdstringUnique merchant id assigned to the merchantYes
transactionIdstringUnique Transaction ID generated by the merchant to track this request to PhonePeYes
amountintAmount in paiseYes
mobileNumberstringMobile number on which OTP will be sentYes
merchantOrderIdstringOrder ID for the merchant transactionYes
userAuthTokenstringAuth token generated from otp verifyYes
emailstringEmail id of customerNo
shortNamestringName of customerNo

<html-block html=”

Response Parameters

“>

Parameter NameTypeDescription
successbooleanDenotes if API call is successful.
codestringSee below for list of values
dataobjectSee below table
messagestringShort message about code

<html-block html=”

Response Codes

“>

CodeDescription
INVALID_TRANSACTION_IDDuplicate TransactionID
BAD_REQUESTInvalid request payload
AUTHORIZATION_FAILEDIncorrect X-VERIFY header
INTERNAL_SERVER_ERRORSomething went wrong
INVALID_USER_AUTH_TOKENThe userAuthToken provided is either invalid or not mapped to merchant.
PAYMENT_SUCCESSPayment is successful
PAYMENT_ERRORPayment failed
USER_BLACKLISTEDCustomer is blacklisted on PhonePe side
MERCHANT_USER_NOT_FOUNDNo user exists for merchant id and user id combination.
USER_BLOCKEDUser is blocked for 1 day.
TIMED_OUTPayment timed out (Status check is required)

<html-block html=”

Response Data

“>

Parameter NameTypeDescription
transactionIdStringUnique Transaction ID generated by the merchant to track this request to PhonePe
merchantIdStringUnique Merchant ID assigned to the merchant by PhonePe
amountLongTransaction amount in paise
statusStringStatus of the request
merchantUserIdStringUnique ID assigned to the user by the merchant. This is used for linking the user’s PhonePe account.
mobileNumberStringMobile number of the user
providerReferenceIdStringPhonePe transaction id
payResponseCodeStringPhonePe internal status code
{“method”:”post”,”url”:”/v3/debit/instant”,”auth”:”required”,”results”:{“codes”:[{“status”:200,”language”:”json”,”code”:”{\n \”success\”: true,\n \”code\”: \”PAYMENT_SUCCESS\”,\n \”message\”: \”Your payment is successful.\”,\n \”data\”: {\n \”transactionId\”: \”TXtest2dfws3dfd124\”,\n \”amount\”: 10,\n \”merchantId\”: \”M2306160483220675579140\”,\n \”merchantUserId\”: null,\n \”status\”: \”SUCCESS\”,\n \”mobileNumber\”: \”9611640370\”,\n \”providerReferenceId\”: \”P1801082016589589866175\”,\n \”payResponseCode\”: \”SUCCESS\”\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”:”5a97e7099bd97200459f200c”},{“name”:”Content-Type”,”type”:”string”,”enumValues”:””,”default”:”application/json”,”desc”:””,”required”:true,”in”:”header”,”ref”:””,”_id”:”5a97e7099bd97200459f200b”},{“name”:”X-VERIFY”,”type”:”string”,”enumValues”:””,”default”:””,”desc”:”sha256(base64encodedRequest + “/v3/debit/instant” + saltKey) + \”###\” + saltIndex”,”required”:true,”in”:”header”,”ref”:””,”_id”:”5a97e7099bd97200459f200a”}],”apiSetting”:”5ecf9143b5bd210023b3b738″,”examples”:{“codes”:[]}}
https://mercury-uat.phonepe.com