Wallet


This API allows you to accept payments using PhonePe Wallet.

EnvironmentHTTP MethodAPI
SandboxPOSThttps://api-preprod.phonepe.com/apis/pg-sandbox/payments/v2/pay
ProductionPOSThttps://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 Header
Header NameHeader ValueDescription
Content-Typeapplication/json
AuthorizationO-Bearer <access_token>Pass access_token received in Authorization call
Request Parameters
Parameter NameData TypeMandatoryDescriptionConstraints
merchantOrderIdStringYesUnique merchant order id generated by merchant.Max Length = 63 charactersNo Special characters allowed except underscore “_” and hyphen “-“
amountLongYesOrder amount in paisa.Min Value = 100 (In paise)
metaInfoObjectNoMerchant 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.
paymentFlowObjectYesAdditional details required by this flow.
paymentFlow.typeStringYesType of payment mode.Allowed Value = PG
paymentMode.typeStringYesType of payment modeAllowed 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"
        }
    }
}
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 NameData TypeDescription
orderIdStringPG generated internal order id.
stateStringState of the order created, Expected value is CREATED.
expiryAtLongOrder expiry date in epoch (in milliseconds).
intentUrlStringUrl where merchant is supposed to redirect user to complete payment.
headers
body params
Is this article helpful?