Initiate Refund and Check Refund Status


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
merchantRefundIdStringYesA unique refund ID that you create to identify the refund request.Max Length = 63 characters
originalMerchantOrderIdStringYesThe merchant OrderId for which you want to initiate the refund.
amountLongYesThe amount to be refunded, specified in paisa.Min Value = 1 paisa
Sample Request
{
    "merchantRefundId": "Refund-id-12345",
    "originalMerchantOrderId": "Order-12345",
    "amount": 1234
}

⚠️ Invalid Refund Amount!


The refund amount cannot exceed the initiated amount. It must always be less than or equal to the amount originally initiated.

Sample Response for Case 1: Refund initiated successfully
{
    "refundId": "OMRxxxxx"
    "amount": 1234,
    "state": "PENDING"
}
Response Parameters
Field NameData TypeDescription
refundIdStringPayment Gateway generated internal order ID.
amountLongRefund amount specified in paisa.
stateStringIndicates the current state of the refund process. Expected value: PENDING.
headers
body params

Refund status provides information about the current progress of a refund request. It helps track whether the refund is still pending, completed, or failed, ensuring that merchants can monitor and manage the refund process effectively.

EnvironmentHTTP MethodAPI
SandboxGEThttps://api-preprod.phonepe.com/apis/pg-sandbox/payments/v2/refund/{merchantRefundId}/status
ProductionGEThttps://api.phonepe.com/apis/pg/payments/v2/refund/{merchantRefundId}/status
Request Headers
Header NameHeader Value
Content-Typeapplication/json
AuthorizationO-Bearer <merchant-auth-token>
Sample Response for 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": "12****78@ybl"
            },
            "instrument": {
                "type": "ACCOUNT",
                "maskedAccountNumber": "******1234",
                "accountType": "SAVINGS"
            }
        }
    ]
}
Sample Response for Case 2: Original source of transaction = PPE_INTENT
{
    "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": "12****78@ybl"
            },
            "instrument": {
                "type": "ACCOUNT",
                "maskedAccountNumber": "******1234",
                "accountType": "SAVINGS"
            },
            "amount": 400
        },
        {
            "rail": {
                "type": "WALLET"
            },
            "instrument": {
                "type": "WALLET"
            },
            "amount": 100
        }
    ]
}
Response Parameters
Field NameData TypeDescription
originalMerchantOrderIdStringThe original merchant order ID is used to identify the transaction for which the refund is being processed.
amountStringThe amount to be refunded, specified in paisa.
stateStringRefund state, Expected values:
• PENDING
• CONFIRMED
• COMPLETED
• FAILED
timestampLongTimestamp of the transaction attempt in epoch (in milliseconds).
refundIdStringRefund Id generated by PhonePe.
errorCodeStringError code returned only if the transaction state is FAILED.
detailedErrorCodeStringDetailed error code returned only when the transaction state is FAILED.
splitInstruments.railStringIncludes details of the processing rail used for the payment attempt.
splitInstruments.rail.typeStringSpecifies the type of processing rail used. Expected values:
• UPI
• PG
splitInstruments.instrumentStringIncludes the details of the payment instrument used for the transaction.
splitInstruments.instrument.typeStringSpecifies the type of payment instrument used. Expected values:
• ACCOUNT
• CREDIT_CARD
• DEBIT_CARD
• NET_BANKING
headers
url params

You can also test this API request directly in Postman for a quick and easy integration check.

In this section, you’ve learned how to initiate a refund and check its status. In the next section, you’ll understand how payment verification is handled using webhooks, and how to manually verify the payment in case the webhook callback fails.

Is this article helpful?