PaymentLink API

PaymentLink API is used to send a payment request to the customer's mobile number via a text message.

PROD
Base Url: https://mercury-t2.phonepe.com
Paylink Endpoint: https://mercury-t2.phonepe.com/v3/payLink/init

<html-block html=”

Request Headers

“>

Header NameHeader Value
Content-Typeapplication/json
X-VERIFYSHA256(base64 encoded payload + “/v3/payLink/init” + salt key) + ### + salt index
X-PROVIDER-IDUsed for the cases where the merchants are getting onboarded via their Providers
X-CALLBACK-URLMerchants need to pass their Callback URL to receive automated callbacks/ webhooks from Phonepe post performing transactions
{
 "merchantId":"MERCHANTUAT",
 "transactionId":"TEST20231004021536",
 "merchantOrderId":"TEST20231004021536",
 "amount":100,
 "mobileNumber":"8296412345",
 "message":"paylink for 1 order",
 "expiresIn":3600,
 "storeId":"store1",
 "terminalId":"terminal1",
 "shortName":"DemoCustomer",
 "subMerchantId":"DemoMerchant"
}
{
    "request": "ewogIm1lcmNoYW50SWQiOiJVQVRNRVJDSEFOVDEwMSIsCiAidHJhbnNhY3Rpb25JZCI6IkE2NjEiLAogIm1lcmNoYW50T3JkZXJJZCI6Ik0xMjM0NTY3ODkiLAogImFtb3VudCI6MTAwLAogIm1vYmlsZU51bWJlciI6IjcwNjUyNjU0MDciLAogIm1lc3NhZ2UiOiJjb2xsZWN0IGZvciAxIG9yZGVyIiwKICJleHBpcmVzSW4iOjM2MDAsCiAic2hvcnROYW1lIjoiRGVtb0N1c3RvbWVyIiwKICJzdWJNZXJjaGFudElkIjoiRGVtb01lcmNoYW50Igp9"
}
{
    "success": true,
    "code": "SUCCESS",
    "message": "Your request has been successfully completed.",
    "data": {
        "transactionId": "TEST20231004021536",
        "amount": 100,
        "merchantId": "MERCHANTUAT",
        "upiIntent": "upi://pay?pa=MERCHANTUAT@ybl&pn=P2Mstore3&am=100&mam=100&tr=TEST20231004021536&tn=Payment%20for%20M123456789&mc=5192&mode=04&purpose=00",
        "payLink": "http://preprod.phon.pe/p3cgztr4",
        "mobileNumber": "8296412345"
    }
}

Response Body

Parameter NameData TypeDescription
successBooleanSuccess status of the request
codeENUMStatus of the transaction
messageStringShort message about status of request
dataJSONDATA JSON Object

Data JSON Object

Parameter NameData TypeDescription
transactionIdStringUnique Transaction ID generated by the merchant to track
this request to PhonePe
amountLONGTransaction amount in paise
merchantIdStringUnique Merchant ID assigned to the merchant by
PhonePe
payLinkShort URLPayment link to be shared with customer
mobileNumberStringMobile Number
storeIdStringStore ID
terminalIdStringTerminal ID
{“method”:”post”,”url”:”/v3/payLink/init”,”auth”:”required”,”results”:{“codes”:[{“name”:””,”code”:”{ \”success\”: true,\n \”code\”: \”SUCCESS\”,\n \”message\”:\”Your request has been successfully completed.\”,\n \”data\”:{}\n}”,”language”:”json”,”status”:200},{“name”:””,”code”:”{}”,”language”:”json”,”status”:400}]},”params”:[{“name”:”merchantId”,”type”:”string”,”enumValues”:””,”default”:””,”desc”:”Unique Merchant ID assigned to the merchant by PhonePe”,”required”:false,”in”:”path”,”ref”:””,”_id”:”5f310bd19c236501368dbec5″},{“name”:”transactionId”,”type”:”string”,”enumValues”:””,”default”:””,”desc”:”Unique Transaction ID generated by the merchant to track this request to PhonePe”,”required”:false,”in”:”path”,”ref”:””,”_id”:”5f310bd19c236501368dbec4″},{“name”:”Content-Type”,”type”:”string”,”enumValues”:””,”default”:”application/json”,”desc”:””,”required”:false,”in”:”header”,”ref”:””,”_id”:”5f310bd19c236501368dbec3″},{“name”:”X-VERIFY”,”type”:”string”,”enumValues”:””,”default”:””,”desc”:”SHA256(\”/v3/payLink/init\” + salt key) + ### + salt index”,”required”:false,”in”:”header”,”ref”:””,”_id”:”5f310bd19c236501368dbec2″}],”examples”:{“codes”:[]},”apiSetting”:”64c244096688b200429110a5″}
https://mercury-uat.phonepe.com/enterprise-sandbox