Refund APIs

The Refund API allows you to initiate refunds for specific transactions, returning funds to customers for reasons like order cancellations, returns, or payment adjustments. This ensures smooth and direct refund processing through the payment gateway.

EnvironmentHTTP MethodAPI
SandboxPOSThttps://api-preprod.phonepe.com/apis/pg-sandbox/payments/v2/refund
ProductionPOSThttps://api.phonepe.com/apis/pg/payments/v2/refund
Request Headers
Header NameHeader Value
Content-Typeapplication/json
AuthorizationO-Bearer <merchant-auth-token>
Request Parameters
Field NameData TypeMandatory(Y/N)DescriptionConstraints
merchantRefundIdStringYesUnique merchant refund ID generated by the merchantMax Length = 63 characters
originalMerchantOrderIdStringYesOriginal merchant order ID against which refund is required
amountLongYesAmount in paisa to refundMin Value = 100
headers
body params
Invalid Refund Amount!
The refund amount cannot exceed the initiated amount. It must always be less than or equal to the amount originally initiated.
Case 1: Response for Refund initiated successfully
{
    "refundId": "OMRxxxxx"
    "amount": 1234,
    "state": "PENDING"
}
Response Parameters
Field NameData TypeDescription
refundIdStringPG generated internal refund ID
amountLongAmount in paisa to refund
stateStringRefund state; expected value = PENDING

The Refund Status API allows you to check the current status of a refund request. It helps you track whether the refund is pending, processed, failed, or completed, enabling you to keep your records up to date and provide accurate information to your customers.

EnvironmentHTTP MethodAPI
SandboxPOSThttps://api-preprod.phonepe.com/apis/pg-sandbox/payments/v2/refund/{merchantRefundId}/status
ProductionPOSThttps://api.phonepe.com/apis/pg/payments/v2/refund/{merchantRefundId}/status
Request Headers
Header NameHeader Value
Content-Typeapplication/json
AuthorizationO-Bearer <merchant-auth-token>
headers
url params
Case 1: Original source of transaction = UPI
{
    "originalMerchantOrderId": "Order123",
    "amount": 100,
    "state": "COMPLETED",
    "timestamp": 1730869961754,
    "refundId": "OMR7878098045517540996",
    "errorCode": "", // Only present in case of ERROR
    "detailedErrorCode": "",   // Only present in case of ERROR
    "splitInstruments": [
        {
            "amount": 100,
            "rail": {
                "type": "UPI",
                "utr": "586756785",
                "upiTransactionId": "YBL5bc011fa9f8644763b52b96a29a9655",
                "vpa": "xxx@xxx"
            },
            "instrument": {
                "type": "ACCOUNT",
                "maskedAccountNumber": "XXXXXXXXXXX7728",
                "accountType": "SAVINGS"
            }
        }
    ]
}
Case 2: Original source of transaction = PPE_INTENT (Wallet)
{
    "originalMerchantOrderId": "Order123",
    "amount": 500,
    "state": "COMPLETED",
    "timestamp": 1730869961754,
    "refundId": "OMR7878098045517540996",
    "errorCode": "", // Only present in case of ERROR
    "detailedErrorCode": "",   // Only present in case of ERROR
    "splitInstruments": [
        {
            "rail": {
                "type": "UPI",
                "utr": "586756785",
                "upiTransactionId": "YBL5bc011fa9f8644763b52b96a29a9655",
                "vpa": "abc@ybl"
            },
            "instrument": {
                "type": "ACCOUNT",
                "maskedAccountNumber": "XXXXXXXXXXX7728",
                "accountType": "SAVINGS"
            },
            "amount": 400
        },
        {
            "rail": {
                "type": "WALLET"
            },
            "instrument": {
                "type": "WALLET"
            },
            "amount": 100
        }
    ]
}
Case 3: Original source of transaction = NetBanking
{
    "originalMerchantOrderId": "TX1752742884088",
    "amount": 50,
    "state": "COMPLETED",
    "refundId": "OMR2507211657281836129569",
    "timestamp": 1753097248198,
    "splitInstruments": [
        {
            "instrument": {
                "type": "NET_BANKING",
                "bankId": "SBIN",
                "brn": "brn123"
            },
            "rail": {
                "type": "PG"
            },
            "amount": 50
        }
    ],
    "paymentDetails": [
        {
            "transactionId": "OMR2507211657281836129569",
            "paymentMode": "NET_BANKING",
            "timestamp": 1753097248198,
            "amount": 50,
            "state": "COMPLETED",
            "instrument": {
                "type": "NET_BANKING",
                "bankId": "SBIN"
            },
            "rail": {
                "type": "PG"
            },
            "splitInstruments": [
                {
                    "instrument": {
                        "type": "NET_BANKING",
                        "bankId": "SBIN"
                    },
                    "rail": {
                        "type": "PG"
                    },
                    "amount": 50
                }
            ]
        }
    ]
}
Response Parameters
Field NameData TypeDescription
originalMerchantOrderIdStringOriginal merchant order ID against which refund is initiated
amountLongAmount in paisa to refund
stateStringRefund state; Expected values:
PENDING
CONFIRMED
COMPLETED
FAILED
timestampLongTransaction attempt timestamp in epoch.
refundIdStringRefund Id generated by PhonePe.
errorCodeStringError code (Only present when transaction state is failed).
detailedErrorCodeStringDetailed Error Code (Only present when transaction state is failed).
splitInstruments.railStringContains processing rail details under which payment attempt is made.
splitInstruments.rail.typeStringType of rail. Expected values
UPI
PG
splitInstruments.instrumentStringContains instrument details.
splitInstruments.instrument.typeStringType of payment instrument. Expected values :
ACCOUNT
CREDIT_CARD
DEBIT_CARD
NET_BANKING
Is this article helpful?