Refund

This API is used to initiate the refund.

Host Details

EnvironmentHttp MethodValue
UATPOSThttps://api-preprod.phonepe.com/apis/pg-sandbox
PRODPOSThttps://api.phonepe.com/apis/pg

Endpoint

/payments/v2/refund – Endpoint is common for UAT and Production.

Complete Host Details

EnvironmentHttp MethodValue
UATPOSThttps://api-preprod.phonepe.com/apis/pg-sandbox/payments/v2/refund 
PRODPOSThttps://api.phonepe.com/apis/pg/payments/v2/refund 

Request Details

Request Headers

Header NameHeader Value
Content-Typeapplication/json
AuthorizationO-Bearer <access_token>

Request Parameters

Parameter NameData TypeMandatory(Y/N)DescriptionConstraints
merchantRefundIdStringYesUnique merchant refund id generated by merchant.Max Length = 63 characters
originalMerchantOrderIdStringYesOriginal merchant order id against which refund is required.
amountLongYesAmount in paisa to refund.Min Value = 1

Sample Request Body: 

{
    "merchantRefundId": "Refund-id-12345",
    "originalMerchantOrderId": "Order-12345",
    "amount": 1234
}

Send the above headers and payload to the below API to initiate the Refund : 

POST – https://api-preprod.phonepe.com/apis/pg-sandbox/payments/v2/refund

Response Details

Response Headers:

Header NameHeader Value
Content-Typeapplication/json

Response Payload

Case 1: Refund initiated successfully

{
    "refundId": "OMRxxxxx"
    "amount": 1234,
    "state": "PENDING"
}

Response Field Details

Field NameData TypeDescription
refundIdStringPG generated internal refund id
amountLongAmount in paisa to refund
stateStringrefund state, expected value = PENDING