New : Direct Debit API

API to pay using wallet directly.

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

{  
   "merchantId":"TESTMERCHANT",
   "transactionId":"TX1234",
   "merchantOrderId":"ORDERID",
   "merchantUserId":"TXX",
   "mobileNumber":"9123456789",
   "amount":100, //total amount
   "paymentSources":[  
      {  
         "mode":"wallets",
         "providers":[  //taking list here for multiple wallet providers
            "PHONEPE" 
         ]
      }
   ]
}
{  
 "request": "<Base64Encode>"
}

<html-block html=”

Request Headers

“>

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

<html-block html=”

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
mobileNumberSTRINGCustomers’ mobile numberYes

<html-block html=”

Response Codes

“>

CODEDespcription
PAYMENT_INITIATED Success scenario – will contain redirect url
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
INVALID_TRANSACTION_IDDuplicate TransactionID
INVALID_USER_AUTH_TOKENThe userAuthToken provided is either invalid or not mapped to merchant.
USER_BLACKLISTEDCustomer is blacklisted on PhonePe side
MERCHANT_USER_NOT_FOUNDNo user exists for merchant id and user id combination.
USER_BLOCKEDUser is blocked for 1 day.

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.

{“method”:”post”,”url”:”/v3/merchant/inline/pay”,”auth”:”required”,”results”:{“codes”:[{“name”:”Sample response”,”status”:200,”language”:”json”,”code”:”{ \n \”success\”:true,\n \”code\”:\”PAYMENT_INITIATED\”,\n \”data\”:{ \n \”redirectUrl\”:\”https://mercury.phonepe.com/1234\” \n }\n}”}]},”examples”:{“codes”:[]},”apiSetting”:”5ecf9143b5bd210023b3b738″,”params”:[{“name”:”request”,”type”:”string”,”enumValues”:””,”default”:””,”desc”:”base64 encoded payload”,”required”:true,”in”:”body”,”ref”:””,”_id”:”5b4c6d05bdd7010003e92300″},{“name”:”Content-Type”,”type”:”string”,”enumValues”:””,”default”:”application/json”,”desc”:””,”required”:true,”in”:”header”,”ref”:””,”_id”:”5b4c6d05bdd7010003e922ff”},{“name”:”X-VERIFY”,”type”:”string”,”enumValues”:””,”default”:””,”desc”:”SHA256(base64 encoded payload + \”/v3/merchant/inline/pay\” + salt key) + ### + salt index”,”required”:true,”in”:”header”,”ref”:””,”_id”:”5b4c6d05bdd7010003e922fe”},{“name”:”X-REDIRECT-URL”,”type”:”string”,”enumValues”:””,”default”:””,”desc”:”Dynamic redirect URI for UI callback”,”required”:false,”in”:”header”,”ref”:””,”_id”:”5c470f26138d190c350acb4e”},{“name”:”X-REDIRECT-MODE”,”type”:”string”,”enumValues”:””,”default”:””,”desc”:”HTTP mode to be used for UI callback. Default Values are REDIRECT/POST.”,”required”:false,”in”:”header”,”ref”:””,”_id”:”5c470f26138d190c350acb4d”},{“name”:”X-CALLBACK-URL”,”type”:”string”,”enumValues”:””,”default”:”https://www.demoMerchant.com/callback”,”desc”:”Dynamic callback URI for server to server callback”,”required”:false,”in”:”header”,”ref”:””,”_id”:”5c470f26138d190c350acb4c”},{“name”:”X-CALL-MODE”,”type”:”string”,”enumValues”:””,”default”:””,”desc”:”HTTP mode to be used for server to server callback. Default Values are POST/PUT”,”required”:false,”in”:”header”,”ref”:””,”_id”:”5c470f26138d190c350acb4b”}]}
https://mercury-uat.phonepe.com