> For the complete documentation index, see [llms.txt](https://help.unitpay.ru/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.unitpay.ru/payments/payment-refund.md).

# Возврат платежа

Чтобы сделать возврат платежа, выполните GET-запрос:

```bash
GET https://unitpay.ru/api

method    = refundPayment
paymentId = 2154490981
secretKey = sk_live_2YQt9m
sum       = 100
```

#### Обязательные  параметры:

<table><thead><tr><th width="170.11114501953125">Name</th><th width="118.8887939453125">Type</th><th>Description</th></tr></thead><tbody><tr><td>paymentId</td><td>number</td><td>ID платежа в системе UnitPay<br>Например: 1234512345</td></tr><tr><td>secretKey</td><td>string</td><td>Секретный ключ проекта, доступен в настройках проекта</td></tr></tbody></table>

#### Необязательные параметры:&#x20;

<table><thead><tr><th width="170.111083984375">name</th><th width="114.6666259765625">type</th><th>description</th></tr></thead><tbody><tr><td>sum</td><td>number</td><td>Cумма возврата, если требуется совершить частичный возврат.<br>Если параметр не передан, будет произведен возврат полной суммы по платежу.</td></tr></tbody></table>

{% hint style="danger" %}
По одному платежу вы можете сделать только один полный или частичный возврат.
{% endhint %}

{% hint style="info" %}
Если вы подключили онлайн-кассу в ЛК, то для формирования чеков необходимо дополнительно передать [ряд параметров](/online-cash-register/receipt_parameters.md).
{% endhint %}

#### Успешный ответ

```json
{
    "result": {
        "message": "Возврат успешно произведен"
    }
}
```

<table data-header-hidden><thead><tr><th width="176.00002034505206">name</th><th width="135">type</th><th>description</th></tr></thead><tbody><tr><td><strong>message</strong></td><td>string</td><td>Комментарий успешной операции, можно использовать как подсказку пользователю после выполнения запроса</td></tr></tbody></table>

#### Ошибочный ответ

```json
{
    "error": {
        "message": "Неверный ключ secretKey",
        "code": -32000
    }
}
```

<table data-header-hidden><thead><tr><th width="155.99995930989581">name</th><th width="127.11102294921875">type</th><th>description</th></tr></thead><tbody><tr><td><strong>message</strong></td><td>string</td><td>Информация с описанием ошибки запроса</td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://help.unitpay.ru/payments/payment-refund.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.
