Pay call with selected instrument

{  
   "merchantId":"M2306160483220675579140",  // String Mandatory
   "transactionId":"TX1234",  // String Mandatory
   "merchantOrderId":"ORDERID",  // String Optional 
   "merchantUserId":"TXX",  // String Mandatory
   "amount":100,  //  Integer Mandatory
   "paymentSources":[  // Object Mandatory
      {  
         "mode":"card",   // String Mandatory 
         "cardId":"C1234",  // String Mandatory
         "cardIssuer":"VISA", // String Optional
         "type":"DEBIT_CARD", // String Optional
         "cvv":"123", // String Optional
         "cardHolderName":"PhonePe User" // String Optional
      },
      {  
         "mode":"wallets",  // String Mandatory 
         "providers":[  // String Mandatory - taking list here for multiple wallet providers
            "PHONEPE" 
         ]
      }
   ]
}
{  
 "request": "eyAgCiAgICJtZXJjaGFudElkIjoiTTIzMDYxNjA0ODMyMjA2NzU1NzkxNDAiLAogICAidHJhbnNhY3Rpb25JZCI6IlRYMTIzNCIsCiAgICJtZXJjaGFudE9yZGVySWQiOiJPUkRFUklEIiwKICAgIm1lcmNoYW50VXNlcklkIjoiVFhYIiwKICAgImFtb3VudCI6MTAwLCAvL3RvdGFsIGFtb3VudAogICAicGF5bWVudFNvdXJjZXMiOlsgIAogICAgICB7ICAKICAgICAgICAgIm1vZGUiOiJjYXJkIiwKICAgICAgICAgImNhcmRJZCI6IkMxMjM0IiwKICAgICAgICAgImNhcmRJc3N1ZXIiOiJWSVNBIiwKICAgICAgICAgInR5cGUiOiJERUJJVF9DQVJEIiwKICAgICAgICAgImN2diI6IjEyMyIsCiAgICAgICAgICJjYXJkSG9sZGVyTmFtZSI6IlBob25lUGUgVXNlciIKICAgICAgfSwKICAgICAgeyAgCiAgICAgICAgICJtb2RlIjoid2FsbGV0cyIsCiAgICAgICAgICJwcm92aWRlcnMiOlsgIC8vdGFraW5nIGxpc3QgaGVyZSBmb3IgbXVsdGlwbGUgd2FsbGV0IHByb3ZpZGVycwogICAgICAgICAgICAiUEhPTkVQRSIgCiAgICAgICAgIF0KICAgICAgfQogICBdCn0="
}

🚧

If the code is PAYMENT_INITIATED, need to check status of the transaction using transaction status API.

{  
   "merchantId":"M2306160483220675579140", // String Mandatory
   "transactionId":"TX1234", // String Mandatory
   "merchantOrderId":"ORDERID",   // String Optional
   "merchantUserId":"M1234", // String Mandatory
   "amount":100, // String Mandatory
   "deviceId":"D1234",// String Optional - Collect encrypted device Id from your android app.
   "paymentSources":[   // String Mandatory
      {  
         "mode":"upi",    // String Mandatory
         "type":"INLINE",   // String Mandatory
         "accountId":"AC1234"   // String Mandatory
      }
   ]
}
{  
 "request": "eyAgCiAgICJtZXJjaGFudElkIjoiTTIzMDYxNjA0ODMyMjA2NzU1NzkxNDAiLAogICAidHJhbnNhY3Rpb25JZCI6IlRYMTIzNCIsCiAgICJtZXJjaGFudE9yZGVySWQiOiJPUkRFUklEIiwKICAgIm1lcmNoYW50VXNlcklkIjoiTTEyMzQiLAogICAiYW1vdW50IjoxMDAsIC8vdG90YWwgYW1vdW50CiAgICJkZXZpY2VJZCI6IkQxMjM0IiwgLy9vcHRpb25hbCwgdG8gYmUgcHJvdmlkZWQgYnkgU0RLCiAgICJwYXltZW50U291cmNlcyI6WyAgCiAgICAgIHsgIAogICAgICAgICAibW9kZSI6InVwaSIsCiAgICAgICAgICJ0eXBlIjoiSU5MSU5FIiwKICAgICAgICAgImFjY291bnRJZCI6IkFDMTIzNCIKICAgICAgfQogICBdCn0="
}

🚧

For UPI inline requests, device id is an extra parameter. User will get redirected to PhonePe using the redirect url in the response.

