Wallet
This API allows you to accept payments using PhonePe Wallet.
Environment
| Environment | HTTP Method | API |
| Sandbox | POST | https://api-preprod.phonepe.com/apis/pg-sandbox/payments/v2/pay |
| Production | POST | https://api.phonepe.com/apis/pg/payments/v2/pay |
⚠️ Setup Required to Avoid Errors!
Before initiating a payment, install the PhonePe Test App and configure the payment template. Skipping this step may result in HTTP 500 errors.
Request
Request Header
| Header Name | Header Value | Description |
| Content-Type | application/json | |
Authorization | O-Bearer <access_token> | Pass access_token received in Authorization call |
Request Parameters
| Parameter Name | Data Type | Mandatory | Description | Constraints |
merchantOrderId | String | Yes | Unique merchant order id generated by merchant. | Max Length = 63 charactersNo Special characters allowed except underscore “_” and hyphen “-“ |
amount | Long | Yes | Order amount in paisa. | Min Value = 100 (In paise) |
metaInfo | Object | No | Merchant defined meta info to store additional information.same data will be returned in status and callback response. | • Maximum length for Udf1-10 = 256 characters • Maximum length for Udf11-15 = 50 characters. • It is mandatory to keep the parameter names udf1, udf2, etc., exactly as they are in the metainfo block. Renaming these key values will result in a production error. |
paymentFlow | Object | Yes | Additional details required by this flow. | |
paymentFlow.type | String | Yes | Type of payment mode. | Allowed Value = PG |
paymentMode.type | String | Yes | Type of payment mode | Allowed Value = PPE_INTENT |
Sample Request
{
"merchantOrderId": "TEST_ORD40818880083005126484",
"amount": 100,
"metaInfo": {
"udf1": "dummy1",
"udf2": "dummy2",
"udf3": "dummy3",
"udf4": "dummy4"
},
"paymentFlow": {
"type": "PG",
"paymentMode": {
"type": "PPE_INTENT"
}
}
}Response
Sample Response
{
"orderId": "OMO2607081554379831364394V",
"state": "PENDING",
"expireAt": 1783506877970,
"intentUrl": "ppe://pay?pa=PRODTEST1@ybl&pn=Infinity%20Prod%20Test%201&am=1.00&mam=1.00&tr=OM2607081554380031364801V&tn=Payment%20for%20TEST_ORD40818880083005126484&mc=6051&mode=04&purpose=00&utm_campaign=B2B_PG&utm_medium=PRODTEST1&utm_source=OM2607081554380031364801V",
}| Field Name | Data Type | Description |
orderId | String | PG generated internal order id. |
state | String | State of the order created, Expected value is CREATED. |
expiryAt | Long | Order expiry date in epoch (in milliseconds). |
intentUrl | String | Url where merchant is supposed to redirect user to complete payment. |
Try it yourself!
headers
body params