> 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/en/mass-payouts/creating-a-payout.md).

# Creating a payout

Only mass payments can be set up via API.

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

method        = massPayment
sum           = 10.00
purse         = 7951xxxxx71
login         = partner@gmail.com
transactionId = 1782
secretKey     = key
paymentType   = sbp
```

#### Mandatory Parameters:

<table data-header-hidden><thead><tr><th width="157.11110432942706">name</th><th width="131.66656494140625">type</th><th>description</th></tr></thead><tbody><tr><td><strong>login</strong></td><td>string</td><td>Email account in the UnitPay system</td></tr><tr><td><strong>secretKey</strong></td><td>string</td><td>Account secret key, available in <a href="https://unitpay.ru/partner/profile/edit">profile settings</a></td></tr><tr><td><strong>purse</strong></td><td>string</td><td>Recipient's wallet, full card number or phone number without "+" (for SBP payouts)</td></tr><tr><td><strong>transactionId</strong></td><td>text</td><td>Unique payout ID on your side</td></tr><tr><td><strong>sum</strong></td><td>number</td><td>Transfer amount in rubles, for example: "100"</td></tr><tr><td><strong>paymentType</strong></td><td>string</td><td><p>Payment system code </p><p>Supported: card, webmoney, usdt, sbp</p></td></tr><tr><td><strong>memberId</strong></td><td>string</td><td>Bank identifier that can be requested using the <a href="https://help.unitpay.ru/book-of-reference/poluchenie-spravochnika-bankov-uchastnikov-sbp-api">method</a>. Required for SBP disbursements <strong>only</strong></td></tr></tbody></table>

#### Additional Parameters:

<table data-header-hidden><thead><tr><th width="163.77779134114581">name</th><th width="125.5555419921875">type</th><th>description</th></tr></thead><tbody><tr><td><strong>projectId</strong></td><td>namber</td><td>Unique project ID in the UnitPay system</td></tr><tr><td><strong>comment</strong></td><td>text</td><td>Payment comment. Displayed only in your personal cabinet (only letters, numbers, dots and commas are allowed)</td></tr></tbody></table>

{% hint style="warning" %}
**IMPORTANT:** always use a unique transactionId for new payments, retrieving an existing transactionId (regardless of other parameters) returns the current payment status.
{% endhint %}

{% hint style="success" %}
If after creating a payment you need to check its status, you need to use the ["Information about Payout"](/en/mass-payouts/information-about-payout.md) query
{% endhint %}

#### Successful

```
{"result": {
    "message": "Payout successfully completed",
    "status": "success",
    "payoutId": "114233",
    "partnerBalance": "15733.00",
    "createDate": "2021-12-01 11:51:02",
    "completeDate": "2021-12-01 11:52:02",
    "sum": "300",
    "payoutCommission": "6.00",
    "partnerCommission": "0.00"
}}
```

<table data-header-hidden><thead><tr><th width="181.55550130208331">name</th><th width="156.3333740234375">type</th><th>description</th></tr></thead><tbody><tr><td><strong>message</strong></td><td>string</td><td>Successful operation comment, can be used as a hint to the user after the request has been executed</td></tr><tr><td><strong>status</strong></td><td>string</td><td>success - successful payment<br>not_completed - payment has been sent to the payment system, but no confirmation has been received yet (temporary status)</td></tr><tr><td><strong>payoutId</strong></td><td>number</td><td>Unique payment ID in the UnitPay system</td></tr><tr><td><strong>partnerBalance</strong></td><td>number</td><td>Partner's balance in the system available for payments</td></tr><tr><td><strong>createDate</strong></td><td>text</td><td>Date of creation of the instalment</td></tr><tr><td><strong>completeDate</strong></td><td>text</td><td>Date of finalisation of payout</td></tr><tr><td><strong>sum</strong></td><td>number</td><td>Amount of payout</td></tr><tr><td><strong>payoutCommission</strong></td><td>number</td><td>Payout commission</td></tr><tr><td><strong>partnerCommission</strong></td><td>number</td><td>Partner commission</td></tr></tbody></table>

#### Example of an erroneous answer:

```
{"error": {
    "message": "Payment in the specified currency to the specified details is not possible",
    "code": 122
}}
```

<table data-header-hidden><thead><tr><th width="170.44447835286456">name</th><th width="140.2222900390625">type</th><th>description</th></tr></thead><tbody><tr><td><strong>message</strong></td><td>string</td><td>Information describing the request error</td></tr><tr><td><strong>code</strong></td><td>string</td><td>Error code, detailed decoding in the table below</td></tr></tbody></table>

#### Error Description:

<table data-header-hidden><thead><tr><th width="171.77777099609375">name</th><th>description</th></tr></thead><tbody><tr><td><strong>100</strong></td><td>The "masspayment" service is deactivated</td></tr><tr><td><strong>101</strong></td><td>The "masspayment" service is not available to you</td></tr><tr><td><strong>122</strong></td><td>Payment in the specified currency to the specified details is not possible</td></tr><tr><td><strong>1051</strong></td><td>We were unable to retrieve the recipient's wallet information. Check the wallet number and try the operation again or after a while.</td></tr></tbody></table>

#### Technical errors:

<table data-header-hidden><thead><tr><th width="199.5555419921875">name</th><th>description</th></tr></thead><tbody><tr><td><strong>-32000</strong></td><td>Invalid authorisation parameters (login, secret key)</td></tr><tr><td><strong>-32602</strong></td><td>Invalid query parameters</td></tr><tr><td><strong>-32603</strong></td><td>Internal technical error</td></tr></tbody></table>

{% hint style="warning" %}
IMPORTANT: If you receive an error with code -32603 use the payout information request as the payout may change its status after a re-request.
{% endhint %}
