Recurring payments via FPS
Our API offers the following options:
- getting a token for recurring payments via FPS along with charging
- getting a token for recurring payments via FPS without charging
How to get a token for recurring payments along with making a payment
- Create a payment session
session/create. - Send a payment request using the
session/start/paymentmethod. Thepayment_options.recurrentparameter contains thetruevalue. - Wait for a
ready_to_confirmwebhook to confirm the payment withsession/confirmor cancel the payment withsession/cancel. - Wait for an
action_requiredwebhook. Thecustomer_interaction.inform.qr.contentparameter 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. - Wait for a
payment_finishedwebhook containing the transaction result from Bank 131. In case of a successful transaction, the webhook will containstatus=accepted(sessionobject) andstatus=succeeded(payments/payout_listarray) along with a recurring token within therecurrent.tokenparameter. If the transaction fails, the webhook will containstatus=cancelled(sessionobject),status=failed(payments/payout_listarray), and no recurring token.
Webhook example
- Success
- Failure
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"
}
}
}'
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": "cancelled",
"created_at": "2022-03-01T11:57:31.652396Z",
"updated_at": "2022-03-01T11:57:31.861329Z",
"acquiring_payments": [{
"id": "pm_308906",
"status": "failed",
"created_at": "2022-03-01T11:57:31.895773Z",
"finished_at": "2022-03-01T11:57:31.895773Z",
"customer": {
"reference": "user123"
},
"payment_details": {
"type": "faster_payment_system"
},
"amount_details": {
"amount": 229600,
"currency": "RUB"
},
"amounts": {
"fee": {
"merchant_fee": {
"amount": 1607,
"currency": "RUB"
}
}
},
"metadata": {
"parent_session_id": "ps_1667788995"
},
"error": {
"description": "QR expired",
"code": "qr_expired"
},
"payment_options": {
"return_url": "https://131.ru",
"recurrent": false
}
}],
"error": {
"description": "Session cancelled",
"code": "session_cancelled"
},
"actions": {
"confirm": "2022-03-01T11:57:31.895773Z"
}
}
}'
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
}
}'