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

Отправка запроса на возврат платежа пользователю. Подробнее о процессе возврата 
можно прочитать в инструкции.


ПримечаниеВы можете использовать этот метод API в тестовом окружении (sandbox-режиме). Для этого передайте в запросе данные тестового платежа. Подробную информацию об открытии тестового окружения и сценариях тестирования читайте в инструкции.





ВниманиеЭтот метод API не включает в себя path-параметр project_id, поэтому для авторизации вам необходимо использовать ключ API, который действует во всех проектах.

Endpoint: PUT /merchants/{merchant_id}/reports/transactions/{transaction_id}/refund
Version: 2.0
Security: basicAuth

## Path parameters:

  - `merchant_id` (integer, required)
    ID продавца.

  - `transaction_id` (integer, required)
    ID транзакции.

## Request fields (application/json):

  - `description` (string, required)
    Причина отмены платежа.

  - `email` (string)
    Email пользователя.

## Response 200 fields (application/json):

  - `message` (string)
    Возможны следующие варианты ответов: 
- No content.
- The request for a refund has been accepted. Xsolla CS will manually complete the refund. It may take up to two business days.
- The request for a refund has been accepted. Xsolla CS will automatically send the customer an email with alternative refund options as the user's method does not support direct refunds.

## Response 404 fields (application/json):

  - `message` (string)
    Transaction ID not valid. Please check payment credentials. Otherwise, contact Xsolla support at support@xsolla.com.

## Response 422 fields (application/json):

  - `message` (string)
    Возможны следующие варианты ответов: 
- We are processing the refund request. This may take up to two business days.
- We are reaching the user for the information required for the refund. For details, contact Xsolla Support.
- Incorrect payment status. Refund is possible only for payments with "completed" or "error" status.
- To process this request, the customer’s email address field must be filled. Please specify the customer’s email address and try again.
- Full refund is unavailable because there are successful partial refunds for this transaction.
- Refund failed. Please contact Xsolla Support to process it manually.
- Dispute for this invoice is already opened. Can’t make a refund yet.


## Response 204 fields

## Response 401 fields
