The Refund Transaction for Partner integration can be used for the following purposes:
- Cancel a transaction that is in ‘auth’ state at the moment
- Refund a transaction that is in a ‘captured’ state at the moment.
Request parameters
Parameter | Description | Example |
---|---|---|
token mandatory |
| test_ref_0001 |
payu_id |
| 403993715529606983 |
amount |
| 500 |
reseller_id |
| 1212312213 |
merchant_id |
| 8238480 |
hash |
| 2a04a44ed058ca724a 17b4e4d4639aa15254a 343e0 |
Sample request
curl --location 'http://localhost:8080/apilayer/partner/refunds' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer 8c9177c718fc77046efe0d18192b98cadf798f2a136f2d31c7e09d60797403b5' \
--data '{
"refund_id": "test_ref_0001",
"payu_id": 403993715529606983,
"merchant_id": "8238480",
"reseller_id": "1212312213",
"hash": "8t7qweyuigadhsc8317",
"amount": 23.124
}'
Response parameters
Parameter | Fields | Sample Value |
---|---|---|
status |
| 1 |
msg |
| Refund Request Queued |
request_id |
| 6582898821 |
bank_ref_num |
| IRN6601148 |
mihpayid |
| 7043873219 |
error_code |
| 102 |
Sample response
Success scenario
{
"status": 1,
"msg": "Refund Request Queued",
"request_id": "12486538355",
"bank_ref_num": null,
"mihpayid": 17787245459,
"error_code": 102
}
Failure scenarios
- Invalid partner
- Error code=400
{
"message": "Partner with UUID 1212312213r is not allowed to do this action"
}
- Invalid auth token
- Error code=401
{
"message": "Invalid Auth token"
}
- Invalid Hash
- Error code=403
{
"message": "Invalid Hash"
}
- Refund request already exists
- Error code=200
{ "message": "refund request already exists for test_ref_0010" }
- Other possible responses:
- Error code=400
Failure Reason | Sample Response |
---|---|
Transaction with same amount and token | { |
Two refunds of same amount for same transaction within 5 minutes | { |
Invalid amount | { "status": 0, "msg": "Refund FAILURE - Invalid amount", "error_code": 105, "mihpayid": 17842967667 } |
Transaction does not exist | { |
If refund token already exists | {"status":0,"msg":"Refund FAILURE - Token already exists.","error_code":106,"mihpayid":403993715529339129} |
If request cannot be processed | { "status": "Refund request cannot be processed" } |
Invalid partner | {"status":0,"msg":"Invalid partner.","error_code":106,"mihpayid":403993715529339129} |