Methods
During request processing, the system validates the input data, ensures the required headers are present, and confirms that the user has the appropriate rights to perform the operations.
In the documentation, the mandatory status of parameters is specified for each transaction, but you are not required to pass them in the body of this particular request. You can pass them in advance—when creating a session.
Example of sending a payout request:
- If the
session/createrequest was sent empty, the payout request (session/start/payout) must contain all the mandatory parameters. - If the
session/createrequest contained all the mandatory parameters specified for the transaction, the payout request (session/start/payout) can be empty or contain only those parameters the values of which you want to override. - If the
session/createrequest contained some of the mandatory parameters, the payout request (session/start/payout) must contain the remaining ones.
Performing operations
recurrent/disable
Deactivating a token
A method for disabling a token for recurring payments. To do this, send the token in the request, in the response you will get is_active: false. This means you cannot perform recurring payments with this token anymore.
After the token is disabled, the token expiration setting
finished_atmay contain a date referring to the year 2000. Ignore it.
Endpoint
/api/v1/recurrent/disable
Request parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
recurrent | + | object | Token |
Request example
- cURL
- PHP
curl -X POST \
https://demo.bank131.ru/api/v1/recurrent/disable \
-H 'Content-Type: application/json' \
-H 'X-PARTNER-PROJECT: your_project_name' \
-H 'X-PARTNER-SIGN: signature' \
-d '{
"recurrent": {
"token": "9a1c4e7f2b8d5036af61c9e0d4b72f8a3c5e190d6f24b8a7c0e3d5f19b6a2c48"
}
}'
use Bank131\SDK\API\Request\Builder\RequestBuilderFactory;
use Bank131\SDK\Client;
use Bank131\SDK\Config;
$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()
->disableRecurrentRequestBuilder()
->setRecurrentToken('9a1c4e7f2b8d5036af61c9e0d4b72f8a3c5e190d6f24b8a7c0e3d5f19b6a2c48')
->build();
$response = $client->recurrent()->disable($request);
Response parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
status | + | string | Status. Possible values: error, ok |
recurrent | - | object | Token information |
error | - | object | Error |
Response examples
- Successful response example
- Unsuccessful response example
{
"recurrent": {
"token": "9a1c4e7f2b8d5036af61c9e0d4b72f8a3c5e190d6f24b8a7c0e3d5f19b6a2c48",
"created_at": "2020-07-14T13:17:11+03:00",
"finished_at": "2020-07-31T16:05:42+03:00",
"is_active": false,
"type": "recurrent_token"
},
"status": "ok"
}
{
"status": "error",
"error": {
"description": "error description",
"code": "error code"
}
}
session/cancel
Canceling an operation
A method for canceling a payout or a payment after receiving a ready_to_confirm or ready_to_capture webhook from Bank 131.
- API v1
- API v2
Endpoint
/api/v1/session/cancel
Request parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
session_id | + | string | Session identifier |
Request example
- cURL
- PHP
curl -X POST \
https://demo.bank131.ru/api/v1/session/cancel \
-H 'Content-Type: application/json' \
-H 'X-PARTNER-PROJECT: your_project_name' \
-H 'X-PARTNER-SIGN: signature' \
-d '{
"session_id": "ps_3230"
}'
use Bank131\SDK\Client;
use Bank131\SDK\Config;
$config = new Config(
'https://demo.bank131.ru',
'your_project_name',
file_get_contents('/path/to/your/private_key.pem')
);
$client = new Client($config);
$response = $client->session()->cancel('session_id');
Response parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
status | + | string | Status. Possible values: error, ok |
session | - | object | Payment session |
error | - | object | Error |
Response examples
- Successful response example
- Unsuccessful response example
{
"status": "ok",
"session": {
"id": "ps_3230",
"status": "in_progress",
"created_at": "2018-05-27T02:03:00.000000Z",
"updated_at": "2018-05-27T02:03:00.000000Z",
"payments": [{
"id": "po_2018",
"status": "pending",
"created_at": "2018-05-27T02:03:00.000000Z",
"customer": {
"reference": "user123",
"contacts": [{
"email": "user@gmail.com"
}]
},
"payment_method": {
"type": "card",
"card": {
"last4": "2058",
"brand": "mir"
}
},
"amount_details": {
"amount": 10000,
"currency": "rub"
},
"metadata": "good"
}]
}
}
{
"status": "error",
"error": {
"description": "error description",
"code": "error code"
}
}
Endpoint
/api/v2/session/cancel
Request parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
session_id | + | string | Session identifier |
Request example
- cURL
- PHP
curl -X POST \
https://demo.bank131.ru/api/v2/session/cancel \
-H 'Content-Type: application/json' \
-H 'X-PARTNER-PROJECT: your_project_name' \
-H 'X-PARTNER-SIGN: signature' \
-d '{
"session_id": "ps_3230"
}'
use Bank131\SDK\Client;
use Bank131\SDK\Config;
$config = new Config(
'https://demo.bank131.ru',
'your_project_name',
file_get_contents('/path/to/your/private_key.pem')
);
$client = new Client($config);
$response = $client->session()->cancel('session_id');
Response parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
status | + | string | Status. Possible values: error, ok |
session | - | object | Payment session |
error | - | object | Error |
Response examples
- Successful response example
- Unsuccessful response example
{
"status": "ok",
"session": {
"id": "ps_3230",
"status": "in_progress",
"created_at": "2018-05-27T02:03:00.000000Z",
"updated_at": "2018-05-27T02:03:00.000000Z",
"payout_list": [{
"id": "po_2018",
"status": "pending",
"created_at": "2018-05-27T02:03:00.000000Z",
"customer": {
"reference": "user123",
"contacts": [{
"email": "user@gmail.com"
}]
},
"payout_details": {
"type": "card",
"card": {
"last4": "2058",
"brand": "mir"
}
},
"amount_details": {
"amount": 10000,
"currency": "rub"
},
"metadata": "good"
}]
}
}
{
"status": "error",
"error": {
"description": "error description",
"code": "error code"
}
}
session/capture
Debiting amounts put on hold
A method for debiting previously held funds after receiving a ready_to_capture webhook from Bank 131. You can debit the amount fully or partially.
- API v1
- API v2
Endpoint
/api/v1/session/capture
Request parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
session_id | + | string | Bank 131 session identifier |
amount_details | - | object | Amount to be debited. Can be less than the amount on hold, but greater than 0. If not specified, the full amount of the payment will be debited |
Request example
- cURL
- PHP
curl -X POST \
https://demo.bank131.ru/api/v1/session/capture \
-H 'Content-Type: application/json' \
-H 'X-PARTNER-PROJECT: your_project_name' \
-H 'X-PARTNER-SIGN: signature' \
-d '{
"session_id": "ps_3230"
}'
use Bank131\SDK\Client;
use Bank131\SDK\Config;
$config = new Config(
'https://demo.bank131.ru',
'your_project_name',
file_get_contents('/path/to/your/private_key.pem')
);
$client = new Client($config);
$response = $client->session()->capture('session_id');
Response parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
status | + | string | Status. Possible values: error, ok |
session | - | object | Payment session |
error | - | object | Error |
Response examples
- Successful response example
- Unsuccessful response example
{
"status": "ok",
"session": {
"id": "ps_3230",
"status": "in_progress",
"created_at": "2024-05-27T02:03:00.000000Z",
"updated_at": "2024-05-27T02:03:00.000000Z",
"acquiring_payments": [{
"id": "pm_1313",
"status": "succeeded",
"created_at": "2024-05-27T02:03:00.000000Z",
"finished_at": "2024-05-27T02:03:00.000000Z",
"customer": {
"reference": "lucky"
},
"payment_details": {
"type": "card",
"card": {
"brand": "mir",
"last4": "2058"
}
},
"amount_details": {
"amount": 10000,
"currency": "rub"
}
}]
}
}
{
"error": {
"code": "error code",
"description": "error description"
},
"status": "error"
}
Endpoint
/api/v2/session/capture
Request parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
session_id | + | string | Bank 131 session identifier |
amount_details | - | object | Amount to be debited. Can be less than the amount on hold, but greater than 0. If not specified, the full amount of the payment will be debited |
Request example
- cURL
- PHP
curl -X POST \
https://demo.bank131.ru/api/v2/session/capture \
-H 'Content-Type: application/json' \
-H 'X-PARTNER-PROJECT: your_project_name' \
-H 'X-PARTNER-SIGN: signature' \
-d '{
"session_id": "ps_3230"
}'
use Bank131\SDK\Client;
use Bank131\SDK\Config;
$config = new Config(
'https://demo.bank131.ru',
'your_project_name',
file_get_contents('/path/to/your/private_key.pem')
);
$client = new Client($config);
$response = $client->session()->capture('session_id');
Response parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
status | + | string | Status. Possible values: error, ok |
session | - | object | Payment session |
error | - | object | Error |
Response examples
- Successful response example
- Unsuccessful response example
{
"status": "ok",
"session": {
"id": "ps_3230",
"status": "in_progress",
"created_at": "2024-05-27T02:03:00.000000Z",
"updated_at": "2024-05-27T02:03:00.000000Z",
"payment_list": [{
"id": "pm_1313",
"status": "succeeded",
"created_at": "2024-05-27T02:03:00.000000Z",
"finished_at": "2024-05-27T02:03:00.000000Z",
"customer": {
"reference": "lucky"
},
"payment_details": {
"type": "card",
"card": {
"brand": "mir",
"last4": "2058"
}
},
"amount_details": {
"amount": 10000,
"currency": "rub"
}
}]
}
}
{
"error": {
"code": "error code",
"description": "error description"
},
"status": "error"
}
session/confirm
Confirming an operation
A method for confirming a payout or a payment after receiving a ready_to_confirm or ready_to_capture webhook from Bank 131. The request must be sent within 4 hours of the operation being created; otherwise, a confirm_timeout error is returned.
- API v1
- API v2
Endpoint
/api/v1/session/confirm
Request parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
session_id | + | string | Session identifier |
confirm_information | - (mandatory for operations with settlement and escrow accounts) | object | Transaction confirmation information |
Request example
- cURL
- PHP
curl -X POST \
https://demo.bank131.ru/api/v1/session/confirm \
-H 'Content-Type: application/json' \
-H 'X-PARTNER-PROJECT: your_project_name' \
-H 'X-PARTNER-SIGN: signature' \
-d '{
"session_id": "ps_3230"
}'
use Bank131\SDK\Client;
use Bank131\SDK\Config;
$config = new Config(
'https://demo.bank131.ru',
'your_project_name',
file_get_contents('/path/to/your/private_key.pem')
);
$client = new Client($config);
$response = $client->session()->confirm('session_id');
Response parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
status | + | string | Status. Possible values: error, ok |
session | - | object | Payment session |
error | - | object | Error |
Response examples
- Successful response example
- Unsuccessful response example
{
"status": "ok",
"session": {
"id": "ps_3230",
"status": "in_progress",
"created_at": "2018-05-27T02:03:00.000000Z",
"updated_at": "2018-05-27T02:03:00.000000Z",
"payments": [{
"id": "po_2018",
"status": "pending",
"created_at": "2018-05-27T02:03:00.000000Z",
"customer": {
"reference": "user123",
"contacts": [{
"email": "user@gmail.com"
}]
},
"payment_method": {
"type": "card",
"card": {
"last4": "2058",
"brand": "mir"
}
},
"amount_details": {
"amount": 10000,
"currency": "rub"
},
"metadata": "good"
}]
}
}
{
"status": "error",
"error": {
"description": "error description",
"code": "error code"
}
}
Endpoint
/api/v2/session/confirm
Request parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
session_id | + | string | Session identifier |
confirm_information | - (mandatory for operations with settlement and escrow accounts) | object | Transaction confirmation information |
Request example
- cURL
- PHP
curl -X POST \
https://demo.bank131.ru/api/v2/session/confirm \
-H 'Content-Type: application/json' \
-H 'X-PARTNER-PROJECT: your_project_name' \
-H 'X-PARTNER-SIGN: signature' \
-d '{
"session_id": "ps_3230"
}'
use Bank131\SDK\Client;
use Bank131\SDK\Config;
$config = new Config(
'https://demo.bank131.ru',
'your_project_name',
file_get_contents('/path/to/your/private_key.pem')
);
$client = new Client($config);
$response = $client->session()->confirm('session_id');
Response parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
status | + | string | Status. Possible values: error, ok |
session | - | object | Payment session |
error | - | object | Error |
Response examples
- Successful response example
- Unsuccessful response example
{
"status": "ok",
"session": {
"id": "ps_3230",
"status": "in_progress",
"created_at": "2018-05-27T02:03:00.000000Z",
"updated_at": "2018-05-27T02:03:00.000000Z",
"payout_list": [{
"id": "po_2018",
"status": "pending",
"created_at": "2018-05-27T02:03:00.000000Z",
"customer": {
"reference": "user123",
"contacts": [{
"email": "user@gmail.com"
}]
},
"payout_details": {
"type": "card",
"card": {
"last4": "2058",
"brand": "mir"
}
},
"amount_details": {
"amount": 10000,
"currency": "rub"
},
"metadata": "good"
}]
}
}
{
"status": "error",
"error": {
"description": "error description",
"code": "error code"
}
}
session/create
Creating a payment session
A method for creating a payment session. Returns session_id—the session identifier that Bank 131 uses to determine which session a request belongs to.
This method is mandatory for payments via the widget, as session_id is required to generate a public token. The token links the card details entered by the user to a specific session. Without it, Bank 131 cannot determine which payment the entered details and webhooks relate to.
If you accept payments via FPS, be sure to pass faster_payment_system in payment_details.
- API v1
- API v2
Endpoint
/api/v1/session/create
Request parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
payment_method | - | object | Payment details (card, customer account, etc.) |
payment_details | - | object | Transfer details |
amount_details | - | object | Amount. Transmitted in the ruble decimal format. To send 100 rubles, specify 10000 |
participant_details | - | object | Information about the participants (the sender and the recipient) |
customer | - | object | User's data in your system |
metadata | - | * | Any additional data you need to perform the operation. Bank 131 returns it in responses and webhooks. The value can be a string, a number, or an object |
Request example
- cURL
- PHP
curl -X POST \
https://demo.bank131.ru/api/v1/session/create \
-H 'Content-Type: application/json' \
-H 'X-PARTNER-PROJECT: your_project_name' \
-H 'X-PARTNER-SIGN: signature' \
-d '{
"amount_details": {
"amount": 10000,
"currency": "rub"
},
"metadata": "order123"
}'
use Bank131\SDK\API\Request\Builder\RequestBuilderFactory;
use Bank131\SDK\Client;
use Bank131\SDK\Config;
$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()
->createPaymentSession() //OR ->createPayoutSession()
->setAmount(10000, 'rub')
->setMetadata('order123')
->build();
$response = $client->session()->create($request);
Response parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
status | + | string | Status. Possible values: error, ok |
session | - | object | Payment session |
error | - | object | Error |
Response examples
- Successful response example
- Unsuccessful response example
{
"status": "ok",
"session": {
"id": "ps_3230",
"status": "created",
"created_at": "2018-05-27T02:03:00.000000Z",
"updated_at": "2018-05-27T02:03:00.000000Z"
}
}
{
"error": {
"code": "invalid_request",
"description": "customer.reference.not_blank"
},
"status": "error"
}
Endpoint
/api/v2/session/create
Request parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
payout_details | - | object | Payment details (card, customer account, etc.) |
payment_details | - | object | Transfer details |
amount_details | - | object | Amount. Transmitted in the ruble decimal format. To send 100 rubles, specify 10000 |
participant_details | - | object | Information about the participants (the sender and the recipient) |
customer | - | object | User's data in your system |
metadata | - | * | Any additional data you need to perform the operation. Bank 131 returns it in responses and webhooks. The value can be a string, a number, or an object |
Request example
- cURL
- PHP
curl -X POST \
https://demo.bank131.ru/api/v2/session/create \
-H 'Content-Type: application/json' \
-H 'X-PARTNER-PROJECT: your_project_name' \
-H 'X-PARTNER-SIGN: signature' \
-d '{
"amount_details": {
"amount": 10000,
"currency": "rub"
},
"metadata": "order123"
}'
use Bank131\SDK\API\Request\Builder\RequestBuilderFactory;
use Bank131\SDK\Client;
use Bank131\SDK\Config;
$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()
->createPaymentSession() //OR ->createPayoutSession()
->setAmount(10000, 'rub')
->setMetadata('order123')
->build();
$response = $client->session()->create($request);
Response parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
status | + | string | Status. Possible values: error, ok |
session | - | object | Payment session |
error | - | object | Error |
Response examples
- Successful response example
- Unsuccessful response example
{
"status": "ok",
"session": {
"id": "ps_3230",
"status": "created",
"created_at": "2018-05-27T02:03:00.000000Z",
"updated_at": "2018-05-27T02:03:00.000000Z"
}
}
{
"error": {
"code": "invalid_request",
"description": "customer.reference.not_blank"
},
"status": "error"
}
session/refund
Creating a refund
A method for returning money to the sender. You can return the full payment amount or part of it, while the fee is non-refundable. A refund cannot be canceled—before sending the request, make sure that it is really necessary.
After the refund, Bank 131 will send you a payment_refunded webhook with the result.
- API v1
- API v2
Endpoint
/api/v1/session/refund
Request parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
session_id | + | string | Identifier of the session to refund |
amount_details | - | object | Amount. If not specified, the full payment amount is returned to the sender |
metadata | - | * | Any additional data you need to perform the operation. Bank 131 returns it in responses and webhooks. The value can be a string, a number, or an object |
Request example
- cURL
- PHP
curl -X POST \
https://demo.bank131.ru/api/v1/session/refund \
-H 'Content-Type: application/json' \
-H 'X-PARTNER-PROJECT: your_project_name' \
-H 'X-PARTNER-SIGN: signature' \
-d '{
"session_id": "ps_3230"
}'
use Bank131\SDK\API\Request\Builder\RequestBuilderFactory;
use Bank131\SDK\Client;
use Bank131\SDK\Config;
$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()
->refundSession('ps_3230')
->build();
$response = $client->session()->refund($request);
Response parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
status | + | string | Status. Options: error, ok |
session | - | object | Payment session |
error | - | object | Error |
Response examples
- Successful response example
- Unsuccessful response example
{
"status": "ok",
"session": {
"id": "ps_3230",
"status": "in_progress",
"created_at": "2025-05-27T02:03:00.000000Z",
"updated_at": "2025-05-27T02:03:00.000000Z",
"acquiring_payments": [{
"id": "pm_2705",
"status": "succeeded",
"created_at": "2025-05-27T02:03:00.000000Z",
"finished_at": "2025-05-27T02:03:00.000000Z",
"customer": {
"reference": "lucky"
},
"payment_details": {
"type": "card",
"card": {
"brand": "mir",
"last4": "2058"
}
},
"amount_details": {
"amount": 10000,
"currency": "rub"
},
"refunds": [{
"id": "rf_23",
"status": "in_progress",
"created_at": "2025-05-27T02:03:00.000000Z",
"amount_details": {
"amount": 10000,
"currency": "rub"
}
}]
}]
}
}
{
"status": "error",
"error": {
"description": "error description",
"code": "error code"
}
}
Endpoint
/api/v2/session/refund
Request parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
session_id | + | string | Identifier of the session to refund |
amount_details | - | object | Amount. If not specified, the full payment amount is returned to the sender |
metadata | - | * | Any additional data you need to perform the operation. Bank 131 returns it in responses and webhooks. The value can be a string, a number, or an object |
Request example
- cURL
- PHP
curl -X POST \
https://demo.bank131.ru/api/v2/session/refund \
-H 'Content-Type: application/json' \
-H 'X-PARTNER-PROJECT: your_project_name' \
-H 'X-PARTNER-SIGN: signature' \
-d '{
"session_id": "ps_3230"
}'
use Bank131\SDK\API\Request\Builder\RequestBuilderFactory;
use Bank131\SDK\Client;
use Bank131\SDK\Config;
$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()
->refundSession('ps_3230')
->build();
$response = $client->session()->refund($request);
Response parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
status | + | string | Status. Options: error, ok |
session | - | object | Payment session |
error | - | object | Error |
Response examples
- Successful response example
- Unsuccessful response example
{
"status": "ok",
"session": {
"id": "ps_3230",
"status": "in_progress",
"created_at": "2025-05-27T02:03:00.000000Z",
"updated_at": "2025-05-27T02:03:00.000000Z",
"payment_list": [{
"id": "pm_2705",
"status": "succeeded",
"created_at": "2025-05-27T02:03:00.000000Z",
"finished_at": "2025-05-27T02:03:00.000000Z",
"customer": {
"reference": "lucky"
},
"payment_details": {
"type": "card",
"card": {
"brand": "mir",
"last4": "2058"
}
},
"amount_details": {
"amount": 10000,
"currency": "rub"
},
"refunds": [{
"id": "rf_23",
"status": "in_progress",
"created_at": "2025-05-27T02:03:00.000000Z",
"amount_details": {
"amount": 10000,
"currency": "rub"
}
}]
}]
}
}
{
"status": "error",
"error": {
"description": "error description",
"code": "error code"
}
}
session/start/payment
Starting a payment
A method for starting a payment within an existing session. In the request, you can pass the missing parameters or replace the ones that have already been passed.
- API v1
- API v2
Endpoint
/api/v1/session/start/payment
Request parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
session_id | + | string | Payment session identifier |
payment_details | - | object | Payment data |
amount_details | - | object | Amount |
customer | - | object | Payment sender information in your system |
payment_options | - | object | Additional payment settings |
metadata | - | * | Any additional data you need to perform the operation. Bank 131 returns it in responses and webhooks. The value can be a string, a number, or an object |
Request example
- cURL
- PHP
curl -X POST \
https://demo.bank131.ru/api/v1/session/start/payment \
-H 'Content-Type: application/json' \
-H 'X-PARTNER-PROJECT: your_project_name' \
-H 'X-PARTNER-SIGN: signature' \
-d '{
"session_id": "ps_3230",
"payment_details": {
"type": "card",
"card": {
"type": "bank_card",
"bank_card": {
"number": "2200774546102058",
"expiration_month": "01",
"expiration_year": "35",
"security_code": "123"
}
}
},
"amount_details": {
"amount": 10000,
"currency": "rub"
},
"customer": {
"reference": "lucky"
},
"payment_options": {
"return_url": "https://www.131.ru"
},
"metadata": "good"
}'
use Bank131\SDK\API\Request\Builder\RequestBuilderFactory;
use Bank131\SDK\Client;
use Bank131\SDK\Config;
use Bank131\SDK\DTO\Card\BankCard;
use Bank131\SDK\DTO\Customer;
use Bank131\SDK\DTO\PaymentOptions;
$config = new Config(
'https://demo.bank131.ru',
'your_project_name',
file_get_contents('/path/to/your/private_key.pem')
);
$client = new Client($config);
$paymentOptions = new PaymentOptions();
$paymentOptions->setReturnUrl('return_url');
$request = RequestBuilderFactory::create()
->startPaymentSession('session_id')
->setCard(
new BankCard(
'number',
'expiration_month',
'expiration_year',
'security_code'
)
)
->setCustomer(
new Customer('reference')
)
->setPaymentOptions($paymentOptions)
->setAmount(10000, 'rub')
->setMetadata('good')
->build();
$response = $client->session()->startPayment($request);
Response parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
status | + | string | Status. Possible values: error, ok |
session | - | object | Payment session |
error | - | object | Error |
Response examples
- Successful response example
- Unsuccessful response example
{
"status": "ok",
"session": {
"id": "ps_3230",
"status": "in_progress",
"created_at": "2024-08-21T06:21:36.913863Z",
"updated_at": "2024-08-21T06:21:56.832509Z",
"acquiring_payments": [{
"id": "pm_3232",
"status": "in_progress",
"created_at": "2024-08-21T06:21:56.846204Z",
"customer": {
"reference": "lucky"
},
"payment_details": {
"type": "card",
"card": {
"last4": "2058",
"brand": "mir",
"country_iso3": "RUS"
}
},
"amount_details": {
"amount": 10000,
"currency": "rub"
},
"payment_options": {
"return_url": "https://www.131.ru"
},
"metadata": "good"
}]
}
}
{
"status": "error",
"error": {
"description": "internal error",
"code": "repository_record_not_found"
}
}
Endpoint
/api/v2/session/start/payment
Request parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
session_id | + | string | Payment session identifier |
payment_details | - | object | Payment data |
amount_details | - | object | Amount |
customer | - | object | Payment sender information in your system |
payment_options | - | object | Additional payment settings |
metadata | - | * | Any additional data you need to perform the operation. Bank 131 returns it in responses and webhooks. The value can be a string, a number, or an object |
Request example
- cURL
- PHP
curl -X POST \
https://demo.bank131.ru/api/v2/session/start/payment \
-H 'Content-Type: application/json' \
-H 'X-PARTNER-PROJECT: your_project_name' \
-H 'X-PARTNER-SIGN: signature' \
-d '{
"session_id": "ps_3230",
"payment_details": {
"type": "card",
"card": {
"type": "bank_card",
"bank_card": {
"number": "2200774546102058",
"expiration_month": "01",
"expiration_year": "35",
"security_code": "123"
}
}
},
"amount_details": {
"amount": 10000,
"currency": "rub"
},
"customer": {
"reference": "lucky"
},
"payment_options": {
"return_url": "https://www.131.ru"
},
"metadata": "good"
}'
use Bank131\SDK\API\Request\Builder\RequestBuilderFactory;
use Bank131\SDK\Client;
use Bank131\SDK\Config;
use Bank131\SDK\DTO\Card\BankCard;
use Bank131\SDK\DTO\Customer;
use Bank131\SDK\DTO\PaymentOptions;
$config = new Config(
'https://demo.bank131.ru',
'your_project_name',
file_get_contents('/path/to/your/private_key.pem')
);
$client = new Client($config);
$paymentOptions = new PaymentOptions();
$paymentOptions->setReturnUrl('return_url');
$request = RequestBuilderFactory::create()
->startPaymentSession('session_id')
->setCard(
new BankCard(
'number',
'expiration_month',
'expiration_year',
'security_code'
)
)
->setCustomer(
new Customer('reference')
)
->setPaymentOptions($paymentOptions)
->setAmount(10000, 'rub')
->setMetadata('good')
->build();
$response = $client->session()->startPayment($request);
Response parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
status | + | string | Status. Possible values: error, ok |
session | - | object | Payment session |
error | - | object | Error |
Response examples
- Successful response example
- Unsuccessful response example
{
"status": "ok",
"session": {
"id": "ps_3230",
"status": "in_progress",
"created_at": "2024-08-21T06:21:36.913863Z",
"updated_at": "2024-08-21T06:21:56.832509Z",
"payment_list": [{
"id": "pm_3232",
"status": "in_progress",
"created_at": "2024-08-21T06:21:56.846204Z",
"customer": {
"reference": "lucky"
},
"payment_details": {
"type": "card",
"card": {
"last4": "2058",
"brand": "mir",
"country_iso3": "RUS"
}
},
"amount_details": {
"amount": 10000,
"currency": "rub"
},
"payment_options": {
"return_url": "https://www.131.ru"
},
"metadata": "good"
}]
}
}
{
"status": "error",
"error": {
"description": "internal error",
"code": "repository_record_not_found"
}
}
session/start/payout
Starting a payout
A method for starting a payout within an existing session. In the request, you can pass the missing parameters or replace the ones that have already been passed.
- API v1
- API v2
Endpoint
/api/v1/session/start/payout
Request parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
session_id | + | string | Payment session identifier |
payment_method | - | object | Payout details (card, customer account, etc.) |
amount_details | - | object | Amount |
participant_details | - (mandatory for payouts to bank cards) | object | Information on payout participants |
customer | - | object | Recipient's data in your system |
metadata | - | * | Any additional data you need to perform the operation. Bank 131 returns it in responses and webhooks. The value can be a string, a number, or an object |
Request example
curl -X POST \
https://demo.bank131.ru/api/v1/session/start/payout \
-H 'Content-Type: application/json' \
-H 'X-PARTNER-PROJECT: your_project_name' \
-H 'X-PARTNER-SIGN: signature' \
-d '{
"session_id": "ps_3230",
"participant_details": {
"recipient": {
"full_name": "Ivan Ivanovich Ivanov"
}
}
}'
Response parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
status | + | string | Status. Possible values: error, ok |
session | - | object | Payment session |
error | - | object | Error |
Response examples
- Successful response example
- Unsuccessful response example
{
"status": "ok",
"session": {
"id": "ps_3230",
"status": "in_progress",
"created_at": "2018-05-27T02:03:00.000000Z",
"updated_at": "2018-05-27T02:03:00.000000Z",
"payments": [{
"id": "po_2018",
"status": "in_progress",
"created_at": "2018-05-27T02:03:00.000000Z",
"customer": {
"reference": "user123",
"contacts": [{
"email": "user@gmail.com"
}]
},
"payment_method": {
"type": "card",
"card": {
"last4": "2058",
"brand": "mir"
}
},
"amount_details": {
"amount": 10000,
"currency": "rub"
},
"participant_details": {
"recipient": {
"full_name": "Ivan Ivanovich Ivanov"
}
},
"metadata": "good"
}]
}
}
{
"status": "error",
"error": {
"description": "error description",
"code": "error code"
}
}
Endpoint
/api/v2/session/start/payout
Request parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
session_id | + | string | Payment session identifier |
payout_details | - | object | Payout details (card, customer account, etc.) |
amount_details | - | object | Amount |
participant_details | - (mandatory for payouts to bank cards) | object | Information on payout participants |
customer | - | object | Recipient's data in your system |
metadata | - | * | Any additional data you need to perform the operation. Bank 131 returns it in responses and webhooks. The value can be a string, a number, or an object |
Request example
curl -X POST \
https://demo.bank131.ru/api/v2/session/start/payout \
-H 'Content-Type: application/json' \
-H 'X-PARTNER-PROJECT: your_project_name' \
-H 'X-PARTNER-SIGN: signature' \
-d '{
"session_id": "ps_3230",
"participant_details": {
"recipient": {
"full_name": "Ivan Ivanovich Ivanov"
}
}
}'
Response parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
status | + | string | Status. Possible values: error, ok |
session | - | object | Payment session |
error | - | object | Error |
Response examples
- Successful response example
- Unsuccessful response example
{
"status": "ok",
"session": {
"id": "ps_3230",
"status": "in_progress",
"created_at": "2018-05-27T02:03:00.000000Z",
"updated_at": "2018-05-27T02:03:00.000000Z",
"payout_list": [{
"id": "po_2018",
"status": "in_progress",
"created_at": "2018-05-27T02:03:00.000000Z",
"customer": {
"reference": "user123",
"contacts": [{
"email": "user@gmail.com"
}]
},
"payout_details": {
"type": "card",
"card": {
"last4": "2058",
"brand": "mir"
}
},
"amount_details": {
"amount": 10000,
"currency": "rub"
},
"participant_details": {
"recipient": {
"full_name": "Ivan Ivanovich Ivanov"
}
},
"metadata": "good"
}]
}
}
{
"status": "error",
"error": {
"description": "error description",
"code": "error code"
}
}
token
Getting a token to work with the widgets
A method for getting a public token required to work with the widgets. It is valid for 24 hours and is intended for a single operation.
In the request, specify the type of widget for which you need to get the token.
Endpoint
/api/v1/token
Request parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
tokenize_widget | - | object | Data required by the tokenization widget |
acquiring_widget | - | object | Data required by the payment form widget |
sber_pay_widget | - | object | Data required by the SberPay widget |
Details
An example of a token request for a payout that obtains card details via the widget
- cURL
- PHP
curl -X POST \
https://demo.bank131.ru/api/v1/token \
-H 'Content-Type: application/json' \
-H 'X-PARTNER-PROJECT: your_project_name' \
-H 'X-PARTNER-SIGN: signature' \
-d '{
"tokenize_widget": {
"access": true
}
}'
use Bank131\SDK\API\Request\Builder\RequestBuilderFactory;
use Bank131\SDK\Client;
use Bank131\SDK\Config;
$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()
->issuePublicTokenBuilder()
->setTokenizeWidget()
->build();
$response = $client->widget()->issuePublicToken($request);
$publicToken = $response->getPublicToken();
An example of how to get a token to perform a payment through a payment form
curl -X POST \
https://demo.bank131.ru/api/v1/token \
-H 'Content-Type: application/json' \
-H 'X-PARTNER-PROJECT: your_project_name' \
-H 'X-PARTNER-SIGN: signature' \
-d '{
"acquiring_widget": {
"session_id": "ps_123456"
}
}'
An example of how to get a token to perform a payment via SberPay
curl -X POST \
https://demo.bank131.ru/api/v1/token \
-H 'Content-Type: application/json' \
-H 'X-PARTNER-PROJECT: your_project_name' \
-H 'X-PARTNER-SIGN: signature' \
-d '{
"sber_pay_widget": {
"session_id": "ps_77872830",
"phone": "79680000000",
"return_url": "https://131.ru"
}
}'
Response parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
status | + | string | Status. Possible values: error, ok |
public_token | - | string | Public token |
error | - | object | Error |
Response examples
- Successful response example
- Unsuccessful response example
{
"status": "ok",
"public_token": "e065c2f1328e74156a883c00e210a4b1b1451782bbfdd18ae8d05715e05d8539"
}
{
"status": "error",
"error": {
"description": "acquiring_widget.session_id.not_unique",
"code": "invalid_request"
}
}
tokenize
Tokenizing a bank account number
A method for tokenizing a bank account (for a payout). Use it to get a token and a masked account number. The token received in the response does not expire.
You can tokenize any account that passes verification against a specified range of accounts. Otherwise, the “Enter a different account number” error will be returned.
Endpoint
/api/v1/tokenize
Request parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
type | + | string | Bank account type. Possible value: bank_account_ru |
bank_account_ru | + | object | Russian bank account details |
Request example
curl -X POST \
https://demo.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": "044525974",
"account": "40817810400003869535"
}
}'
Response parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
status | + | string | Status. Possible values: error, ok |
token | - | string | Token |
data | - | object | Masked user account data object |
error | - | object | Error |
Response examples
- Successful response example
- Unsuccessful response example
{
"status": "ok",
"token": "d47b2f90a6c1e8350f9a4d7c2e6b183fa5c0d9e472b6f8a1c3e5d7092b4f6a8c",
"data": {
"masked_account": "40817***9535"
}
}
{
"status": "error",
"error": {
"description": "Invalid account",
"code": "invalid_account"
}
}
tokenize/elements
Tokenizing a card number
A method for tokenizing a bank card number. As a result, the card number is stored in the Bank 131 system, and you receive a token for making multiple payouts to this card. The token has no expiration date.
To start using this method, please contact your manager in Bank 131.
Endpoint
/api/v1/tokenize/elements
Request parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
card_elements | + | array | Card number |
Request example
curl -X POST \
https://demo.bank131.ru/api/v1/tokenize/elements \
-H 'Content-Type: application/json' \
-H 'X-PARTNER-PROJECT: your_project_name' \
-H 'X-PARTNER-SIGN: signature' \
-d '{
"card_elements": [
{
"ref": "number",
"type": "card_number",
"card_number": "2200774546102058"
}
]
}'
Response parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
status | + | string | Status. Possible values: error, ok |
data | - | object | Card data |
error | - | object | Error |
Response examples
- Successful response example
- Unsuccessful response example
{
"status": "ok",
"data": {
"number": {
"token": "9a1c4e7f2b8d5036af61c9e0d4b72f8a3c5e190d6f24b8a7c0e3d5f19b6a2c48",
"info": {
"masked_card_number": "220077******2058",
"card_network": "mir",
"card_type": "mir"
}
}
}
}
{
"status": "error",
"error": {
"description": "error description",
"code": "error code"
}
}
Information
fps/banks
Getting a list pf FPS member banks
A method for getting a list of banks with their names and identifiers for sending payouts via the Faster Payments System.
Endpoint
/api/v1/fps/banks
Request example
- cURL
- PHP
curl -X GET \
https://demo.bank131.ru/api/v1/fps/banks \
-H 'Content-Type: application/json' \
-H 'X-PARTNER-PROJECT: your_project_name' \
-H 'X-PARTNER-SIGN: signature' \
-d '{}'
use Bank131\SDK\Client;
$response = $client->fps()->getBanks();
foreach ($response->getBanks() as $bank) {
echo $bank->getId(), ' ', $bank->getRuName(), ' ', $bank->getEngName(), PHP_EOL;
}
Response example
{
"banks": [{
"id": "100000000243",
"eng_name": "National Standard Bank",
"ru_name": "Национальный стандарт"
},
{
"id": "100000000056",
"eng_name": "Khlynov",
"ru_name": "Хлынов"
}
// ...
]
}
report/account_balance
Checking the balance
A method for getting your settlement or escrow account balance.
Endpoint
/api/v1/report/account_balance
Request parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
account_number | + | string | Account number. The account number must start as follows: 40702, 40703, 40802, 40807, 40701 |
Request example
curl -X POST \
https://demo.bank131.ru/api/v1/report/account_balance \
-H 'Content-Type: application/json' \
-H 'X-PARTNER-PROJECT: your_project_name' \
-H 'X-PARTNER-SIGN: signature' \
-d '{
"account_number": "40702810400000000333"
}'
Response parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
status | + | string | Status. Options: error, ok |
account_number | - | string | Account number |
account_currency | - | string | Account currency according to ISO 4217. Example: RUB |
balance | - | object | Balance details |
error | - | object | Error |
Response examples
- Successful response example
- Unsuccessful response example
{
"status": "ok",
"account_number": "40702810400000000333",
"account_currency": "RUB",
"balance": {
"current_balance": 20900
}
}
{
"status": "error",
"error": {
"code": "Error code",
"description": "Error description"
}
}
report/account_statement
Getting a bank statement
A method for getting bank statements for your settlement or escrow account opened in rubles for a day.
Endpoint
/api/v1/report/account_statement
Request parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
account_number | + | string | Account number (20 digits) for which you request a statement |
date_from | + | date | Statement start date. Example: 2023-06-01 |
date_to | + | date | Statement end date. Example: 2023-06-01 |
The
date_fromanddate_tovalues must match.
Request example
curl -X POST \
https://demo.bank131.ru/api/v1/report/account_statement \
-H 'Content-Type: application/json; charset=utf-8' \
-H 'X-PARTNER-PROJECT: your_project_name' \
-H 'X-PARTNER-SIGN: signature' \
-d '{
"date_from": "2023-06-01",
"date_to": "2023-06-01",
"account_number": "40702810600200000014"
}'
Response parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
status | + | string | Status. Possible values: error, ok |
method | - | object | Method data |
error | - | object | Error |
Successful response example
{
"status": "ok",
"method": {
"name": "account_statement",
"account_statement": {
"date_from": "2022-11-13",
"date_to": "2022-11-13",
"account_number": "40703810500000000025",
"total_turnover": {
"debet": 0,
"credit": 10000
},
"total_balance": {
"opening": 0,
"closing": 10000
},
"transactions": [{
"amount": 10000,
"currency": "rub",
"payment_date": "2022-11-13",
"bank_system_id": "2080040097819020",
"transaction_id": "c7b923ec-844f-4d98-ad02-795d62fe1989",
"session_id": "ps_3230",
"purpose": "Account replenishment",
"counter_party": {
"kpp": "165501001",
"inn": "1655415696",
"name": "Fee for money transfer processing services",
"account_number": "70606810600004710401",
"bank_code": "049205131"
},
"type": "credit"
}]
}
}
}
Unsuccessful response examples
- Invalid dates
- Invalid JSON format
- Internal error
date_from does not match date_to
{
"status": "error",
"error": {
"description": "Invalid input request parameters: (max interval is 1 day)",
"code": "invalid_request"
}
}
date_from is greater than date_to
{
"status": "error",
"error": {
"description": "Invalid input request parameters: (date_to must be greater than date_from); (max interval is 1 day)",
"code": "invalid_request"
}
}
Invalid date in date_from
{
"status": "error",
"error": {
"description": "Invalid value in date_from",
"code": "invalid_request"
}
}
Invalid date in date_to
{
"status": "error",
"error": {
"description": "Invalid value in date_to",
"code": "invalid_request"
}
}
{
"status": "error",
"error": {
"description": "Invalid request",
"code": "invalid_request"
}
}
This response is returned in the following cases:
- the account number is specified incorrectly
- the specified account does not exist
- the specified account does not belong to the user who initiated the request
{
"status": "error",
"error": {
"description": "Internal error",
"code": "internal_error"
}
}
session/status
Getting session information
A method for obtaining full information about the payment session. For example, you can check the payout status or find out whether the held amount can be debited.
- API v1
- API v2
Endpoint
/api/v1/session/status
Request parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
session_id | + | string | Payment session identifier |
Request example
- cURL
- PHP
curl -X POST \
https://demo.bank131.ru/api/v1/session/status \
-H 'Content-Type: application/json' \
-H 'X-PARTNER-PROJECT: your_project_name' \
-H 'X-PARTNER-SIGN: signature' \
-d '{
"session_id": "ps_3230"
}'
use Bank131\SDK\API\Request\Builder\RequestBuilderFactory;
use Bank131\SDK\Client;
use Bank131\SDK\Config;
$config = new Config(
'https://demo.bank131.ru',
'your_project_name',
file_get_contents('/path/to/your/private_key.pem')
);
$client = new Client($config);
$response = $client->session()->status('session_id');
Response parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
status | + | string | Status. Possible values: error, ok |
session | - | object | Payment session |
error | - | object | Error |
Response examples
- Successful response example
- Unsuccessful response example
{
"status": "ok",
"session": {
"id": "ps_3230",
"status": "in_progress",
"created_at": "2018-05-27T02:03:00.000000Z",
"updated_at": "2018-05-27T02:03:00.000000Z",
"next_action": "confirm",
"payments": [{
"id": "po_2018",
"status": "in_progress",
"created_at": "2018-05-27T02:03:00.000000Z",
"customer": {
"reference": "user123",
"contacts": [{
"email": "user@gmail.com"
}]
},
"payment_method": {
"type": "card",
"card": {
"last4": "2058",
"brand": "mir",
"bin": "220077"
}
},
"amount_details": {
"amount": 10000,
"currency": "rub"
},
"transaction_info": {
"rrn": "425307614918",
"auth_code": "057441"
},
"metadata": "good"
}]
}
}
{
"status": "error",
"error": {
"description": "error description",
"code": "error code"
}
}
Endpoint
/api/v2/session/status
Request parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
session_id | + | string | Payment session identifier |
Request example
- cURL
- PHP
curl -X POST \
https://demo.bank131.ru/api/v2/session/status \
-H 'Content-Type: application/json' \
-H 'X-PARTNER-PROJECT: your_project_name' \
-H 'X-PARTNER-SIGN: signature' \
-d '{
"session_id": "ps_3230"
}'
use Bank131\SDK\API\Request\Builder\RequestBuilderFactory;
use Bank131\SDK\Client;
use Bank131\SDK\Config;
$config = new Config(
'https://demo.bank131.ru',
'your_project_name',
file_get_contents('/path/to/your/private_key.pem')
);
$client = new Client($config);
$response = $client->session()->status('session_id');
Response parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
status | + | string | Status. Possible values: error, ok |
session | - | object | Payment session |
error | - | object | Error |
Response examples
- Successful response example
- Unsuccessful response example
{
"status": "ok",
"session": {
"id": "ps_3230",
"status": "in_progress",
"created_at": "2018-05-27T02:03:00.000000Z",
"updated_at": "2018-05-27T02:03:00.000000Z",
"next_action": "confirm",
"payout_list": [{
"id": "po_2018",
"status": "in_progress",
"created_at": "2018-05-27T02:03:00.000000Z",
"customer": {
"reference": "user123",
"contacts": [{
"email": "user@gmail.com"
}]
},
"payout_details": {
"type": "card",
"card": {
"last4": "2058",
"brand": "mir",
"bin": "220077"
}
},
"amount_details": {
"amount": 10000,
"currency": "rub"
},
"transaction_info": {
"rrn": "425307614918",
"auth_code": "057441"
},
"metadata": "good"
}]
}
}
{
"status": "error",
"error": {
"description": "error description",
"code": "error code"
}
}
token/info
Getting token information
A method for getting information about a token: both about the linked payment method and about its technical parameters.
With this method you can get the following information:
- for a card – masked card number and payment system type
- for an account – masked account number
- for the token itself – token type, creation date and time, expiration date, active/inactive status at the moment of inquiry
Endpoint
/api/v1/token/info
Request parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
type | + | string | Type of request. Options: card, public_token, recurrent_token, bank_account_ru |
card | - (mandatory for type = card) | object | Bank card details |
public_token | - (mandatory for type = public_token) | object | Token details |
recurrent_token | - (mandatory for type = recurrent_token) | object | Token details |
bank_account_ru | - (mandatory for type = bank_account_ru) | object | Bank account details |
Information request examples
- Card number hash
- Public token
- Token for recurring payments or payouts
- Bank account token
You send a card number hash and receive information about it.
curl -X POST \
https://demo.bank131.ru/api/v1/token/info \
-H 'Content-Type: application/json' \
-H 'X-PARTNER-PROJECT: your_project_name' \
-H 'X-PARTNER-SIGN: signature' \
-d '{
"type": "card",
"card": {
"type": "encrypted_card",
"encrypted_card": {
"number_hash": "9a1c4e7f2b8d5036af61c9e0d4b72f8a3c5e190d6f24b8a7c0e3d5f19b6a2c48"
}
}
}'
You send a public token and receive information about it.
curl -X POST \
https://demo.bank131.ru/api/v1/token/info \
-H 'Content-Type: application/json' \
-H 'X-PARTNER-PROJECT: your_project_name' \
-H 'X-PARTNER-SIGN: signature' \
-d '{
"type": "public_token",
"public_token": {
"token": "your_token"
}
}'
You send a token and receive information about it.
curl -X POST \
https://demo.bank131.ru/api/v1/token/info \
-H 'Content-Type: application/json' \
-H 'X-PARTNER-PROJECT: your_project_name' \
-H 'X-PARTNER-SIGN: signature' \
-d '{
"type": "recurrent_token",
"recurrent_token": {
"token": "9a1c4e7f2b8d5036af61c9e0d4b72f8a3c5e190d6f24b8a7c0e3d5f19b6a2c48"
}
}'
You send a token and receive information about it.
curl -X POST \
https://demo.bank131.ru/api/v1/token/info \
-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": {
"token": "d47b2f90a6c1e8350f9a4d7c2e6b183fa5c0d9e472b6f8a1c3e5d7092b4f6a8c"
}
}'
Response parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
status | + | string | Status. Possible values: error, ok |
info | - | object | Information about the token, depending on the type of request (type): tokenized bank card, public token, token for recurring payments or payouts, or bank account token |
error | - | object | Error |
Response examples
- Card information via hash
- Information about a public token
- Information about a token for recurring payments or payouts
- Information about a bank account token
{
"status": "ok",
"info": {
"number_hash": "9a1c4e7f2b8d5036af61c9e0d4b72f8a3c5e190d6f24b8a7c0e3d5f19b6a2c48",
"brand": "mir",
"last4": "2058",
"type": "card"
}
}
{
"status": "ok",
"info": {
"token": "your_token",
"created_at": "2021-03-17T14:10:56+03:00",
"finished_at": "2021-03-18T14:10:56+03:00",
"is_active": true,
"type": "public_token"
}
}
{
"status": "ok",
"info": {
"token": "9a1c4e7f2b8d5036af61c9e0d4b72f8a3c5e190d6f24b8a7c0e3d5f19b6a2c48",
"created_at": "2021-03-17T14:19:05+03:00",
"finished_at": "2021-04-17T14:19:05+03:00",
"is_active": true,
"type": "recurrent_token"
}
}
{
"status": "ok",
"info": {
"masked_account": "40817***9535",
"created_at": "2024-02-08T17:17:44+03:00",
"finished_at": "2124-02-08T17:17:44+03:00",
"type": "bank_account_ru"
}
}
wallet/balance
Checking the balance
A method for getting the current balance of your collateral account. Use it to make sure there is enough money for payouts and refunds. If the amount is insufficient, top up the account.
You can find your acquiring balance information in your online banking service account in the Statements section.
Endpoint
/api/v1/wallet/balance
Request parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
request_datetime | + | string | Timestamp of the request in ISO 8601 |
Request example
- cURL
- PHP
curl -X POST \
https://demo.bank131.ru/api/v1/wallet/balance \
-H 'Content-Type: application/json' \
-H 'X-PARTNER-PROJECT: your_project_name' \
-H 'X-PARTNER-SIGN: signature' \
-d '{
"request_datetime": "2019-10-14T19:53:00+03:00"
}'
use Bank131\SDK\API\Request\Builder\RequestBuilderFactory;
use Bank131\SDK\Client;
use Bank131\SDK\Config;
$config = new Config(
'https://demo.bank131.ru',
'your_project_name',
file_get_contents('/path/to/your/private_key.pem')
);
$client = new Client($config);
$walletBalanceResponse = $client->wallet()->balance();
$wallets = $walletBalanceResponse->getWallets();
Response parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
status | + | string | Status. Possible values: error, ok |
wallets | - | array | List of guarantee payment accounts available at Bank 131 |
error | - | object | Error |
Response examples
- Successful response example
- Unsuccessful response example
{
"status": "ok",
"wallets": [{
"id": "131",
"amount_details": {
"amount": 13100,
"currency": "rub"
}
}]
}
{
"status": "error",
"error": {
"description": "error description",
"code": "error code"
}
}
Escrow account
session/create/nominal
Creating a payment session
A method for creating a payment session for a payout to a bank account. It returns session_id—a session identifier used by Bank 131 to determine the session associated with a request.
Use this method if you get the bank account details for a payout through a widget and send the payout as a separate request within the created session.
- API v1
- API v2
Endpoint
/api/v1/session/create/nominal
Request parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
payment_method | - | object | Payment details |
amount_details | - | object | Amount. Transmitted in the ruble decimal format. To send 100 rubles, specify 10000 |
participant_details | - | object | Information about the participants (the sender and the recipient) |
metadata | - | * | Any additional data you need to perform the operation. Bank 131 returns it in responses and webhooks. The value can be a string, a number, or an object |
Request examples
curl -X POST \
https://demo.bank131.ru/api/v1/session/create/nominal \
-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": {
"ru": {
"bik": "044525974",
"account": "40817810400003869535",
"full_name": "Ivanov Ivan Ivanovich",
"description": "Funds transfer according to contract No. 5015553111 Ivanov Ivan Ivanovich VAT exempt"
},
"system_type": "ru"
}
},
"amount_details": {
"amount": 300,
"currency": "rub"
},
"participant_details": {
"sender": {
"account": "40702810300200000013"
},
"recipient": {
"beneficiary_id": "065553161159"
}
}
}'
Response parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
status | + | string | Status. Valid values: error, ok |
session | - | object | Payment session |
error | - | object | Error |
Response examples
- Successful response example
- Unsuccessful response example
{
"status": "ok",
"session": {
"id": "ps_12345",
"status": "created",
"created_at": "2023-05-10T16:58:43.586072Z",
"updated_at": "2023-05-10T16:58:43.705620Z"
}
}
{
"status": "error",
"error": {
"description": "error description",
"code": "error code"
}
}
Endpoint
/api/v2/session/create/nominal
Request parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
payout_details | - | object | Payment details |
amount_details | - | object | Amount. Transmitted in the ruble decimal format. To send 100 rubles, specify 10000 |
participant_details | - | object | Information about the participants (the sender and the recipient) |
metadata | - | * | Any additional data you need to perform the operation. Bank 131 returns it in responses and webhooks. The value can be a string, a number, or an object |
Request examples
curl -X POST \
https://demo.bank131.ru/api/v2/session/create/nominal \
-H 'Content-Type: application/json' \
-H 'X-PARTNER-SIGN: signature' \
-H 'X-PARTNER-PROJECT: your_project_name' \
-d '{
"payout_details": {
"type": "bank_account",
"bank_account": {
"ru": {
"bik": "044525974",
"account": "40817810400003869535",
"full_name": "Ivanov Ivan Ivanovich",
"description": "Funds transfer according to contract No. 5015553111 Ivanov Ivan Ivanovich VAT exempt"
},
"system_type": "ru"
}
},
"amount_details": {
"amount": 300,
"currency": "rub"
},
"participant_details": {
"sender": {
"account": "40702810300200000013"
},
"recipient": {
"beneficiary_id": "065553161159"
}
}
}'
Response parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
status | + | string | Status. Valid values: error, ok |
session | - | object | Payment session |
error | - | object | Error |
Response examples
- Successful response example
- Unsuccessful response example
{
"status": "ok",
"session": {
"id": "ps_12345",
"status": "created",
"created_at": "2023-05-10T16:58:43.586072Z",
"updated_at": "2023-05-10T16:58:43.705620Z"
}
}
{
"status": "error",
"error": {
"description": "error description",
"code": "error code"
}
}
session/multi/create/nominal
Creating a payment session
A method for creating a payment session for a payout to a card. It returns session_id—a session identifier used by Bank 131 to determine the session associated with a request.
Use this method if you get the card details for a payout through a widget and send the payout as a separate request within the created session.
- API v1
- API v2
Endpoint
/api/v1/session/multi/create/nominal
Request parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
payment_details | - | object | Transfer details |
payment_method | - | object | Payment details (card, customer account, etc.) |
participant_details | - | object | Information about the participants (the sender and the recipient) |
amount_details | - | object | Amount. Transmitted in the ruble decimal format. To send 100 rubles, specify 10000 |
customer | - | object | Recipient's data in your system |
metadata | - | * | Any additional data you need to perform the operation. Bank 131 returns it in responses and webhooks. The value can be a string, a number, or an object |
Request example
curl -X POST \
https://demo.bank131.ru/api/v1/session/multi/create/nominal \
-H 'Content-Type: application/json' \
-H 'X-PARTNER-PROJECT: your_project_name' \
-H 'X-PARTNER-SIGN: signature' \
-d '{
"payment_details": {
"type": "internal_transfer",
"internal_transfer": {
"type": "transfer_from_nominal_account",
"transfer_from_nominal_account": {
"description": "test payout"
}
}
},
"payment_method": {
"type": "card",
"card": {
"type": "bank_card",
"bank_card": {
"number": "2200774546102058"
}
}
},
"participant_details": {
"sender": {
"full_name": "Sender details",
"beneficiary_id": "1987654321"
},
"recipient": {
"full_name": "Ivan Ivanovich Ivanov",
"beneficiary_id": "065553161159",
"reference": "1234"
}
},
"amount_details": {
"amount": 30000,
"currency": "rub"
},
"customer": {
"reference": "lucky"
}
}'
Response parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
status | + | string | Status. Possible values: error, ok |
session | - | object | Payment session |
error | - | object | Error |
Response examples
- Successful response example
- Unsuccessful response example
{
"status": "ok",
"session": {
"id": "ps_12345",
"status": "created",
"created_at": "2021-08-06T11:34:51.274416Z",
"updated_at": "2021-08-06T11:34:51.466550Z"
}
}
{
"error": {
"description": "error description",
"code": "error code"
},
"status": "error"
}
Endpoint
/api/v2/session/multi/create/nominal
Request parameters
| Name | + | Type | Description |
|---|---|---|---|
payment_details | - | object | Transfer details |
payout_details | - | object | Payment details (card, customer account, etc.) |
participant_details | - | object | Information about the participants (the sender and the recipient) |
amount_details | - | object | Amount. Transmitted in the ruble decimal format. To send 100 rubles, specify 10000 |
customer | - | object | Recipient's data in your system |
metadata | - | * | Any additional data you need to perform the operation. Bank 131 returns it in responses and webhooks. The value can be a string, a number, or an object |
Request example
curl -X POST \
https://demo.bank131.ru/api/v2/session/multi/create/nominal \
-H 'Content-Type: application/json' \
-H 'X-PARTNER-PROJECT: your_project_name' \
-H 'X-PARTNER-SIGN: signature' \
-d '{
"payment_details": {
"type": "internal_transfer",
"internal_transfer": {
"type": "transfer_from_nominal_account",
"transfer_from_nominal_account": {
"description": "test payout"
}
}
},
"payout_details": {
"type": "card",
"card": {
"type": "bank_card",
"bank_card": {
"number": "2200774546102058"
}
}
},
"participant_details": {
"sender": {
"full_name": "Sender details",
"beneficiary_id": "1987654321"
},
"recipient": {
"full_name": "Ivan Ivanovich Ivanov",
"beneficiary_id": "065553161159",
"reference": "1234"
}
},
"amount_details": {
"amount": 30000,
"currency": "rub"
},
"customer": {
"reference": "lucky"
}
}'
Response parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
status | + | string | Status. Possible values: error, ok |
session | - | object | Payment session |
error | - | object | Error |
Response examples
- Successful response example
- Unsuccessful response example
{
"status": "ok",
"session": {
"id": "ps_12345",
"status": "created",
"created_at": "2021-08-06T11:34:51.274416Z",
"updated_at": "2021-08-06T11:34:51.466550Z"
}
}
{
"error": {
"description": "error description",
"code": "error code"
},
"status": "error"
}
session/multi/start/payment/nominal
Starting a payout to a bank card
A method for starting a payout within an already created session. In the request, you can pass the missing parameters or replace the ones already passed.
- API v1
- API v2
Endpoint
/api/v1/session/multi/start/payment/nominal
Request parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
session_id | + | string | Payment session identifier |
payment_details | + | object | Transfer details |
payment_method | + | object | Payment details (card, customer account, etc.) |
participant_details | + | object | Information about the participants (the sender and the recipient) |
amount_details | + | object | Amount. Transmitted in the ruble decimal format. To send 100 rubles, specify 10000 |
customer | + | object | Recipient's data in your system |
metadata | - | * | Any additional data you need to perform the operation. Bank 131 returns it in responses and webhooks. The value can be a string, a number, or an object |
Request example
curl -X POST \
https://demo.bank131.ru/api/v1/session/multi/start/payment/nominal \
-H 'Content-Type: application/json' \
-H 'X-PARTNER-PROJECT: your_project_name' \
-H 'X-PARTNER-SIGN: signature' \
-d '{
"session_id": "ps_12345",
"payment_details": {
"type": "internal_transfer",
"internal_transfer": {
"type": "transfer_from_nominal_account",
"transfer_from_nominal_account": {
"description": "test payout"
}
}
},
"payment_method": {
"type": "card",
"card": {
"type": "bank_card",
"bank_card": {
"number": "2200774546102058"
}
}
},
"participant_details": {
"recipient": {
"full_name": "Ivan Ivanovich Ivanov",
"beneficiary_id": "065553161159"
},
"sender": {
"full_name": "Ivan Ivanovich Ivanov",
"beneficiary_id": "065553161159"
}
},
"amount_details": {
"amount": 30000,
"currency": "rub"
},
"customer": {
"reference": "test"
}
}'
Response parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
status | + | string | Status. Possible values: error, ok |
session | - | object | Payment session |
error | - | object | Error |
Response examples
- Successful response example
- Unsuccessful response example
{
"status": "ok",
"session": {
"id": "ps_12345",
"status": "in_progress",
"created_at": "2021-08-06T11:34:51.274416Z",
"updated_at": "2021-08-06T11:34:51.466550Z",
"payments": [{
"id": "po_25657",
"status": "in_progress",
"created_at": "2021-08-06T11:34:51.545329Z",
"customer": {
"reference": "test"
},
"payment_method": {
"type": "card",
"card": {
"brand": "mir",
"last4": "2058"
}
},
"amount_details": {
"amount": 30000,
"currency": "rub"
},
"participant_details": {
"recipient": {
"full_name": "Ivan Ivanovich Ivanov",
"beneficiary_id": "065553161159"
},
"sender": {
"full_name": "Ivan Ivanovich Ivanov",
"beneficiary_id": "065553161159"
}
}
}],
"acquiring_payments": [{
"id": "pm_15174",
"status": "in_progress",
"created_at": "2021-08-06T11:34:51.545232Z",
"customer": {
"reference": "test"
},
"payment_details": {
"type": "internal_transfer",
"internal_transfer": {
"type": "transfer_from_nominal_account",
"transfer_from_nominal_account": {
"description": "test payout",
"card_mask": "220077******2058"
}
}
},
"amount_details": {
"amount": 30000,
"currency": "rub"
},
"participant_details": {
"recipient": {
"full_name": "Ivan Ivanovich Ivanov",
"beneficiary_id": "065553161159"
},
"sender": {
"full_name": "Ivan Ivanovich Ivanov",
"beneficiary_id": "065553161159"
}
}
}]
}
}
{
"error": {
"description": "error description",
"code": "error code"
},
"status": "error"
}
Endpoint
/api/v2/session/multi/start/payment/nominal
Request parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
session_id | + | string | Payment session identifier |
payment_details | + | object | Transfer details |
payout_details | + | object | Payment details (card, customer account, etc.) |
participant_details | + | object | Information about the participants (the sender and the recipient) |
amount_details | + | object | Amount. Transmitted in the ruble decimal format. To send 100 rubles, specify 10000 |
customer | + | object | Recipient's data in your system |
metadata | - | * | Any additional data you need to perform the operation. Bank 131 returns it in responses and webhooks. The value can be a string, a number, or an object |
Request example
curl -X POST \
https://demo.bank131.ru/api/v2/session/multi/start/payment/nominal \
-H 'Content-Type: application/json' \
-H 'X-PARTNER-PROJECT: your_project_name' \
-H 'X-PARTNER-SIGN: signature' \
-d '{
"session_id": "ps_12345",
"payment_details": {
"type": "internal_transfer",
"internal_transfer": {
"type": "transfer_from_nominal_account",
"transfer_from_nominal_account": {
"description": "test payout"
}
}
},
"payout_details": {
"type": "card",
"card": {
"type": "bank_card",
"bank_card": {
"number": "2200774546102058"
}
}
},
"participant_details": {
"recipient": {
"full_name": "Ivan Ivanovich Ivanov",
"beneficiary_id": "065553161159"
},
"sender": {
"full_name": "Ivan Ivanovich Ivanov",
"beneficiary_id": "065553161159"
}
},
"amount_details": {
"amount": 30000,
"currency": "rub"
},
"customer": {
"reference": "test"
}
}'
Response parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
status | + | string | Status. Possible values: error, ok |
session | - | object | Payment session |
error | - | object | Error |
Response examples
- Successful response example
- Unsuccessful response example
{
"status": "ok",
"session": {
"id": "ps_12345",
"status": "in_progress",
"created_at": "2021-08-06T11:34:51.274416Z",
"updated_at": "2021-08-06T11:34:51.466550Z",
"payout_list": [{
"id": "po_25657",
"status": "in_progress",
"created_at": "2021-08-06T11:34:51.545329Z",
"customer": {
"reference": "test"
},
"payout_details": {
"type": "card",
"card": {
"brand": "mir",
"last4": "2058"
}
},
"amount_details": {
"amount": 30000,
"currency": "rub"
},
"participant_details": {
"recipient": {
"full_name": "Ivan Ivanovich Ivanov",
"beneficiary_id": "065553161159"
},
"sender": {
"full_name": "Ivan Ivanovich Ivanov",
"beneficiary_id": "065553161159"
}
}
}],
"payment_list": [{
"id": "pm_15174",
"status": "in_progress",
"created_at": "2021-08-06T11:34:51.545232Z",
"customer": {
"reference": "test"
},
"payment_details": {
"type": "internal_transfer",
"internal_transfer": {
"type": "transfer_from_nominal_account",
"transfer_from_nominal_account": {
"description": "test payout",
"card_mask": "220077******2058"
}
}
},
"amount_details": {
"amount": 30000,
"currency": "rub"
},
"participant_details": {
"recipient": {
"full_name": "Ivan Ivanovich Ivanov",
"beneficiary_id": "065553161159"
},
"sender": {
"full_name": "Ivan Ivanovich Ivanov",
"beneficiary_id": "065553161159"
}
}
}]
}
}
{
"error": {
"description": "error description",
"code": "error code"
},
"status": "error"
}
session/start/payout/nominal
Starting a payout to a bank account
A method for starting a payout to a bank account, including via FPS, within an already created session. In the request, you can pass the missing parameters or replace the ones already passed. For an FPS payout, pass system_type = faster_payment_system and the faster_payment_system object instead of ru.
- API v1
- API v2
Endpoint
/api/v1/session/start/payout/nominal
Request parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
session_id | + | string | Payment session identifier |
payment_method | + | object | Payment details |
amount_details | + | object | Amount. Transmitted in the ruble decimal format. To send 100 rubles, specify 10000 |
participant_details | + | object | Information about the participants (the sender and the recipient) |
metadata | - | * | Any additional data you need to perform the operation. Bank 131 returns it in responses and webhooks. The value can be a string, a number, or an object |
Request examples
- Payout to an individual's account
- Payout to a legal entity's account
curl -X POST \
https://demo.bank131.ru/api/v1/session/start/payout/nominal \
-H 'Content-Type: application/json' \
-H 'X-PARTNER-SIGN: signature' \
-H 'X-PARTNER-PROJECT: your_project_name' \
-d '{
"session_id": "ps_12345",
"payment_method": {
"type": "bank_account",
"bank_account": {
"system_type": "ru",
"ru": {
"bik": "044525974",
"account": "40817810400003869535",
"full_name": "Ivanov Ivan Ivanovich",
"description": "Funds transfer according to contract No. 5015553111 Ivanov Ivan Ivanovich VAT exempt"
}
}
},
"amount_details": {
"amount": 30000,
"currency": "rub"
},
"participant_details": {
"sender": {
"account": "40702810300200000013"
},
"recipient": {
"beneficiary_id": "065553161159"
}
}
}'
curl -X POST \
https://demo.bank131.ru/api/v1/session/start/payout/nominal \
-H 'Content-Type: application/json' \
-H 'X-PARTNER-SIGN: signature' \
-H 'X-PARTNER-PROJECT: your_project_name' \
-d '{
"session_id": "ps_12345",
"payment_method": {
"type": "bank_account",
"bank_account": {
"system_type": "ru",
"ru": {
"bik": "044525974",
"account": "40702810500000000001",
"full_name": "Company name",
"inn": "1111111111",
"kpp": "156605101",
"description": "Funds transfer according to the contract for December of 2022 VAT exempt."
}
}
},
"amount_details": {
"amount": 30000,
"currency": "rub"
},
"participant_details": {
"sender": {
"account": "40702810300200000013"
},
"recipient": {
"beneficiary_id": "065553161159"
}
}
}'
Response parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
status | + | string | Status. Valid values: error, ok |
session | - | object | Payment session |
error | - | object | Error |
Response examples
- Successful response example
- Unsuccessful response example
{
"status": "ok",
"session": {
"id": "ps_12345",
"status": "in_progress",
"created_at": "2023-05-10T16:58:43.586072Z",
"updated_at": "2023-05-10T16:58:43.705620Z",
"payments": [{
"id": "po_72265",
"status": "in_progress",
"created_at": "2023-05-10T16:58:43.781934Z",
"payment_method": {
"type": "bank_account",
"bank_account": {
"system_type": "ru",
"ru": {
"bik": "044525974",
"account": "40817810400003869535",
"full_name": "Ivanov Ivan Ivanovich",
"description": "Funds transfer according to contract No. 5015553111 Ivanov Ivan Ivanovich VAT exempt",
"is_fast": false
}
}
},
"amount_details": {
"amount": 30000,
"currency": "rub"
},
"participant_details": {
"sender": {
"account": "40702810300200000013"
},
"recipient": {
"beneficiary_id": "065553161159"
}
}
}]
}
}
{
"status": "error",
"error": {
"description": "error description",
"code": "error code"
}
}
Endpoint
/api/v2/session/start/payout/nominal
Request parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
session_id | + | string | Payment session identifier |
payout_details | + | object | Payment details |
amount_details | + | object | Amount. Transmitted in the ruble decimal format. To send 100 rubles, specify 10000 |
participant_details | + | object | Information about the participants (the sender and the recipient) |
metadata | - | * | Any additional data you need to perform the operation. Bank 131 returns it in responses and webhooks. The value can be a string, a number, or an object |
Request examples
- Payout to an individual's account
- Payout to a legal entity's account
curl -X POST \
https://demo.bank131.ru/api/v2/session/start/payout/nominal \
-H 'Content-Type: application/json' \
-H 'X-PARTNER-SIGN: signature' \
-H 'X-PARTNER-PROJECT: your_project_name' \
-d '{
"session_id": "ps_12345",
"payout_details": {
"type": "bank_account",
"bank_account": {
"system_type": "ru",
"ru": {
"bik": "044525974",
"account": "40817810400003869535",
"full_name": "Ivanov Ivan Ivanovich",
"description": "Funds transfer according to contract No. 5015553111 Ivanov Ivan Ivanovich VAT exempt"
}
}
},
"amount_details": {
"amount": 30000,
"currency": "rub"
},
"participant_details": {
"sender": {
"account": "40702810300200000013"
},
"recipient": {
"beneficiary_id": "065553161159"
}
}
}'
curl -X POST \
https://demo.bank131.ru/api/v2/session/start/payout/nominal \
-H 'Content-Type: application/json' \
-H 'X-PARTNER-SIGN: signature' \
-H 'X-PARTNER-PROJECT: your_project_name' \
-d '{
"session_id": "ps_12345",
"payout_details": {
"type": "bank_account",
"bank_account": {
"system_type": "ru",
"ru": {
"bik": "044525974",
"account": "40702810500000000001",
"full_name": "Company name",
"inn": "1111111111",
"kpp": "156605101",
"description": "Funds transfer according to the contract for December of 2022 VAT exempt."
}
}
},
"amount_details": {
"amount": 30000,
"currency": "rub"
},
"participant_details": {
"sender": {
"account": "40702810300200000013"
},
"recipient": {
"beneficiary_id": "065553161159"
}
}
}'
Response parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
status | + | string | Status. Valid values: error, ok |
session | - | object | Payment session |
error | - | object | Error |
Response examples
- Successful response example
- Unsuccessful response example
{
"status": "ok",
"session": {
"id": "ps_12345",
"status": "in_progress",
"created_at": "2023-05-10T16:58:43.586072Z",
"updated_at": "2023-05-10T16:58:43.705620Z",
"payout_list": [{
"id": "po_72265",
"status": "in_progress",
"created_at": "2023-05-10T16:58:43.781934Z",
"payout_details": {
"type": "bank_account",
"bank_account": {
"system_type": "ru",
"ru": {
"bik": "044525974",
"account": "40817810400003869535",
"full_name": "Ivanov Ivan Ivanovich",
"description": "Funds transfer according to contract No. 5015553111 Ivanov Ivan Ivanovich VAT exempt",
"is_fast": false
}
}
},
"amount_details": {
"amount": 30000,
"currency": "rub"
},
"participant_details": {
"sender": {
"account": "40702810300200000013"
},
"recipient": {
"beneficiary_id": "065553161159"
}
}
}]
}
}
{
"status": "error",
"error": {
"description": "error description",
"code": "error code"
}
}
Settlement account
session/create/rko
Creating a payment session
A method for creating a payment session for a payout to a bank account.It returns session_id—a session identifier used by Bank 131 to determine the session associated with a request.
Use this method if you get the bank account details for a payout through a widget and send the payout as a separate request within the created session.
- API v1
- API v2
Endpoint
/api/v1/session/create/rko
Request parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
payment_method | - | object | Payment details (bank account) |
amount_details | - | object | Amount in kopecks. To send 100 rubles, specify 10000 |
participant_details | - | object | Sender's details |
metadata | - | * | Any additional data you need to perform the operation. Bank 131 returns it in responses and webhooks. The value can be a string, a number, or an object |
Request example
curl -X POST \
https://demo.bank131.ru/api/v1/session/create/rko \
-H 'Content-Type: application/json' \
-H 'X-PARTNER-PROJECT: your_project_name' \
-H 'X-PARTNER-SIGN: signature' \
-d '{
"payment_method": {
"type": "bank_account",
"bank_account": {
"system_type": "ru",
"ru": {
"bik": "049205131",
"account": "40702810300000000006",
"full_name": "Acme",
"inn": "1234567890",
"kpp": "165801002",
"description": "Wire for agreement № 5015553111 Ivanov Ivan Ivanovich VAT exempt"
}
}
},
"amount_details": {
"amount": 10000,
"currency": "rub"
},
"participant_details": {
"sender": {
"account": "40702810900000000011"
}
}
}'
Response parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
status | + | string | Status. Possible values: error, ok |
session | - | object | Session details |
error | - | object | Error |
Response examples
- Successful response example
- Unsuccessful response example
{
"status": "ok",
"session": {
"id": "ps_3230",
"status": "created",
"created_at": "2018-05-27T02:03:00.000000Z",
"updated_at": "2018-05-27T02:03:00.000000Z"
}
}
{
"status": "error",
"error": {
"description": "error description",
"code": "error code"
}
}
Endpoint
/api/v2/session/create/rko
Request parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
payout_details | - | object | Payment details (bank account) |
amount_details | - | object | Amount in kopecks. To send 100 rubles, specify 10000 |
participant_details | - | object | Sender's details |
metadata | - | * | Any additional data you need to perform the operation. Bank 131 returns it in responses and webhooks. The value can be a string, a number, or an object |
Request example
curl -X POST \
https://demo.bank131.ru/api/v2/session/create/rko \
-H 'Content-Type: application/json' \
-H 'X-PARTNER-PROJECT: your_project_name' \
-H 'X-PARTNER-SIGN: signature' \
-d '{
"payout_details": {
"type": "bank_account",
"bank_account": {
"system_type": "ru",
"ru": {
"bik": "049205131",
"account": "40702810300000000006",
"full_name": "Acme",
"inn": "1234567890",
"kpp": "165801002",
"description": "Wire for agreement № 5015553111 Ivanov Ivan Ivanovich VAT exempt"
}
}
},
"amount_details": {
"amount": 10000,
"currency": "rub"
},
"participant_details": {
"sender": {
"account": "40702810900000000011"
}
}
}'
Response parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
status | + | string | Status. Possible values: error, ok |
session | - | object | Session details |
error | - | object | Error |
Response examples
- Successful response example
- Unsuccessful response example
{
"status": "ok",
"session": {
"id": "ps_3230",
"status": "created",
"created_at": "2018-05-27T02:03:00.000000Z",
"updated_at": "2018-05-27T02:03:00.000000Z"
}
}
{
"status": "error",
"error": {
"description": "error description",
"code": "error code"
}
}
session/multi/create/rko
Creating a payment session
A method for creating a payment session for a payout to a card. It returns session_id—a session identifier used by Bank 131 to determine the session associated with a request.
Use this method if you get the card details for a payout through a widget and send the payout as a separate request within the created session.
- API v1
- API v2
Endpoint
/api/v1/session/multi/create/rko
Request parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
payment_details | - | object | Transaction details |
payment_method | - | object | Payment details (bank card, bank account, etc.) |
participant_details | - | object | Transaction participants details (sender and recipient) |
amount_details | - | object | Amount in kopecks. To send 100 rubles, specify 10000 |
customer | - | object | Recipient's details in your system |
metadata | - | * | Any additional data you need to perform the operation. Bank 131 returns it in responses and webhooks. The value can be a string, a number, or an object |
Request example
curl -X POST \
https://demo.bank131.ru/api/v1/session/multi/create/rko \
-H 'Content-Type: application/json' \
-H 'X-PARTNER-PROJECT: your_project_name' \
-H 'X-PARTNER-SIGN: signature' \
-d '{
"payment_details": {
"type": "internal_transfer",
"internal_transfer": {
"type": "transfer_from_bank_account",
"transfer_from_bank_account": {
"description": "Wire for agreement № 5015553111 Ivanov Ivan Ivanovich VAT exempt"
}
}
},
"payment_method": {
"type": "card",
"card": {
"type": "bank_card",
"bank_card": {
"number": "2200774546102058"
}
}
},
"participant_details": {
"sender": {
"full_name": "Ivan Ivanovich Ivanov"
},
"recipient": {
"full_name": "Ivan Ivanovich Ivanov"
}
},
"amount_details": {
"amount": 10000,
"currency": "rub"
},
"customer": {
"reference": "123456789012"
}
}'
Response parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
status | + | string | Status. Possible values: error, ok |
session | - | object | Payment session details |
error | - | object | Error |
Response examples
- Successful response example
- Unsuccessful response example
{
"status": "ok",
"session": {
"id": "ps_3230",
"status": "created",
"created_at": "2021-08-06T11:34:51.274416Z",
"updated_at": "2021-08-06T11:34:51.466550Z"
}
}
{
"error": {
"description": "error description",
"code": "error code"
},
"status": "error"
}
Endpoint
/api/v2/session/multi/create/rko
Request parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
payment_details | - | object | Transaction details |
payout_details | - | object | Payment details (bank card, bank account, etc.) |
participant_details | - | object | Transaction participants details (sender and recipient) |
amount_details | - | object | Amount in kopecks. To send 100 rubles, specify 10000 |
customer | - | object | Recipient's details in your system |
metadata | - | * | Any additional data you need to perform the operation. Bank 131 returns it in responses and webhooks. The value can be a string, a number, or an object |
Request example
curl -X POST \
https://demo.bank131.ru/api/v2/session/multi/create/rko \
-H 'Content-Type: application/json' \
-H 'X-PARTNER-PROJECT: your_project_name' \
-H 'X-PARTNER-SIGN: signature' \
-d '{
"payment_details": {
"type": "internal_transfer",
"internal_transfer": {
"type": "transfer_from_bank_account",
"transfer_from_bank_account": {
"description": "Wire for agreement № 5015553111 Ivanov Ivan Ivanovich VAT exempt"
}
}
},
"payout_details": {
"type": "card",
"card": {
"type": "bank_card",
"bank_card": {
"number": "2200774546102058"
}
}
},
"participant_details": {
"sender": {
"full_name": "Ivan Ivanovich Ivanov"
},
"recipient": {
"full_name": "Ivan Ivanovich Ivanov"
}
},
"amount_details": {
"amount": 10000,
"currency": "rub"
},
"customer": {
"reference": "123456789012"
}
}'
Response parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
status | + | string | Status. Possible values: error, ok |
session | - | object | Payment session details |
error | - | object | Error |
Response examples
- Successful response example
- Unsuccessful response example
{
"status": "ok",
"session": {
"id": "ps_3230",
"status": "created",
"created_at": "2021-08-06T11:34:51.274416Z",
"updated_at": "2021-08-06T11:34:51.466550Z"
}
}
{
"error": {
"description": "error description",
"code": "error code"
},
"status": "error"
}
session/multi/start/payment/rko
Starting a payout to a bank card
A method for starting a payout within an already created session. In the request, you can pass the missing parameters or replace the ones already passed.
- API v1
- API v2
Endpoint
/api/v1/session/multi/start/payment/rko
Request parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
session_id | + | string | Payment session id |
payment_details | + | object | Transaction details |
payment_method | + | object | Payment details (bank card, bank account, etc.) |
customer | + | object | Recipient's details in your system |
amount_details | + | object | Amount in kopecks. To send 100 rubles, specify 10000 |
participant_details | + | object | Transaction participants details (sender and recipient) |
metadata | - | * | Any additional data you need to perform the operation. Bank 131 returns it in responses and webhooks. The value can be a string, a number, or an object |
Request example
curl -X POST \
https://demo.bank131.ru/api/v1/session/multi/start/payment/rko \
-H 'Content-Type: application/json' \
-H 'X-PARTNER-PROJECT: your_project_name' \
-H 'X-PARTNER-SIGN: signature' \
-d '{
"session_id": "ps_12345",
"payment_details": {
"type": "internal_transfer",
"internal_transfer": {
"type": "transfer_from_bank_account",
"transfer_from_bank_account": {
"description": "test payout"
}
}
},
"payment_method": {
"type": "card",
"card": {
"type": "bank_card",
"bank_card": {
"number": "2200774546102058"
}
}
},
"participant_details": {
"recipient": {
"full_name": "Ivan Ivanovich Ivanov"
},
"sender": {
"full_name": "Ivan Ivanovich Ivanov"
}
},
"amount_details": {
"amount": 10000,
"currency": "rub"
},
"customer": {
"reference": "test"
}
}'
Response parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
status | + | string | Status. Possible values: error, ok |
session | - | object | Payment session details |
error | - | object | Error |
Response examples
- Successful response example
- Unsuccessful response example
{
"status": "ok",
"session": {
"id": "ps_12345",
"status": "in_progress",
"created_at": "2021-08-06T11:34:51.274416Z",
"updated_at": "2021-08-06T11:34:51.466550Z",
"payments": [{
"id": "po_25657",
"status": "in_progress",
"created_at": "2021-08-06T11:34:51.545329Z",
"customer": {
"reference": "test"
},
"payment_method": {
"type": "card",
"card": {
"brand": "mir",
"last4": "2058"
}
},
"amount_details": {
"amount": 10000,
"currency": "rub"
},
"participant_details": {
"recipient": {
"full_name": "Ivan Ivanovich Ivanov"
},
"sender": {
"full_name": "Ivan Ivanovich Ivanov"
}
}
}],
"acquiring_payments": [{
"id": "pm_15174",
"status": "in_progress",
"created_at": "2021-08-06T11:34:51.545232Z",
"customer": {
"reference": "test"
},
"payment_details": {
"type": "internal_transfer",
"internal_transfer": {
"type": "transfer_from_bank_account",
"transfer_from_bank_account": {
"description": "test payout",
"card_mask": "220077******2058"
}
}
},
"amount_details": {
"amount": 10000,
"currency": "rub"
},
"participant_details": {
"recipient": {
"full_name": "Ivan Ivanovich Ivanov"
},
"sender": {
"full_name": "Ivan Ivanovich Ivanov"
}
}
}]
}
}
{
"error": {
"description": "error description",
"code": "error code"
},
"status": "error"
}
Endpoint
/api/v2/session/multi/start/payment/rko
Request parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
session_id | + | string | Payment session id |
payment_details | + | object | Transaction details |
payout_details | + | object | Payment details (bank card, bank account, etc.) |
customer | + | object | Recipient's details in your system |
amount_details | + | object | Amount in kopecks. To send 100 rubles, specify 10000 |
participant_details | + | object | Transaction participants details (sender and recipient) |
metadata | - | * | Any additional data you need to perform the operation. Bank 131 returns it in responses and webhooks. The value can be a string, a number, or an object |
Request example
curl -X POST \
https://demo.bank131.ru/api/v2/session/multi/start/payment/rko \
-H 'Content-Type: application/json' \
-H 'X-PARTNER-PROJECT: your_project_name' \
-H 'X-PARTNER-SIGN: signature' \
-d '{
"session_id": "ps_12345",
"payment_details": {
"type": "internal_transfer",
"internal_transfer": {
"type": "transfer_from_bank_account",
"transfer_from_bank_account": {
"description": "test payout"
}
}
},
"payout_details": {
"type": "card",
"card": {
"type": "bank_card",
"bank_card": {
"number": "2200774546102058"
}
}
},
"participant_details": {
"recipient": {
"full_name": "Ivan Ivanovich Ivanov"
},
"sender": {
"full_name": "Ivan Ivanovich Ivanov"
}
},
"amount_details": {
"amount": 10000,
"currency": "rub"
},
"customer": {
"reference": "test"
}
}'
Response parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
status | + | string | Status. Possible values: error, ok |
session | - | object | Payment session details |
error | - | object | Error |
Response examples
- Successful response example
- Unsuccessful response example
{
"status": "ok",
"session": {
"id": "ps_12345",
"status": "in_progress",
"created_at": "2021-08-06T11:34:51.274416Z",
"updated_at": "2021-08-06T11:34:51.466550Z",
"payout_list": [{
"id": "po_25657",
"status": "in_progress",
"created_at": "2021-08-06T11:34:51.545329Z",
"customer": {
"reference": "test"
},
"payout_details": {
"type": "card",
"card": {
"brand": "mir",
"last4": "2058"
}
},
"amount_details": {
"amount": 10000,
"currency": "rub"
},
"participant_details": {
"recipient": {
"full_name": "Ivan Ivanovich Ivanov"
},
"sender": {
"full_name": "Ivan Ivanovich Ivanov"
}
}
}],
"payment_list": [{
"id": "pm_15174",
"status": "in_progress",
"created_at": "2021-08-06T11:34:51.545232Z",
"customer": {
"reference": "test"
},
"payment_details": {
"type": "internal_transfer",
"internal_transfer": {
"type": "transfer_from_bank_account",
"transfer_from_bank_account": {
"description": "test payout",
"card_mask": "220077******2058"
}
}
},
"amount_details": {
"amount": 10000,
"currency": "rub"
},
"participant_details": {
"recipient": {
"full_name": "Ivan Ivanovich Ivanov"
},
"sender": {
"full_name": "Ivan Ivanovich Ivanov"
}
}
}]
}
}
{
"error": {
"description": "error description",
"code": "error code"
},
"status": "error"
}
session/start/payout/rko
Starting a payout to a bank account
A method for starting a payout to a bank account within an existing session. In the request, you can pass the missing parameters or replace the ones already passed.
- API v1
- API v2
Endpoint
/api/v1/session/start/payout/rko
Request parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
session_id | + | string | Payment session identifier |
payment_method | + | object | Payment details (bank account) |
amount_details | + | object | Amount in kopecks. To send 100 rubles, specify 10000 |
participant_details | + | object | Sender's details |
metadata | - | * | Any additional data you need to perform the operation. Bank 131 returns it in responses and webhooks. The value can be a string, a number, or an object |
Request example
curl -X POST \
https://demo.bank131.ru/api/v1/session/start/payout/rko \
-H 'Content-Type: application/json' \
-H 'X-PARTNER-PROJECT: your_project_name' \
-H 'X-PARTNER-SIGN: signature' \
-d '{
"session_id": "ps_3230",
"payment_method": {
"type": "bank_account",
"bank_account": {
"system_type": "ru",
"ru": {
"bik": "049205131",
"account": "40702810300000000006",
"full_name": "Acme",
"inn": "1234567890",
"kpp": "165801002",
"description": "Wire for agreement № 5015553111 Ivanov Ivan Ivanovich VAT exempt"
}
}
},
"amount_details": {
"amount": 10000,
"currency": "rub"
},
"participant_details": {
"sender": {
"account": "40702810900000000011"
}
}
}'
Response parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
status | + | string | Status. Possible values: error, ok |
session | - | object | Payment session details |
error | - | object | Error |
Response examples
- Successful response example
- Unsuccessful response example
{
"status": "ok",
"session": {
"id": "ps_3230",
"status": "in_progress",
"created_at": "2018-05-27T02:03:00.000000Z",
"updated_at": "2018-05-27T02:03:00.000000Z",
"payments": [{
"id": "po_2018",
"status": "in_progress",
"created_at": "2018-05-27T02:03:00.000000Z",
"payment_method": {
"type": "bank_account",
"bank_account": {
"system_type": "ru",
"ru": {
"bik": "049205131",
"account": "40702810300000000006",
"full_name": "Acme",
"inn": "1234567890",
"kpp": "165801002",
"description": "Wire for agreement № 5015553111 Ivanov Ivan Ivanovich VAT exempt"
}
}
},
"amount_details": {
"amount": 10000,
"currency": "rub"
},
"participant_details": {
"sender": {
"account": "40702810900000000011"
}
}
}]
}
}
{
"status": "error",
"error": {
"description": "error description",
"code": "error code"
}
}
Endpoint
/api/v2/session/start/payout/rko
Request parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
session_id | + | string | Payment session identifier |
payout_details | + | object | Payment details (bank account) |
amount_details | + | object | Amount in kopecks. To send 100 rubles, specify 10000 |
participant_details | + | object | Sender's details |
metadata | - | * | Any additional data you need to perform the operation. Bank 131 returns it in responses and webhooks. The value can be a string, a number, or an object |
Request example
curl -X POST \
https://demo.bank131.ru/api/v2/session/start/payout/rko \
-H 'Content-Type: application/json' \
-H 'X-PARTNER-PROJECT: your_project_name' \
-H 'X-PARTNER-SIGN: signature' \
-d '{
"session_id": "ps_3230",
"payout_details": {
"type": "bank_account",
"bank_account": {
"system_type": "ru",
"ru": {
"bik": "049205131",
"account": "40702810300000000006",
"full_name": "Acme",
"inn": "1234567890",
"kpp": "165801002",
"description": "Wire for agreement № 5015553111 Ivanov Ivan Ivanovich VAT exempt"
}
}
},
"amount_details": {
"amount": 10000,
"currency": "rub"
},
"participant_details": {
"sender": {
"account": "40702810900000000011"
}
}
}'
Response parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
status | + | string | Status. Possible values: error, ok |
session | - | object | Payment session details |
error | - | object | Error |
Response examples
- Successful response example
- Unsuccessful response example
{
"status": "ok",
"session": {
"id": "ps_3230",
"status": "in_progress",
"created_at": "2018-05-27T02:03:00.000000Z",
"updated_at": "2018-05-27T02:03:00.000000Z",
"payout_list": [{
"id": "po_2018",
"status": "in_progress",
"created_at": "2018-05-27T02:03:00.000000Z",
"payout_details": {
"type": "bank_account",
"bank_account": {
"system_type": "ru",
"ru": {
"bik": "049205131",
"account": "40702810300000000006",
"full_name": "Acme",
"inn": "1234567890",
"kpp": "165801002",
"description": "Wire for agreement № 5015553111 Ivanov Ivan Ivanovich VAT exempt"
}
}
},
"amount_details": {
"amount": 10000,
"currency": "rub"
},
"participant_details": {
"sender": {
"account": "40702810900000000011"
}
}
}]
}
}
{
"status": "error",
"error": {
"description": "error description",
"code": "error code"
}
}
Other methods
sberpay/push
Sending a push notification or SMS for SberPay payment
The method sends the customer a push notification or SMS to pay via SberPay.
Endpoint
/api/v1/sberpay/push
Request parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
session_id | + | string | Session ID |
phone | + | string | Phone number to send PUSH or SMS |
Request example
curl -X GET \
https://demo.bank131.ru/api/v1/sberpay/push \
-H 'Content-Type: application/json' \
-H 'X-PARTNER-PROJECT: your_project_name' \
-H 'X-PARTNER-SIGN: signature' \
-d '{
"session_id": "ps_75459435",
"phone": "71234567890"
}'
Response parameters
| Name | Mandatory | Type | Description |
|---|---|---|---|
status | + | string | Status. Possible values: error, ok |
error | - | object | Error description |
Response examples
- Successful response example
- Unsuccessful response example
{
"status": "ok"
}
{
"status": "error",
"error":
{
"description": "Internal error",
"code": "internal_error"
}
}