---
title: Refund
description: This API can be used to initiate refund from the merchant’s platform. The partial and full refund can be requested.
---

# REFUND - Refund

This API can be used to initiate refund from the merchant’s platform. The partial and full refund can be requested. For partial amount, the amount needs to be filled by the merchant.

## POST

```
https://kraken.airpay.co.in/airpay/api/refundtxn.php
```

## Header

| Field | Type | Description |
| --- | --- | --- |
| Content-Type | String | application/json |

## Parameter

| Field | Type | Description |
| --- | --- | --- |
| merchant_id | Numeric | Merchant id (length 1-20) (required) |
| private_key | Alphanumeric | Private key (length 10-200) (required)<br>private_key = hash('sha256', secret.'@'.username.':|:'.password) |
| mode | String | Mode "refund" (required) |
| transactions | Array | Transaction contains Airpay id and Amount (required) |
| checksum | Alphanumeric | Checksum (length 10-200) (required)<br>date = YYYY-MM-DD<br>transactions = [{ "amount": "","processor_id": ""}, { "amount": "","processor_id": "" }]<br>alldata = merchant_id.mode.transactions.date<br>Key generated by : key = hash('SHA256',username."~:~".password)<br>Hash generated by : hash('SHA256', key.'@'.alldata) |
## Request-Example:

```
HTTP/1.1 200 OK

     {
         "merchant_id": "1001",
         "private_key": "dffoffndfsfddda1ufft",
         "mode": "refund",
         "checksum" : "sdf67dfsasdfoffndfsfddda563451ufft454",
         "transactions": [
                             { "amount": "10.00", "processor_id": "5001" },
                             { "amount": "15.00", "processor_id": "5002"},
                             { "amount": "50.00", "processor_id": "5005"},
                             { "amount": "100.00", "processor_id": "5007" },
                             { "amount": "300.00", "processor_id": "5006" },
                             { "amount": "70.00", "processor_id": "5003" },
                             { "amount": "7000.00" ,"processor_id": "5004"}
                         ]
      }
```

## Success 200

| Field | Type | Description |
| --- | --- | --- |
| mercid | Numeric | Merchant id |
| mode | String | Mode |
| success | String | String "true" or "false" |
| message | String | refund message |
| transactions | Alphanumeric | Transaction list<br>airpayid - Transaction ID from airpay<br>refundairpayid - Child transaction id for this transaction<br>success - "true" or "false"<br>message - Refund message |

## Success-Response:

```
    HTTP/1.1 200 OK
{
	"mercid": "1001",
	"mode": "refund",
	"success": "true",
	"message": "",
	"transactions":[
		{ "airpayid": "5001","success": "true" ,"amount": "10.00", "message": "Refund initiated successfully for transaction id 5001 ,child id 500101 with transaction amount 10.00" , "refundairpayid": "500101" },
		{ "airpayid": "5002","success": "false","amount": "15.00", "message": "Transaction does not exist." , "refundairpayid": ""},
		{ "airpayid": "5005","success": "true", "amount": "50.00", "message": "Refund initiated successfully for transaction id 5005 ,child id 500501 with transaction amount 50.00" , "refundairpayid": "500501"},
		{ "airpayid": "5007","success": "false","amount": "100.00","message": "Refund Amount greater than transaction amount.", "refundairpayid": "" }]
}
```
## Failed-Response:
```
HTTP/1.1 200 OK
{
     "mercid": "1001",
     "mode": "refund",
     "success": "false",
     "message": "Refund amount should be less than or equal to the balanced transaction amount.",
}
```