# [YooKassa API SDK](../home.md)
# Class: \YooKassa\Request\Refunds\CreateRefundRequestBuilder
### Namespace: [\YooKassa\Request\Refunds](../namespaces/yookassa-request-refunds.md)
---
**Summary:**
Класс билдера запросов к API на создание возврата средств
---
### Examples
02-builder.php 148 35 Пример использования билдера
```php
```
---
### Constants
* No constants found
---
### Properties
| Visibility | Name | Flag | Summary |
| ----------:| ---- | ---- | ------- |
| protected | [$amount](../classes/YooKassa-Common-AbstractPaymentRequestBuilder.md#property_amount) | | Сумма |
| protected | [$currentObject](../classes/YooKassa-Request-Refunds-CreateRefundRequestBuilder.md#property_currentObject) | | Собираемый объект запроса к API |
| protected | [$deal](../classes/YooKassa-Request-Refunds-CreateRefundRequestBuilder.md#property_deal) | | Объект с информацией о сделке, в составе которой проходит возврат. |
| protected | [$receipt](../classes/YooKassa-Common-AbstractPaymentRequestBuilder.md#property_receipt) | | Объект с информацией о чеке |
| protected | [$transfers](../classes/YooKassa-Common-AbstractPaymentRequestBuilder.md#property_transfers) | | Массив платежей в пользу разных мерчантов |
---
### Methods
| Visibility | Name | Flag | Summary |
| ----------:| ---- | ---- | ------- |
| public | [__construct()](../classes/YooKassa-Common-AbstractRequestBuilder.md#method___construct) | | Конструктор, инициализирует пустой запрос, который в будущем начнём собирать |
| public | [addReceiptItem()](../classes/YooKassa-Common-AbstractPaymentRequestBuilder.md#method_addReceiptItem) | | Добавляет в чек товар |
| public | [addReceiptShipping()](../classes/YooKassa-Common-AbstractPaymentRequestBuilder.md#method_addReceiptShipping) | | Добавляет в чек доставку товара |
| public | [build()](../classes/YooKassa-Request-Refunds-CreateRefundRequestBuilder.md#method_build) | | Строит объект запроса к API |
| public | [setAmount()](../classes/YooKassa-Common-AbstractPaymentRequestBuilder.md#method_setAmount) | | Устанавливает сумму |
| public | [setCurrency()](../classes/YooKassa-Common-AbstractPaymentRequestBuilder.md#method_setCurrency) | | Устанавливает валюту в которой будет происходить подтверждение оплаты заказа |
| public | [setDeal()](../classes/YooKassa-Request-Refunds-CreateRefundRequestBuilder.md#method_setDeal) | | Устанавливает сделку |
| public | [setDescription()](../classes/YooKassa-Request-Refunds-CreateRefundRequestBuilder.md#method_setDescription) | | Устанавливает комментарий к возврату |
| public | [setOptions()](../classes/YooKassa-Common-AbstractRequestBuilder.md#method_setOptions) | | Устанавливает свойства запроса из массива |
| public | [setPaymentId()](../classes/YooKassa-Request-Refunds-CreateRefundRequestBuilder.md#method_setPaymentId) | | Устанавливает айди платежа для которого создаётся возврат |
| public | [setReceipt()](../classes/YooKassa-Common-AbstractPaymentRequestBuilder.md#method_setReceipt) | | Устанавливает чек |
| public | [setReceiptEmail()](../classes/YooKassa-Common-AbstractPaymentRequestBuilder.md#method_setReceiptEmail) | | Устанавливает адрес электронной почты получателя чека |
| public | [setReceiptItems()](../classes/YooKassa-Common-AbstractPaymentRequestBuilder.md#method_setReceiptItems) | | Устанавлвиает список товаров для создания чека |
| public | [setReceiptPhone()](../classes/YooKassa-Common-AbstractPaymentRequestBuilder.md#method_setReceiptPhone) | | Устанавливает телефон получателя чека |
| public | [setSources()](../classes/YooKassa-Request-Refunds-CreateRefundRequestBuilder.md#method_setSources) | | Устанавливает источники возврата |
| public | [setTaxSystemCode()](../classes/YooKassa-Common-AbstractPaymentRequestBuilder.md#method_setTaxSystemCode) | | Устанавливает код системы налогообложения. |
| public | [setTransfers()](../classes/YooKassa-Common-AbstractPaymentRequestBuilder.md#method_setTransfers) | | Устанавливает трансферы |
| protected | [initCurrentObject()](../classes/YooKassa-Request-Refunds-CreateRefundRequestBuilder.md#method_initCurrentObject) | | Возвращает новый объект для сборки |
---
### Details
* File: [lib/Request/Refunds/CreateRefundRequestBuilder.php](../../lib/Request/Refunds/CreateRefundRequestBuilder.php)
* Package: YooKassa
* Class Hierarchy:
* [\YooKassa\Common\AbstractRequestBuilder](../classes/YooKassa-Common-AbstractRequestBuilder.md)
* [\YooKassa\Common\AbstractPaymentRequestBuilder](../classes/YooKassa-Common-AbstractPaymentRequestBuilder.md)
* \YooKassa\Request\Refunds\CreateRefundRequestBuilder
---
## Properties
#### protected $amount : \YooKassa\Model\MonetaryAmount
---
**Summary**
Сумма
**Type:** MonetaryAmount
**Details:**
* Inherited From: [\YooKassa\Common\AbstractPaymentRequestBuilder](../classes/YooKassa-Common-AbstractPaymentRequestBuilder.md)
#### protected $currentObject : \YooKassa\Request\Refunds\CreateRefundRequest
---
**Summary**
Собираемый объект запроса к API
**Type:** CreateRefundRequest
**Details:**
#### protected $deal : \YooKassa\Model\Deal\RefundDealData
---
**Summary**
Объект с информацией о сделке, в составе которой проходит возврат.
**Type:** RefundDealData
**Details:**
#### protected $receipt : \YooKassa\Model\Receipt
---
**Summary**
Объект с информацией о чеке
**Type:** Receipt
**Details:**
* Inherited From: [\YooKassa\Common\AbstractPaymentRequestBuilder](../classes/YooKassa-Common-AbstractPaymentRequestBuilder.md)
#### protected $transfers : \YooKassa\Model\TransferInterface[]
---
**Summary**
Массив платежей в пользу разных мерчантов
**Type:** TransferInterface[]
**Details:**
* Inherited From: [\YooKassa\Common\AbstractPaymentRequestBuilder](../classes/YooKassa-Common-AbstractPaymentRequestBuilder.md)
---
## Methods
#### public __construct() : mixed
```php
public __construct() : mixed
```
**Summary**
Конструктор, инициализирует пустой запрос, который в будущем начнём собирать
**Details:**
* Inherited From: [\YooKassa\Common\AbstractRequestBuilder](../classes/YooKassa-Common-AbstractRequestBuilder.md)
**Returns:** mixed -
#### public addReceiptItem() : self
```php
public addReceiptItem(string $title, string $price, float $quantity, int $vatCode, null|string $paymentMode = null, null|string $paymentSubject = null, mixed $productCode = null, mixed $countryOfOriginCode = null, mixed $customsDeclarationNumber = null, mixed $excise = null) : self
```
**Summary**
Добавляет в чек товар
**Details:**
* Inherited From: [\YooKassa\Common\AbstractPaymentRequestBuilder](../classes/YooKassa-Common-AbstractPaymentRequestBuilder.md)
* See Also:
* [](\YooKassa\Model\Receipt\PaymentSubject::class)
* [](\YooKassa\Model\Receipt\PaymentMode::class)
##### Parameters:
| Type | Name | Description |
| ---- | ---- | ----------- |
| string | title | Название или описание товара |
| string | price | Цена товара в валюте, заданной в заказе |
| float | quantity | Количество товара |
| int | vatCode | Ставка НДС |
| null OR string | paymentMode | значение перечисления PaymentMode |
| null OR string | paymentSubject | значение перечисления PaymentSubject |
| mixed | productCode | |
| mixed | countryOfOriginCode | |
| mixed | customsDeclarationNumber | |
| mixed | excise | |
**Returns:** self - Инстанс билдера запросов
#### public addReceiptShipping() : self
```php
public addReceiptShipping(string $title, string $price, int $vatCode, null|string $paymentMode = null, null|string $paymentSubject = null) : self
```
**Summary**
Добавляет в чек доставку товара
**Details:**
* Inherited From: [\YooKassa\Common\AbstractPaymentRequestBuilder](../classes/YooKassa-Common-AbstractPaymentRequestBuilder.md)
* See Also:
* [](\YooKassa\Model\Receipt\PaymentSubject::class)
* [](\YooKassa\Model\Receipt\PaymentMode::class)
##### Parameters:
| Type | Name | Description |
| ---- | ---- | ----------- |
| string | title | Название доставки в чеке |
| string | price | Стоимость доставки |
| int | vatCode | Ставка НДС |
| null OR string | paymentMode | значение перечисления PaymentMode |
| null OR string | paymentSubject | значение перечисления PaymentSubject |
**Returns:** self - Инстанс билдера запросов
#### public build() : \YooKassa\Request\Refunds\CreateRefundRequestInterface|\YooKassa\Common\AbstractRequest
```php
public build(array|null $options = null) : \YooKassa\Request\Refunds\CreateRefundRequestInterface|\YooKassa\Common\AbstractRequest
```
**Summary**
Строит объект запроса к API
**Details:**
* Inherited From: [\YooKassa\Request\Refunds\CreateRefundRequestBuilder](../classes/YooKassa-Request-Refunds-CreateRefundRequestBuilder.md)
##### Parameters:
| Type | Name | Description |
| ---- | ---- | ----------- |
| array OR null | options | Устанавливаемые параметры запроса |
**Returns:** \YooKassa\Request\Refunds\CreateRefundRequestInterface|\YooKassa\Common\AbstractRequest - Инстанс сгенерированного объекта запроса к API
#### public setAmount() : self
```php
public setAmount(\YooKassa\Model\AmountInterface|array|string $value) : self
```
**Summary**
Устанавливает сумму
**Details:**
* Inherited From: [\YooKassa\Common\AbstractPaymentRequestBuilder](../classes/YooKassa-Common-AbstractPaymentRequestBuilder.md)
##### Parameters:
| Type | Name | Description |
| ---- | ---- | ----------- |
| \YooKassa\Model\AmountInterface OR array OR string | value | Сумма оплаты |
**Returns:** self - Инстанс билдера запросов
#### public setCurrency() : self
```php
public setCurrency(string $value) : self
```
**Summary**
Устанавливает валюту в которой будет происходить подтверждение оплаты заказа
**Details:**
* Inherited From: [\YooKassa\Common\AbstractPaymentRequestBuilder](../classes/YooKassa-Common-AbstractPaymentRequestBuilder.md)
##### Parameters:
| Type | Name | Description |
| ---- | ---- | ----------- |
| string | value | Валюта в которой подтверждается оплата |
**Returns:** self - Инстанс билдера запросов
#### public setDeal() : \YooKassa\Request\Refunds\CreateRefundRequestBuilder
```php
public setDeal(\YooKassa\Model\Deal\RefundDealData|array|null $value) : \YooKassa\Request\Refunds\CreateRefundRequestBuilder
```
**Summary**
Устанавливает сделку
**Details:**
* Inherited From: [\YooKassa\Request\Refunds\CreateRefundRequestBuilder](../classes/YooKassa-Request-Refunds-CreateRefundRequestBuilder.md)
##### Parameters:
| Type | Name | Description |
| ---- | ---- | ----------- |
| \YooKassa\Model\Deal\RefundDealData OR array OR null | value | Данные о сделке, в составе которой проходит возврат |
##### Throws:
| Type | Description |
| ---- | ----------- |
| \YooKassa\Common\Exceptions\InvalidPropertyValueTypeException | |
**Returns:** \YooKassa\Request\Refunds\CreateRefundRequestBuilder - Инстанс билдера запросов
#### public setDescription() : \YooKassa\Request\Refunds\CreateRefundRequestBuilder
```php
public setDescription(string $value) : \YooKassa\Request\Refunds\CreateRefundRequestBuilder
```
**Summary**
Устанавливает комментарий к возврату
**Details:**
* Inherited From: [\YooKassa\Request\Refunds\CreateRefundRequestBuilder](../classes/YooKassa-Request-Refunds-CreateRefundRequestBuilder.md)
##### Parameters:
| Type | Name | Description |
| ---- | ---- | ----------- |
| string | value | Комментарий к возврату |
##### Throws:
| Type | Description |
| ---- | ----------- |
| \YooKassa\Common\Exceptions\InvalidPropertyValueTypeException | Выбрасывается если была передана не строка |
**Returns:** \YooKassa\Request\Refunds\CreateRefundRequestBuilder - Инстанс текущего билдера
#### public setOptions() : \YooKassa\Common\AbstractRequestBuilder
```php
public setOptions(array|\Traversable $options) : \YooKassa\Common\AbstractRequestBuilder
```
**Summary**
Устанавливает свойства запроса из массива
**Details:**
* Inherited From: [\YooKassa\Common\AbstractRequestBuilder](../classes/YooKassa-Common-AbstractRequestBuilder.md)
##### Parameters:
| Type | Name | Description |
| ---- | ---- | ----------- |
| array OR \Traversable | options | Массив свойств запроса |
##### Throws:
| Type | Description |
| ---- | ----------- |
| \InvalidArgumentException | Выбрасывается если аргумент не массив и не итерируемый объект |
| \YooKassa\Common\Exceptions\InvalidPropertyException | Выбрасывается если не удалось установить один из параметров, переданныч в массиве настроек |
**Returns:** \YooKassa\Common\AbstractRequestBuilder - Инстанс текущего билдера запросов
#### public setPaymentId() : \YooKassa\Request\Refunds\CreateRefundRequestBuilder
```php
public setPaymentId(string $value) : \YooKassa\Request\Refunds\CreateRefundRequestBuilder
```
**Summary**
Устанавливает айди платежа для которого создаётся возврат
**Details:**
* Inherited From: [\YooKassa\Request\Refunds\CreateRefundRequestBuilder](../classes/YooKassa-Request-Refunds-CreateRefundRequestBuilder.md)
##### Parameters:
| Type | Name | Description |
| ---- | ---- | ----------- |
| string | value | Айди платежа |
##### Throws:
| Type | Description |
| ---- | ----------- |
| \YooKassa\Common\Exceptions\EmptyPropertyValueException | Выбрасывается если передано пустое значение айди платежа |
| \YooKassa\Common\Exceptions\InvalidPropertyValueException | Выбрасывается если переданное значение является строкой, но не является валидным значением айди платежа |
| \YooKassa\Common\Exceptions\InvalidPropertyValueTypeException | Выбрасывается если передано значение не валидного типа |
**Returns:** \YooKassa\Request\Refunds\CreateRefundRequestBuilder - Инстанс текущего билдера
#### public setReceipt() : self
```php
public setReceipt(\YooKassa\Model\ReceiptInterface|array $value) : self
```
**Summary**
Устанавливает чек
**Details:**
* Inherited From: [\YooKassa\Common\AbstractPaymentRequestBuilder](../classes/YooKassa-Common-AbstractPaymentRequestBuilder.md)
##### Parameters:
| Type | Name | Description |
| ---- | ---- | ----------- |
| \YooKassa\Model\ReceiptInterface OR array | value | Инстанс чека или ассоциативный массив с данными чека |
##### Throws:
| Type | Description |
| ---- | ----------- |
| \YooKassa\Common\Exceptions\InvalidPropertyValueTypeException | Генерируется если было передано значение невалидного типа |
**Returns:** self -
#### public setReceiptEmail() : self
```php
public setReceiptEmail(string $value) : self
```
**Summary**
Устанавливает адрес электронной почты получателя чека
**Details:**
* Inherited From: [\YooKassa\Common\AbstractPaymentRequestBuilder](../classes/YooKassa-Common-AbstractPaymentRequestBuilder.md)
##### Parameters:
| Type | Name | Description |
| ---- | ---- | ----------- |
| string | value | Email получателя чека |
**Returns:** self - Инстанс билдера запросов
#### public setReceiptItems() : self
```php
public setReceiptItems(array $value) : self
```
**Summary**
Устанавлвиает список товаров для создания чека
**Details:**
* Inherited From: [\YooKassa\Common\AbstractPaymentRequestBuilder](../classes/YooKassa-Common-AbstractPaymentRequestBuilder.md)
##### Parameters:
| Type | Name | Description |
| ---- | ---- | ----------- |
| array | value | Массив товаров в заказе |
##### Throws:
| Type | Description |
| ---- | ----------- |
| \YooKassa\Common\Exceptions\InvalidPropertyValueException | Выбрасывается если хотя бы один из товаров имеет неверную структуру |
**Returns:** self - Инстанс билдера запросов
#### public setReceiptPhone() : self
```php
public setReceiptPhone(string $value) : self
```
**Summary**
Устанавливает телефон получателя чека
**Details:**
* Inherited From: [\YooKassa\Common\AbstractPaymentRequestBuilder](../classes/YooKassa-Common-AbstractPaymentRequestBuilder.md)
##### Parameters:
| Type | Name | Description |
| ---- | ---- | ----------- |
| string | value | Телефон получателя чека |
##### Throws:
| Type | Description |
| ---- | ----------- |
| \YooKassa\Common\Exceptions\InvalidPropertyValueTypeException | Выбрасывается если в качестве значения была передана не строка |
**Returns:** self - Инстанс билдера запросов
#### public setSources() : self
```php
public setSources(\YooKassa\Model\SourceInterface[]|array $value) : self
```
**Summary**
Устанавливает источники возврата
**Details:**
* Inherited From: [\YooKassa\Request\Refunds\CreateRefundRequestBuilder](../classes/YooKassa-Request-Refunds-CreateRefundRequestBuilder.md)
##### Parameters:
| Type | Name | Description |
| ---- | ---- | ----------- |
| \YooKassa\Model\SourceInterface[] OR array | value | Массив трансферов |
**Returns:** self - Инстанс билдера запросов
#### public setTaxSystemCode() : self
```php
public setTaxSystemCode(int $value) : self
```
**Summary**
Устанавливает код системы налогообложения.
**Details:**
* Inherited From: [\YooKassa\Common\AbstractPaymentRequestBuilder](../classes/YooKassa-Common-AbstractPaymentRequestBuilder.md)
##### Parameters:
| Type | Name | Description |
| ---- | ---- | ----------- |
| int | value | Код системы налогообложения. Число 1-6. |
**Returns:** self - Инстанс билдера запросов
#### public setTransfers() : self
```php
public setTransfers(\YooKassa\Model\TransferInterface[]|array|null $value) : self
```
**Summary**
Устанавливает трансферы
**Details:**
* Inherited From: [\YooKassa\Common\AbstractPaymentRequestBuilder](../classes/YooKassa-Common-AbstractPaymentRequestBuilder.md)
##### Parameters:
| Type | Name | Description |
| ---- | ---- | ----------- |
| \YooKassa\Model\TransferInterface[] OR array OR null | value | Массив трансферов |
**Returns:** self - Инстанс билдера запросов
#### protected initCurrentObject() : \YooKassa\Request\Refunds\CreateRefundRequest
```php
protected initCurrentObject() : \YooKassa\Request\Refunds\CreateRefundRequest
```
**Summary**
Возвращает новый объект для сборки
**Details:**
* Inherited From: [\YooKassa\Request\Refunds\CreateRefundRequestBuilder](../classes/YooKassa-Request-Refunds-CreateRefundRequestBuilder.md)
**Returns:** \YooKassa\Request\Refunds\CreateRefundRequest - Собираемый объект запроса к API
---
### Top Namespaces
* [\YooKassa](../namespaces/yookassa.md)
---
### Reports
* [Errors - 0](../reports/errors.md)
* [Markers - 1](../reports/markers.md)
* [Deprecated - 25](../reports/deprecated.md)
---
This document was automatically generated from source code comments on 2023-04-06 using [phpDocumentor](http://www.phpdoc.org/)
© 2023 YooMoney