post https://mercury-uat.phonepe.com/v3/merchant/inline/pay
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>"
}
Header Name | Header Value |
---|---|
Content-Type | application/json |
X-VERIFY | SHA256(base64 encoded payload + "/v3/merchant/inline/pay" + salt key) + ### + salt index |
Parameter Name | Type | Description | Mandatory |
---|---|---|---|
merchantId | STRING | Unique MerchantID assigned to the merchant by PhonePe | Yes |
transactionId | STRING | Unique merchant transaction id (merchants do a status check etc using this id). | Yes |
merchantUserId/ userAuthToken | STRING | User Id to identify user / token generated while linking user | Yes |
amount | LONG | Transaction amount in Paise | Yes |
merchantOrderId | STRING | Merchant order id | No |
paymentSources | ARRAY | List of payment sources (explained below) | Yes |
mobileNumber | STRING | Customers' mobile number | Yes |
CODE | Despcription |
---|---|
PAYMENT_INITIATED | Success scenario - will contain redirect url |
AUTHORIZATION_FAILED | Value of X-VERIFY is incorrect |
BAD_REQUEST | Some mandatory parameter is missing |
INTERNAL_SERVER_ERROR | Something went wrong |
INVALID_TRANSACTION_ID | If the transaction id is not unique |
INVALID_TRANSACTION_ID | Duplicate TransactionID |
INVALID_USER_AUTH_TOKEN | The userAuthToken provided is either invalid or not mapped to merchant. |
USER_BLACKLISTED | Customer is blacklisted on PhonePe side |
MERCHANT_USER_NOT_FOUND | No user exists for merchant id and user id combination. |
USER_BLOCKED | User 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.