{  
   "merchantId":"M2306160483220675579140",   // String Mandatory
   "merchantUserId":"M2306160487",   // String Mandatory
   "amount":7875,   // String Mandatory
   "transactionId":"TX10909099992",     // String Mandatory
   "merchantOrderId":"TX109090923",    // String Optional       
   "paymentSources":[     // String Mandatory
      {  
         "mode":"upi",   // String Mandatory
         "type":"INTENT"    // String Mandatory
      }
   ]
}
{  
 "request": "eyAgCiAgICJtZXJjaGFudElkIjoiTTIzMDYxNjA0ODMyMjA2NzU1NzkxNDAiLAogICAibWVyY2hhbnRVc2VySWQiOiJNMjMwNjE2MDQ4MzIyMDY3NTU3OTE0MDgwMTYxODcxMTYyNDQ2ZjI2ZGE2ZDRiNjciLAogICAiYW1vdW50Ijo3ODc1LAogICAidHJhbnNhY3Rpb25JZCI6IlRYMTA5MDkwOTk5OTIiLAogICAibWVyY2hhbnRPcmRlcklkIjoiVFgxMDkwOTA5MjMiLAogICAicGF5bWVudFNvdXJjZXMiOlsgIAogICAgICB7ICAKICAgICAgICAgIm1vZGUiOiJ1cGkiLAogICAgICAgICAidHlwZSI6IklOVEVOVCIKICAgICAgfQogICBdCn0="
}
{  
   "merchantId":"M2306160483220675579140",   // String Mandatory
   "transactionId":"TX1234",    // String Mandatory
   "merchantOrderId":"ORDERID",   // String Optional
   "merchantUserId":"TXX",   // String Mandatory
   "amount":100,  // String Mandatory
   "paymentSources":[      // String Mandatory
      {  
         "mode":"wallets",      // String Mandatory
         "providers":[    // String Mandatory - taking list here for multiple wallet providers
            "PHONEPE" 
         ]
      }
   ]
}
{  
 "request": "eyAgCiAgICJtZXJjaGFudElkIjoiVEVTVE1FUkNIQU5UIiwKICAgInRyYW5zYWN0aW9uSWQiOiJUWDEyMzQiLAogICAibWVyY2hhbnRPcmRlcklkIjoiT1JERVJJRCIsCiAgICJtZXJjaGFudFVzZXJJZCI6IlRYWCIsCiAgICJhbW91bnQiOjEwMCwgLy90b3RhbCBhbW91bnQKICAgInBheW1lbnRTb3VyY2VzIjpbICAKICAgICAgeyAgCiAgICAgICAgICJtb2RlIjoid2FsbGV0cyIsCiAgICAgICAgICJwcm92aWRlcnMiOlsgIC8vdGFraW5nIGxpc3QgaGVyZSBmb3IgbXVsdGlwbGUgd2FsbGV0IHByb3ZpZGVycwogICAgICAgICAgICAiUEhPTkVQRSIgCiAgICAgICAgIF0KICAgICAgfQogICBdCn0="
}

Request Headers

Header NameHeader Value
Content-Typeapplication/json
X-VERIFYSHA256(base64 encoded payload + "/v3/merchant/inline/pay" +
salt key) + ### + salt index

Request Parameters

Parameter NameTypeDescriptionMandatory
merchantIdSTRINGUnique MerchantID assigned to the merchant by PhonePeYes
transactionIdSTRINGUnique merchant transaction id (merchants do a status check etc using this id).Yes
merchantUserId/ userAuthTokenSTRINGUser Id to identify user / token generated while linking userYes
amountLONGTransaction amount in PaiseYes
merchantOrderIdSTRINGMerchant order idNo
paymentSources
ARRAYList of payment sources (explained below)Yes
deviceIdSTRINGFlag to indicate if user is otp verifiedNo

Response Codes

CODEDespcription
PAYMENT_INITIATED Success scenario - will contain redirect url(in
case of card/wallet) / intent url(in case of UPI)
AUTHORIZATION_FAILEDValue of X-VERIFY is incorrect
BAD_REQUESTSome mandatory parameter is missing
INTERNAL_SERVER_ERRORSomething went wrong
INVALID_TRANSACTION_IDIf the transaction id is not unique
PAYMENT_ERRORIf transaction fails due to reason not
mentioned above, like our payment service
fails or payment gateway is down

Transaction status check API:

After user is redirected to merchant page after completing the transaction, you can get the
status of transaction using transaction status api. Please use this link for reference.

Language
Click Try It! to start a request and see the response here!