Main payout scenario
What kinds of scenarios we have
Payouts via API can be performed with or without a token.
The choice of a scenario depends on how the payment is received and whether you decided to collect and store bank card details on your side.
Payout to a bank card with the widget
In this case, you cannot store and send the recipient's bank card details with open parameters, which means the payout can only be performed using a token, via the tokenization widget.
The widget allows you to obtain the user's card details and pass them along within your request in a secure tokenized form.
How to perform a payout to a bank card via widget
To show the user which bank card will receive the payment, use the
token/info
method. It takes the last 4 numbers of the card by its token.
Payout to a bank card, bank account, via FPS, YooMoney (Yandex.Money) wallet
No need to use a token: all the payout parameters can be passed along with open parameters.
Payment session
All API operations are carried out within a payment session (session
) – payouts, payments, and refunds. You can perform payouts in two ways:
- initiate the payout when you start the session (as a single request,
session/init/payout
); - or create a session and only then perform the payout (making two requests:
session/create
andsession/start/payout
). For example, to immediately obtain the session identifier and use it to monitor the payout status.
Main payout scenario
These steps are only necessary for payouts with the widget
- Send a request for token creation to access the JavaScript library.
- Create the widget with this token, show it to the user, and obtain the card details in tokenized form.
Tokenized card details can be saved so that you can send money to that card later.
- Perform the payout however you prefer:
- either first send a request for payout session creation (
session/create
), then a separate request for payout creation using this session's identifier (session/start/payout
) - or create the session and the payout simultaneously (
session/init/payout
).
In the request for payout creation, you pass the method of receiving the payment and all the parameters mandatory for that method.
- Make sure Bank 131 is ready to perform a payment and is waiting for your approval. There are two options:
- get a
ready_to_confirm
webhook from Bank 131 - send a
session/status
request and wait untilconfirm
is returned in thesession.next_action
field.
- Confirm (
session/confirm
) or cancel (session/cancel
) the operation. - Bank 131 will send you a
payment_finished
webhook containing the result of the payout. If the status issucceeded
, the payout has been performed successfully.
A payout to a Russian bank account may be refunded within 5 days. In this case, you will receive a
payment_refunded
webhook. Learn more about payout refunds
Scenario of payouts to self-employed people
If you are paying out to self-employed people, the scenario will be slightly different.
- Before the start of the payout (at the very beginning), check that the person really is self-employed and is linked to Bank 131 (using their INN, with a couple of requests –
check
andrequest/status
). - If the INN belongs to the self-employed person but is not linked to Bank 131, you should immediately link it using the special linking widget.
- If everything is fine, perform the payout following the standard scenario. Along with the payment, send fiscalization details:
session/init/payout/fiscalization
orsession/start/payout/fiscalization
.
More about payouts to the self-employed
Single-request payout
For payouts to bank accounts or to cards, there is a simplified scenario: you send the payout using a session/init/payout
request and obtain the result from a payment_finished
webhook or using the session/status
method.
How to perform a single-request payout
Payout in a foreign currency (other than Russian ruble)
The following steps are eligible for payouts in a foreign currency:
- send a request for payout session creation
session/create
; - send a request for payout creation using this session identifier
session/start/payout
; - wait for a
ready_to_confirm
webhook from Bank 131 to make your payout.
For more details on how to perform payouts in a foreign currency, click here
Payout statuses
The status of a payout is returned in the status
field of the payments
/payout_list
object. To query it, wait for a webhook from Bank 131 or send a session/status request
with the identifier of the session containing this payout. You can choose any of these options or combine them as you wish.