Skip to main content

Payouts by token

Below is a scenario where you send tokenized details.

You can get a token in the following ways:

Step 1. Create a payment session

Create a session using the session/create method. You will receive the payment session identifier in response. You will need it in the subsequent steps.

Alternatively, you can use the session/init/payout method to create a session and a payout at the same time. In this case, specify all the parameters for a payout with tokenized data right away and skip the next step. This option is not recommended.

If you make a payout from your escrow account, use the session/init/payout/nominal method, and if from your settlement account, use the session/init/payout/rko method. In this case, specify all the parameters for a payout with tokenized data right away and skip the next step.

Step 2. Start the payout

Start the payout using the session/start/payout method. Pass the session identifier along with all the parameters for a payout with tokenized data, including the token you have.

info

You can find information on the token or account through 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 webhook saying the payout is ready

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).

Step 4. Confirm or cancel the payout

Check the payout details and confirm that you are ready to perform the payout (session/confirm ) or cancel it (session/cancel).

Step 5. Wait for a webhook with the payout results

Bank 131 will send you a payment_finished webhook. The result of the payout can be found in the status field of the payments/payout_list object.

If the status is succeeded, then the payout was successful. If the status is failed, then an error occurred during the payout.

How to fix an error >

More about the payout statuses >

How to learn that a payout was returned >





Ask AI