# Refund payments on blocked address

**POST** `https://api.heleket.com/v1/wallet/blocked-address-refund`

You can make a refund only once.

## Request

### Body parameters

| Name | Parameter type | Definition |
| --- | --- | --- |
| uuid | string<br>uuid<br>required\_without: order\_id| uuid of a static wallet |
| order\_id | string<br>min:1<br>max:32<br>alpha\_dash<br>required\_without: uuid| Order ID of a static wallet |
| address (required) | string<br>min:10<br>max:128<br>alpha\_dash| Refund all blocked funds to this address |

> To refund payments you need to pass either **uuid** or **order\_id**, if you pass both, the static wallet will be identified by _uuid_

### Request example

```
curl https://api.heleket.com/v1/wallet/blocked-address-refund \
-X POST \
-H 'merchant: 8b03432e-385b-4670-8d06-064591096795' \
-H 'sign: fe99035f86fa436181717b302b95bacff1' \
-H 'Content-Type: application/json' \
-d '{
    "order_id": "1",
      "address": "TK8..."
}'
```

## Response

### Response parameters

| Name | Definition |
| --- | --- |
| commission | Commission of refund |
| amount | Amount of refund |

### Response example

```
{
    "state": 0,
    "result": {
        "commission": "0.50",
        "amount": "9.50"
    }
}
```

## Possible errors

### Validation errors

code : 422

example responses:

If you will not pass a _uuid_ and _order\_id_, you will receive this message. It means that at least one of the parameters is required.

```
{
	"state": 1,
	"errors": {
		"uuid": ["validation.required_without"],
		"order_id": ["validation.required_without"]
	}
}
```

If static wallet was not found:

```
{
    "state": 1,
    "message": "Not found"
}
```

Al long as withdrawal is allowed only once from blocked static wallet, If the withdrawal was already made you will receive this error message:

```
{
    "state": 1,
    "message": "You can withdraw only once"
}
```

Al long as withdrawal is allowed only once from blocked static wallet, If you blocked a static wallet with a parameter _is\_force\_refund=true_, the withdrawal was already made and you will receive this error message:

```
{
    "state": 1,
    "message": "You can withdraw only once"
}
```

If refund is already in process:

```
{
    "state": 1,
    "message": "Refund is in process"
}
```

If the payout is blocked on your merchant or user, you will receive this error message. This happens, for example, when you change your password and payouts are blocked for 24 hours.

```
{
    "state": 1,
    "message": "You are forbidden"
}
```

If no payments were made to the static wallet:

```
{
    "state": 1,
    "message": "Nothing to withdraw"
}
```

If the payout amount is less than the minimum supported amount for cryptocurrency, you will receive this error message:

```
{
    "state": 1,
    "message": "The amount is too small"
}
```

If technical work occurs or the payout is temporarily unavailable, you will receive this error messages:

```
{
    "state": 1,
    "message": "Server error"
}
```

```
{
    "state": 1,
    "message": "The service was not found"
}
```

### Internal server error

code : 500

example responses:

```
{
	"message": "Server error, #1",
	"code": 500,
	"error": null
}
```
