# cancelTrade

> POST /trades/cancelTrade отменяет обмен, созданный через YellowChanger API. Заголовки, параметры тела запроса и примеры кода.

Source: https://docs.yellowchanger.com/ru/cancelTrade

Отменить обмен

**POST** `https://api.yellowchanger.com/trades/cancelTrade`

## Заголовки

| Название | Значение |
| --- | --- |
| Content-Type | application/json |
| Y_API_KEY | Публичный API ключ |
| [Signature](https://docs.yellowchanger.com/ru/signature.md) | HMAC SHA256 тела |

## Тело

| Название | Тип | Описание |
| --- | --- | --- |
| uniq_id | string | Уникальный идентификатор сделки |

## Ответ

**200**

```json
{
          "send_name": "USDT",
          "send_network": "TRC20",
          "get_network": "ERC20",
          "get_name": "USDT",
          "uniq_id": "0sv0c0c02da105aa6b7fbzf1zv05444d8a0ccd4c",
          "status": 4,
          "payment_wallet": "WalletForPay",
          "userPaidHash": "someHash",
          "ourHash": "someHash",
          "get_creds": "WalletForRecive",
          "network_commission": 0,
          "date": 1720120863,
          "time_expire": 1720142463,
          "send_value": "112",
          "get_value": "100",
          "sbpBank": null,
          "exch_type": "yellow",
          "recalculation": 1,
          "percent_commission": 0.5,
          "paid_amount": 0,
          "paid_time": 1738777524,
          "send_memo": "SomeMemo"
}
```

**40X**

```json
{
          "statusCode": 400,
          "message": "Some error message"
}
```

## Пример

**JavaScript**

```javascript
const options = {
          method: "POST",
          headers: {
                    "Content-Type": "application/json",
                    Y_API_KEY: "Your API Key",
                    Signature: "e4ae46c268b77ad7fb7d12da1eeb8ad3218779c52c926c63407971da7537848e",
          },
          body: '{"uniq_id":"0sv0c0c02da105aa6b7fbzf1zv05444d8a0ccd4c"}',
};
fetch("https://api.yellowchanger.com/trades/cancelTrade", options)
          .then((e) => e.json())
          .then((e) => console.log(e))
          .catch((e) => console.error(e));
```

**Python**

```python
import requests

url = "https://api.yellowchanger.com/trades/cancelTrade"

payload = {"uniq_id": "0sv0c0c02da105aa6b7fbzf1zv05444d8a0ccd4c"}
headers = {
    "Content-Type": "application/json",
    "Y_API_KEY": "Your API Key",
    "Signature": "e4ae46c268b77ad7fb7d12da1eeb8ad3218779c52c926c63407971da7537848e"
}

response = requests.request("POST", url, json=payload, headers=headers)

print(response.text)
```

## Связанные страницы

- [getInfo](https://docs.yellowchanger.com/ru/getInfo.md): Возвращает всю информацию о транзакции
- [createTrade](https://docs.yellowchanger.com/ru/createTrade.md): Создает новую сделку и возвращает информацию о сделке
- [Информация о статусах](https://docs.yellowchanger.com/ru/statusInfo.md): Описание статусов в методах createTrade и getInfo

---

All methods: https://docs.yellowchanger.com/ru/introduction.md · Index: https://docs.yellowchanger.com/ru/llms.txt · Whole documentation in one file: https://docs.yellowchanger.com/ru/llms-full.txt
