PaymentLink API
PaymentLink API is used to send a payment request to the customer’s mobile number via a text message.
UAT Endpoints:POST https://mercury-uat.phonepe.com/enterprise-sandbox/v3/payLink/init
Prod Endpoints:POST https://mercury-t2.phonepe.com/v3/payLink/init
Request Headers
| Header Name | Header Value |
|---|---|
Content-Type | application/json |
X-VERIFY | SHA256(base64 encoded payload + “/v3/payLink/init” + salt key) + ### + salt index |
X-PROVIDER-ID | Used for the cases where the merchants are getting onboarded via their Providers |
X-CALLBACK-URL | Merchants need to pass their Callback URL to receive automated callbacks/ webhooks from Phonepe post performing transactions |
Sample Request JSON
{
"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"
}Encoded Request Body
{
"request": "ewogIm1lcmNoYW50SWQiOiJVQVRNRVJDSEFOVDEwMSIsCiAidHJhbnNhY3Rpb25JZCI6IkE2NjEiLAogIm1lcmNoYW50T3JkZXJJZCI6Ik0xMjM0NTY3ODkiLAogImFtb3VudCI6MTAwLAogIm1vYmlsZU51bWJlciI6IjcwNjUyNjU0MDciLAogIm1lc3NhZ2UiOiJjb2xsZWN0IGZvciAxIG9yZGVyIiwKICJleHBpcmVzSW4iOjM2MDAsCiAic2hvcnROYW1lIjoiRGVtb0N1c3RvbWVyIiwKICJzdWJNZXJjaGFudElkIjoiRGVtb01lcmNoYW50Igp9"
}Sample Response JSON
{
"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 Name | Data Type | Description |
|---|---|---|
| success | Boolean | Success status of the request |
| code | ENUM | Status of the transaction |
| message | String | Short message about status of request |
| data | JSON | DATA JSON Object |
Data JSON Object
| Parameter Name | Data Type | Description |
|---|---|---|
| transactionId | String | Unique Transaction ID generated by the merchant to track this request to PhonePe |
| amount | LONG | Transaction amount in paise |
| merchantId | String | Unique Merchant ID assigned to the merchant by PhonePe |
| payLink | Short URL | Payment link to be shared with customer |
| mobileNumber | String | Mobile Number |
| storeId | String | Store ID |
| terminalId | String | Terminal ID |