Skip to main content

Payout to a bank account with a token

If you need to make payouts to a bank account, you can choose to store the account details on our side. In this case, use our tokenization widget to get a token, save it and make payouts with the help of this token.

Step 1. Generate a token

Use our tokenization widget or our tokenize method to get a token.

Request example
curl -X POST \
https://proxy-stage.bank131.ru/api/v1/tokenize \
-H 'Content-Type: application/json' \
-H 'X-PARTNER-PROJECT: your_project_name' \
-H 'X-PARTNER-SIGN: signature' \
-d '{
"type": "bank_account_ru",
"bank_account_ru": {
"bik": "049205131",
"account": "40702810200000000025"
}
}'
Response example
{
"status": "ok",
"token": "19f60ded07aca55eb43d1edeac15273d789b0c9b70df99a30851ee510827443f",
"data": {
"masked_account": "40702***0025"
}
}

Skip this step if you already have a token.

Step 2. Start the payout

Start the payout using the session/init/payout method.

To get the token or bank account details, use the token/info method.

Request example
curl -X POST \
https://demo.bank131.ru/api/v1/session/init/payout \
-H 'Content-Type: application/json' \
-H 'X-PARTNER-SIGN: signature' \
-H 'X-PARTNER-PROJECT: your_project_name' \
-d'{
"payment_method": {
"type": "bank_account",
"bank_account": {
"system_type": "ru",
"ru": {
"token": "3f03ee2580046153bb0aa859558e7ada10d3835270fdb4c4b70961239d37f31d",
"full_name": "Ivanov Ivan Ivanovich",
"description": "Payout"
}
}
},
"amount_details": {
"amount": 10000,
"currency": "rub"
},
"metadata": "good"
}'
Response example
{
"status": "ok",
"session": {
"id": "ps_1694821",
"status": "in_progress",
"created_at": "2024-02-27T09:25:30.655107Z",
"updated_at": "2024-02-27T09:25:30.753188Z",
"payments": [
{
"id": "po_495275",
"status": "in_progress",
"created_at": "2024-02-27T09:25:30.763145Z",
"payment_method": {
"type": "bank_account",
"bank_account": {
"system_type": "ru",
"ru": {
"token": "3f03ee2580046153bb0aa859558e7ada10d3835270fdb4c4b70961239d37f31d",
"full_name": "Ivanov Ivan Ivanovich",
"description": "Payout"
}
}
},
"metadata": "good",
"amount_details": {
"amount": 10000,
"currency": "rub"
}
}
]
}
}

Step 3. Wait for a notification that the Bank is ready to perform the payout

Bank 131 will send you a ready_to_confirm webhook. This means that the payout can be performed and the Bank is waiting for you to confirm (or cancel) the operation. The webhook body will contain all the details of the payout.

Reply with the 200 HTTP code.

Step 4. Confirm or cancel the payout

Check the payout details and either confirm it (using session/confirm), or cancel it (using session/cancel).

Step 5. Wait for the results

Bank 131 will send you a payment_finished webhook. The webhook body will contain all the payout details. The payout result is in the payment.status field.

More about the payout statuses