Request Headers
Header Name | Header Value |
---|---|
Content-Type | application/json |
X-VERIFY | SHA256(base64 encoded payload + “/v4/debit” + salt key) + ### + salt index |
X- CALLBACK-URL | S2S callback url |
X-CALL-MODE | S2S call mode (POST/ PUT) |
Sample payload for base64{
"merchantId": "M2306160483220675579140", // String Mandatory
"transactionId": "e3e1mmcccdmm9ef8vdfmd7b", // String Mandatory
"merchantUserId": "unknown8898", // String Mandatory - used for auto login.
"amount": 200, // long Mandatory - amount should be in paise
"merchantOrderId": "OD139924923", // String Mandatory
"subMerchant": "unknown8898", // String - ONLY if sub merchant id is allocated to you
"mobileNumber": "unknown8898", // String - mobile number of the user
"message": "Payment towards order No. OD139924923.", // String - message will be displayed on completion of payment.
"email": "xMerchantId", // String - email id of the user.
"shortName": "OD139924923", // String - user name is pre filled for registration purpose.
"paymentScope": "PHONEPE", // String Mandatory - value should be PHONEPE only
"deviceContext":{ // Object Mandatory
"phonePeVersionCode": 303391 // Long Mandatory - returns intent URI
}
}
// transactionId length should be less than 38 characters.
// merchantOrderId length should be less than 48 characters.
Request Parameters
Parameter Name | Type | Description | Mandatory |
merchantId | STRING | Unique MerchantID assigned to the merchant by PhonePe | Yes |
transactionId | STRING | Unique TransactionID generated by the merchant to track request to PhonePetransactionId length should be less than 38 characters. | Yes |
merchantUserId | STRING | Unique UserID generated by merchant. This is used to pre-login users authenticated on PhonePe. Un-authenticated users are redirected to PhonePe login page. Conversions are higher when this is provided. Avoid passing email/mobile number.Skip this for guest users. Note: | Yes |
userAuthToken | STRING | Unique userAuthToken given to merchant in OTP flow. This is used to pre-login users authenticated on PhonePe. If not passed users will be redirected to PhonePe login page.Note : Used only for OTP linking flow. | Only for OTP linking flow. |
amount | LONG | Transaction amount in Paise | Yes |
merchantOrderId | STRING | OrderID generated by the merchantmerchantOrderId length should be less than 48 characters. | Yes |
subMerchant | STRING | Tag to categorize merchant transaction. Skip this field if you don’t have multiple merchants tagged under one merchant id. | No |
mobileNumber | STRING | Mobile number of the user | No |
message | STRING | Short message. This message is displayed to the user on completion of payment. | No |
email | STRING | Email address of the user | No |
shortName | STRING | User’s name pre-filled for registration purpose. | No |
paymentScope | STRING | Value should be “PHONEPE” | Yes |
deviceContext | OBJECT | PhonePe version code | Yes |
merchantContext | OBJECT | Refer Deep Offer API | No |
Response Parameters
Parameter Name | Type | Description |
---|---|---|
success | BOOLEAN | Success status of the request |
code | ENUM | See list of response codes below |
{“method”:”post”,”url”:”/v4/debit”,”auth”:”required”,”examples”:{“codes”:[]},”apiSetting”:”5ecf9143b5bd210023b3b738″,”results”:{“codes”:[{“name”:””,”code”:”{\n\t\”code\”: \”SUCCESS\”,\n\t\”message\”: \”Your request has been successfully completed.\”,\n\t\”data\”: {\n\t\t\”redirectType\”: \”INTENT\”,\n\t\t\”redirectURL\”: \”upi://pay? \tpn=PAYU&pa=PAYUPAYMENTS@ybl&tid=YBL6663638d0312408a8f54f7df8f1bd6b9&tr=P1812191027266848105909&am=405.00&mam=405.00&cu=INR&url=https://phonepe.com&mc=7299&tn=Payment%20for%207787496005&utm_source=7787496005&utm_medium=PAYUPAYMENTS&utm_campaign=DEBIT\”\n\t}\n}\n\n\n”,”language”:”json”,”status”:200},{“name”:””,”code”:”{\n \”success\”: false,\n \”code\”: \”INVALID_TRANSACTION_ID\”,\n \”message\”: \”The transaction id you have entered seems to be invalid.\”,\n \”data\”: {}\n}”,”language”:”json”,”status”:400}]},”params”:[{“name”:”request”,”type”:”string”,”enumValues”:””,”default”:””,”desc”:”base64 encoded payload”,”required”:false,”in”:”body”,”ref”:””,”_id”:”5c4ed5db77417c00395f31d3″},{“name”:”Content-Type”,”type”:”string”,”enumValues”:””,”default”:”application/json”,”desc”:””,”required”:true,”in”:”header”,”ref”:””,”_id”:”5c4ed5db77417c00395f31d2″},{“name”:”X-VERIFY”,”type”:”string”,”enumValues”:””,”default”:””,”desc”:”SHA256(base64 encoded payload + \”/v4/debit\” + salt key) + ### + salt index”,”required”:true,”in”:”header”,”ref”:””,”_id”:”5c4ed5db77417c00395f31d1″},{“name”:”X-CALLBACK-URL”,”type”:”string”,”enumValues”:””,”default”:””,”desc”:”S2S callback url”,”required”:false,”in”:”header”,”ref”:””,”_id”:”5c4ed5db77417c00395f31ce”},{“name”:”X-CALL-MODE”,”type”:”string”,”enumValues”:””,”default”:””,”desc”:”S2S call mode (POST/ PUT)”,”required”:false,”in”:”header”,”ref”:””,”_id”:”5c4ed5db77417c00395f31cd”}]}
https://api-preprod.phonepe.com/apis/pg-sandbox