Documentation

Documentation

  • Bank 131 API
  • Languages iconEnglish
    • Русский

›Payout Scenarios

131 Documentation

  • API features
  • Where to begin

Introduction to API

  • Interaction
  • API libraries
  • Testing
  • Version history

How Payouts Work

  • Features
  • How it all works
  • Main payout scenario
  • Payout refunds
  • The Self-employed

    • Payouts to the self-employed
    • Linking the self-employed
    • Fiscalization

    Payout Methods

    • To a Russian bank card
    • To a Russian bank account
    • To a QIWI Wallet
    • To a YooMoney (Yandex.Money)
    • To the Russian Federal Tax Agency
    • Via FPS by a phone number

    Payout Scenarios

    • Payout to a card via widget
    • Payout from a nominal account to a bank card
    • Single-request payout
    • Payout to a card with PCI DSS
    • Payout to a self-employed person with fiscal receipt

How Payments Work

  • Features
  • Payment process
  • Payments via bank card
  • Payments with later capture
  • Refunds
  • Recurring payments
  • Payments via FPS by QR code
  • Payments via Telegram

    • How to create your Telegram bot
    • How to connect your Telegram bot
    • How to setup your Telegram bot

    Split Payments

    • Features and options
    • Split payments out of the box
    • Split payments using API

    Payment Scenarios

    • Paying via payment form
    • Paying with PCI DSS
    • Single-request payment

Widgets

  • Widget to get card details
  • Payment form widget
  • Widget for linking a self-employed person to the Bank

Passport Verification

  • Features
  • Interaction
  • Methods

    • Verification request
    • Verification status
  • Response and errors

Reports

  • Payouts report
  • Payments report
  • Monthly report

API Reference

  • Objects
  • Methods
  • Webhooks
  • Error codes

Single-request payout

You can create a payout and send it with a single request, without any intermediate steps.

You should consider this option if you are sending money:

  • to a bank account;
  • or to a bank card if you have PCI DSS.

How to enable

Inform your Bank 131 manager that you want to use this option. Then all your payouts will be performed using this method.

How to send a payout

Using the session/init/payout request.

For a payout to an account:

  • in the PaymentMethod.type parameter, pass bank_account;
  • in the bank_account.ru object, pass the bank's BIC, the account number, the recipient's full name, and the purpose of the payout.

View the parameters for payouts to accounts

For a payout to a card:

  • in thePaymentMethod.type parameter, pass card;
  • in the BankCard object, pass the recipient's bank card details.

If this is a Russian bank card, you will need the card number, the recipient's name, and the amount in in ruble decimal format (e.g. if you are paying 100 rubles, you will need to pass 10000 in the amount_details.amount field).

View the parameters for payouts to Russian cards

If this is a foreign bank card, you will need the card number, the recipient's name, the amount in ruble decimal format, and the payer details: name, company name, and address.

View the parameters for payouts to foreign cards

Payout request examples

cURL
PHP
curl -X POST \
https://demo.bank131.ru/api/v1/session/init/payout \
-H 'Content-Type: application/json' \
-H 'X-PARTNER-SIGN: sign' \
-H 'X-PARTNER-PROJECT: your_project_name' \
-d'{
"payment_method": {
"type": "bank_account",
"bank_account": {
"system_type": "ru",
"ru": {
"bik": "044525971",
"account": "40817810100000270411",
"full_name": "Ivanov Ivan Ivanovich",
"description": "Wire for agreement № 5015553111 Ivanov Ivan Ivanovich VAT exempt"
}
}
},
"amount_details": {
"amount": 10000,
"currency": "rub"
},
"metadata": "good
}'

use Bank131\SDK\API\Request\Builder\RequestBuilderFactory;
use Bank131\SDK\Client;
use Bank131\SDK\Config;
use Bank131\SDK\DTO\BankAccount\BankAccountRu;

$config = new Config(
'https://demo.bank131.ru',
'your_project_name',
file_get_contents('/path/to/your/private_key.pem')
);

$client = new Client($config);

$request = RequestBuilderFactory::create()
->initPayoutSession()
->setBankAccount(
new BankAccountRu(
'044525971',
'40817810100000270411',
'Ivanov Ivan Ivanovich',
'Wire for agreement № 5015553111 Ivanov Ivan Ivanovich VAT exempt'
)
)
->setAmount(1000, 'rub')
->setMetadata('good')
->build();

$response = $client->session()->initPayout($request);

How to check the result

Wait for the payment_finished webhook or query the payout's status using the session/status method.

The result of the payout can be found in the payment.status field.

If the status is succeeded, then the payout has been successful. If the status is failed, then the payout has not been completed because of an error.

More about payout statuses

Webhook example: payout result

На карту
curl -X POST \
https://partner.ru \
-H 'Content-Type: application/json' \
-H 'X-PARTNER-SIGN: a4f1698616d6ad7b8b73a9d72d281eeb443b64dee3f38df430eeed6aa29e1dc' \
-d '{
"
type": "payment_finished",
"
session": {
"
id": "3230",
"
status": "accepted",
"
created_at": "2018-05-27T02:03:00.000000Z",
"
updated_at": "2018-05-27T02:03:00.000000Z",
"
payments": [
{
"
id": "2018",
"
status": "succeeded",
"
created_at": "2018-05-27T02:03:00.000000Z",
"
customer": {
"
reference": "user123",
"
contacts": [
{
"
email": "user@gmail.com"
}
]
},
"
payment_method": {
"
type": "card",
"
card": {
"
last4": "4242",
"
brand": "visa"
}
},
"
amount_details": {
"
amount": 10000,
"
currency": "rub"
},
"
metadata": "good"
}
]
}
}'

An example of handling a webhook using SDK

PHP
use Bank131\SDK\Client;
use Bank131\SDK\Config;
use Bank131\SDK\Services\WebHook\Hook\WebHookTypeEnum;

$config = new Config(
'https://demo.bank131.ru',
'your_project_name',
file_get_contents('/path/to/your/private_key.pem'),
file_get_contents('/path/to/bank131/public_key.pem')
);

$client = new Client($config);

$hook = $client->handleWebHook('sign from headers', 'request body');

if ($hook->getType() === WebHookTypeEnum::PAYMENT_FINISHED) {
$session = $hook->getSession();
//do your logic here
}
← Payout from a nominal account to a bank cardPayout to a card with PCI DSS →
  • How to enable
  • How to send a payout
  • How to check the result
Documentation
Documentation
PayoutsPaymentsAPI ReferenceService documents
Step by step
Payout to a card via widgetPayout to a card with PCI DSSPayout to the self-employed Paying via payment form
Get in touch
Ideas and partnerships — partners@131.ruMedia — press@131.ru
© 2023 Bank 131