# Отмена счета

## Описание

Счет можно отменить для того, чтобы покупатель не смог оплатить счет. Это нужно в случае, если в счете была допущена ошибка. Счет можно отменить только при соблюдении двух условий:

* Статус счета: не оплачен
* Просмотры платежной страницы: 0 просмотров

## Запрос

```bash
curl -X POST https://api.bitsby.app/invoices/cancel \
  -H "Authorization: Token MSvL2ltaDZdWVjmZURURMVWhqSJLT2NURjhL2Fla1Z1T1IxQTltKs1T3Ay" \
	-F "invoiceId=ade9550d-3dc7-4fd3-b94e-3b4c12aaaa0c"
```

## Параметры запроса

<table data-full-width="true"><thead><tr><th>Параметр</th><th>Тип данных</th><th>Описание</th><th>Пример</th><th>Обязательный?</th></tr></thead><tbody><tr><td><code>invoiceId</code></td><td>UUID</td><td>ID счета в формате UUID</td><td>ade9550d-3dc7-4fd3-b94e-3b4c12aaaa0c</td><td>да</td></tr></tbody></table>

## Пример ответа

```json
{
   "result":"success",
   "data":"Invoice canceled"
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.bitsby.app/ru/dokumentaciya-api/otmena-scheta.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
