<html-block html=”
“>
Header Name | Header Value |
---|---|
Content-Type | application/json |
X-VERIFY | SHA256(base64 encoded payload + “/v3/qr/init” + salt key) + ### + salt index |
X-CALLBACK-URL | URL on which server to server response is required once payment is done |
X-CALL-MODE | HTTP mode to be used for callback. Default Value: POST |
{
"request": "ewoJIm1lcmNoYW50SWQiOiJNMjMwNjE2MDQ4MzIyMDY3NTU3OTE0MCIsCgkidHJhbnNhY3Rpb25JZCI6IlRYMzIzMjE4NDk2NDQyMzQiLAoJImFtb3VudCI6MTAwMCwKCSJzdG9yZUlkIjoiMjM0NTU1IiwKCSJ0ZXJtaW5hbElkIjoiODk0MjM3Igp9"
}
<html-block html=”
“>
Parameter Name | Type | Description | Mandatory |
---|---|---|---|
merchantId | STRING | Unique MerchantID assigned to the merchant by PhonePe | Yes |
subMerchantId | STRING | Unique identity of end merchant | No |
storeId | STRING | Same as subMerchantId | No |
terminalId | STRING | Unique terminal Id for each POS device | No |
transactionId | STRING | Unique transactionId | Yes |
amount | LONG | Amount in Paise | Yes |
expiresIn | LONG | Expiry time in seconds | Yes |
merchantOrderId | STRING | OrderId. This can be same as transactionId | No |
message | STRING | Message for customer | No |
{
"success": true,
"code": "SUCCESS",
"message": "Your request has been successfully completed.",
"data": {
"merchantId": "M2306160483220675579140",
"transactionId": "TX32321849644234",
"amount": 1000,
"qrString": "upi://pay?pn=MERCHANT&pa=M2306160483220675579140@ybl&tid=YBL60c7891e33cb42daaf86b0aeb992a8b9&tr=P1806151323093900554957&am=10.00&cu=INR&url=https://phonepe.com&mc=5311&tn=Payment%20for%20P1806151323093900554957"
}
}
<html-block html=”
“>
Code | Description |
---|---|
INVALID_TRANSACTION_ID | Duplicate TransactionID |
BAD_REQUEST | Invalid request payload |
AUTHORIZATION_FAILED | Incorrect X-VERIFY header |
INTERNAL_SERVER_ERROR | Something went wrong |
SUCCESS | API successful |
Sample Codes##
Sample code can be downloaded from the link mentioned below:-
URL: https://phon.pe/uh822h5f,
Password: OQ9qgKB9jp
{“method”:”post”,”url”:”/v3/qr/init”,”auth”:”required”,”results”:{“codes”:[{“status”:200,”language”:”json”,”code”:”{}”,”name”:””},{“status”:400,”language”:”json”,”code”:”{}”,”name”:””}]},”params”:[{“name”:”request”,”type”:”string”,”enumValues”:””,”default”:””,”desc”:”base64 encoded payload”,”required”:true,”in”:”body”,”ref”:””,”_id”:”5b33509909875c0003cd7b18″},{“name”:”X-VERIFY”,”type”:”string”,”enumValues”:””,”default”:””,”desc”:”SHA256(base64 encoded payload + \”/v3/qr/init\” + salt key) + ### + salt index”,”required”:true,”in”:”header”,”ref”:””,”_id”:”5b33509909875c0003cd7b17″},{“name”:”X-CALL-MODE”,”type”:”string”,”enumValues”:””,”default”:””,”desc”:”HTTP mode to be used for UI callback. Default Values are POST.”,”required”:false,”in”:”header”,”ref”:””,”_id”:”5b3350c906aa32000399ead3″},{“name”:”X-CALLBACK-URL”,”type”:”string”,”enumValues”:””,”default”:””,”desc”:”Dynamic callback URI for server to server callback”,”required”:true,”in”:”header”,”ref”:””,”_id”:”5b3350c906aa32000399ead2″},{“name”:”Content-Type”,”type”:”string”,”enumValues”:””,”default”:”application/json”,”desc”:””,”required”:false,”in”:”header”,”ref”:””,”_id”:”5b3350c906aa32000399ead1″}],”apiSetting”:”5ecf9143b5bd210023b3b738″,”examples”:{“codes”:[]}}
https://mercury-uat.phonepe.com