Pay call with selected instrument

API to pay using selected instrument

{  
   "merchantId":"TESTMERCHANT",
   "transactionId":"TX1234",
   "merchantOrderId":"ORDERID",
   "userAuthToken":"TXX",
   "amount":100, //total amount
   "paymentSources":[  
      {  
         "mode":"card",
         "cardId":"C1234",
         "cardIssuer":"VISA",
         "type":"DEBIT_CARD",
         "cvv":"123",
         "cardHolderName":"PhonePe User"
      },
      {  
         "mode":"wallets",
         "providers":[  //taking list here for multiple wallet providers
            "PHONEPE" 
         ]
      }
   ]
}
{  
 "request": "eyAgCiAgICJtZXJjaGFudElkIjoiVEVTVE1FUkNIQU5UIiwKICAgInRyYW5zYWN0aW9uSWQiOiJUWDEyMzQiLAogICAibWVyY2hhbnRPcmRlcklkIjoiT1JERVJJRCIsCiAgICJ1c2VyQXV0aFRva2VuIjoiVFhYIiwKICAgImFtb3VudCI6MTAwLAogICAicGF5bWVudFNvdXJjZXMiOlsgIAogICAgICB7ICAKICAgICAgICAgIm1vZGUiOiJjYXJkIiwKICAgICAgICAgImNhcmRJZCI6IkMxMjM0IiwKICAgICAgICAgImNhcmRJc3N1ZXIiOiJWSVNBIiwKICAgICAgICAgInR5cGUiOiJERUJJVF9DQVJEIiwKICAgICAgICAgImN2diI6IjEyMyIsCiAgICAgICAgICJjYXJkSG9sZGVyTmFtZSI6IlBob25lUGUgVXNlciIKICAgICAgfSwKICAgICAgeyAgCiAgICAgICAgICJtb2RlIjoid2FsbGV0cyIsCiAgICAgICAgICJwcm92aWRlcnMiOlsKICAgICAgICAgICAgIlBIT05FUEUiIAogICAgICAgICBdCiAgICAgIH0KICAgXQp9"
}

🚧

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

{  
   "merchantId":"TESTMERCHANT",
   "transactionId":"TX1234",
   "merchantOrderId":"ORDERID",
   "userAuthToken":"TXX",
   "amount":100, //total amount
   "paymentSources":[  
      {  
         "mode":"upi",
         "type":"INLINE",
         "accountId":"AC1234"
      }
   ]
}
{  
 "request": "eyAgCiAgICJtZXJjaGFudElkIjoiVEVTVE1FUkNIQU5UIiwKICAgInRyYW5zYWN0aW9uSWQiOiJUWDEyMzQiLAogICAibWVyY2hhbnRPcmRlcklkIjoiT1JERVJJRCIsCiAgICJ1c2VyQXV0aFRva2VuIjoiVFhYIiwKICAgImFtb3VudCI6MTAwLCAKICAgImRldmljZUlkIjoiRDEyMzQiLAogICAicGF5bWVudFNvdXJjZXMiOlsgIAogICAgICB7ICAKICAgICAgICAgIm1vZGUiOiJ1cGkiLAogICAgICAgICAidHlwZSI6IklOTElORSIsCiAgICAgICAgICJhY2NvdW50SWQiOiJBQzEyMzQiCiAgICAgIH0KICAgXQp9"
}
{  
   "merchantId":"TESTMERCHANT",
   "userAuthToken":"TXX",
   "amount":7875,
   "transactionId":"TX10909099992",
   "merchantOrderId":"TX109090923",
   "paymentSources":[  
      {  
         "mode":"upi",
         "type":"INTENT"
      }
   ]
}
{  
 "request": "eyAgCiAgICJtZXJjaGFudElkIjoiVEVTVE1FUkNIQU5UIiwKICAgInVzZXJBdXRoVG9rZW4iOiJUWFgiLAogICAiYW1vdW50Ijo3ODc1LAogICAidHJhbnNhY3Rpb25JZCI6IlRYMTA5MDkwOTk5OTIiLAogICAibWVyY2hhbnRPcmRlcklkIjoiVFgxMDkwOTA5MjMiLAogICAicGF5bWVudFNvdXJjZXMiOlsgIAogICAgICB7ICAKICAgICAgICAgIm1vZGUiOiJ1cGkiLAogICAgICAgICAidHlwZSI6IklOVEVOVCIKICAgICAgfQogICBdCn0="
}
{  
   "merchantId":"TESTMERCHANT",
   "transactionId":"TX1234",
   "merchantOrderId":"ORDERID",
   "userAuthToken":"TXX",
   "amount":100, //total amount
   "paymentSources":[  
      {  
         "mode":"wallets",
         "providers":[  //taking list here for multiple wallet providers
            "PHONEPE" 
         ]
      }
   ]
}
{  
 "request": "eyAgCiAgICJtZXJjaGFudElkIjoiVEVTVE1FUkNIQU5UIiwKICAgInRyYW5zYWN0aW9uSWQiOiJUWDEyMzQiLAogICAibWVyY2hhbnRPcmRlcklkIjoiT1JERVJJRCIsCiAgICJ1c2VyQXV0aFRva2VuIjoiVFhYIiwKICAgImFtb3VudCI6MTAwLAogICAicGF5bWVudFNvdXJjZXMiOlsgIAogICAgICB7ICAKICAgICAgICAgIm1vZGUiOiJ3YWxsZXRzIiwKICAgICAgICAgInByb3ZpZGVycyI6WwogICAgICAgICAgICAiUEhPTkVQRSIgCiAgICAgICAgIF0KICAgICAgfQogICBdCn0="
}

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!