Skip to main content

Recurring payments via FPS

Our API offers the following options:

How to get a token for recurring payments along with making a payment

  1. Create a payment session session/create.
  2. Send a payment request using the session/start/payment method. The payment_options.recurrent parameter contains the true value.
  3. Wait for a ready_to_confirm webhook to confirm the payment with session/confirm or cancel the payment with session/cancel.
  4. Wait for an action_required webhook. The customer_interaction.inform.qr.content parameter contains a deeplink which you can either display to the customer as QR code in a web browser, or use it to forward the customer to the issuer's mobile application.
  5. Wait for a payment_finished webhook containing the transaction result from Bank 131. In case of a successful transaction, the webhook will contain status=accepted (session object) and status=succeeded (payments/payout_list array) along with a recurring token within the recurrent.token parameter. If the transaction fails, the webhook will contain status=cancelled (session object), status=failed (payments/payout_list array), and no recurring token.
Webhook example
curl -X POST \
https://partner.ru \
-H 'Content-Type: application/json' \
-H 'X-PARTNER-SIGN: signature' \
-d '{
"type": "payment_finished",
"session": {
"id": "ps_713610",
"status": "accepted",
"created_at": "2024-08-08T08:06:51.841432Z",
"updated_at": "2024-08-08T08:14:56.168219Z",
"acquiring_payments": [{
"id": "pm_308906",
"status": "succeeded",
"created_at": "2024-08-08T08:06:51.931193Z",
"finished_at": "2024-08-08T08:14:55.996273Z",
"customer": {
"reference": "user123",
"contacts": [{
"phone": "7123*****45"
}]
},
"payment_details": {
"type": "faster_payment_system"
},
"recurrent": {
"token": "6a6a29c4193a8e1049231e1497a3c5f180e120b20db81b39f53ec478029b53cf",
"created_at": "2024-08-08T10:10:27+03:00",
"finished_at": "2034-08-08T10:10:27+03:00",
"is_active": true,
"type": "recurrent_token"
},
"amount_details": {
"amount": 1000,
"currency": "RUB"
},
"amounts": {
"net": {
"amount": 1000,
"currency": "RUB"
},
"gross": {
"amount": 1000,
"currency": "RUB"
}
}
}],
"actions": {
"confirm": "2024-08-08T08:06:52.184593Z",
"capture": "2024-08-08T08:14:55.699095Z"
}
}
}'

Diagram

How to get a token for recurring payments without charging

To get a token for recurring payments via FPS without charging, you need to complete all the standard steps required to make a payment via FPS.

When sending a session/start/payment or session/init/payment request, specify "type": "faster_payment_system_binding" and "recurrent": true.

In the amount_details object specify 1 ruble (the amount will not be charged).

The payment_finished webhook will return a token for recurring payments.

Request example
curl -X POST \
https://demo.bank131.ru/api/v1/session/init/payment \
-H 'Content-Type: application/json' \
-H 'X-PARTNER-PROJECT: your_project_name' \
-H 'X-PARTNER-SIGN: signature' \
-d '{
"payment_details": {
"type": "faster_payment_system_binding"
},
"amount_details": {
"amount": 100,
"currency": "rub"
},
"customer": {
"reference": "lucky"
},
"payment_options": {
"recurrent": true
}
}'

Once you have a token, accept recurring payments in a standard way.

Request example
curl -X POST \
https://demo.bank131.ru/api/v1/session/init/payment \
-H 'Content-Type: application/json' \
-H 'X-PARTNER-PROJECT: your_project_name' \
-H 'X-PARTNER-SIGN: signature' \
-d '{
"payment_details": {
"type": "recurrent",
"recurrent": {
"token": "e9876f32bcd947f79c324cf2da5726304a894f6ae2037de7705fdb3e0a134d39"
}
},
"amount_details": {
"amount": 10000,
"currency": "rub"
},
"customer": {
"reference": "lucky"
}
}'

How to create multiple FPS subscriptions for the same payer and bank

Each time an SBP subscription is additionally created for the same payer and the same issuing bank, the bank may show a message saying: "You have already linked an account." This confuses the payer, who cannot tell whether a new subscription was actually created.

To allow an unlimited number of unique subscriptions to be created correctly and to avoid the confusion described above, it is necessary to additionally pass the subscription_service_info object containing the subscription identifier and name.

To enable this functionality, please contact your manager at Bank 131.

Request example
curl -X POST \
https://demo.bank131.ru/api/v1/session/init/payment \
-H 'Content-Type: application/json' \
-H 'X-PARTNER-PROJECT: your_project_name' \
-H 'X-PARTNER-SIGN: signature' \
-d '{
"payment_details": {
"type": "faster_payment_system",
"faster_payment_system": {
"subscription_service_info": {
"id": "54f731a9f86b46188b7961cb933fb3ff", // subscription identifier
"name": "subscription2" // subscription name
}
}
},
"amount_details": {
"amount": 1000,
"currency": "rub"
},
"customer": {
"reference": "lucky"
},
"payment_options": {
"recurrent": true
}
}'