This API is used to initiate the refund.
Host Details
Environment | Http Method | Value |
---|---|---|
UAT | POST | https://api-preprod.phonepe.com/apis/pg-sandbox |
PROD | POST | https://api.phonepe.com/apis/pg |
Endpoint
/payments/v2/refund – Endpoint is common for UAT and Production.
Complete Host Details
Environment | Http Method | Value |
---|---|---|
UAT | POST | https://api-preprod.phonepe.com/apis/pg-sandbox/payments/v2/refund |
PROD | POST | https://api.phonepe.com/apis/pg/payments/v2/refund |
Request Details
Copied !
Request Headers
Header Name | Header Value |
---|---|
Content-Type | application/json |
Authorization | O-Bearer <access_token> |
Request Parameters
Parameter Name | Data Type | Mandatory(Y/N) | Description | Constraints |
---|---|---|---|---|
merchantRefundId | String | Yes | Unique merchant refund id generated by merchant. | Max Length = 63 characters |
originalMerchantOrderId | String | Yes | Original merchant order id against which refund is required. | |
amount | Long | Yes | Amount 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 Name | Header Value |
---|---|
Content-Type | application/json |
Response Payload
Case 1: Refund initiated successfully
{
"refundId": "OMRxxxxx"
"amount": 1234,
"state": "PENDING"
}
Response Field Details
Field Name | Data Type | Description |
---|---|---|
refundId | String | PG generated internal refund id |
amount | Long | Amount in paisa to refund |
state | String | refund state, expected value = PENDING |