SberPay
This scenario describes how to receive payments via SberPay. These payments, one-time and recurring, do not require card details from customers. To select a recurring payment method, inform your manager in Bank 131 upon boarding.
You should confirm a payment within 20 minutes by sending
session/confirm
. Otherwise, the session terminates within 20 minutes with thecanceled
status.
Payment scenario
The payment scenario depends on the customer's payment channel: mobile application (app), mobile browser (mobile_web), or desktop browser (web).
- Mobile application (app)
- Mobile browser (mobile_web)
- Desktop browser (web)
- Create a separate session using the
session/create
method, or create a session with the payment using thesession/init/payment
method and pass all the required parameters, including the following ones:
sber_pay
in thetype
parameterapp
in thechannel
parameterThe
session/start/payment
method is required to be sent after you created a separate session.
- Wait for a
ready_to_confirm
webhook from Bank 131 when Bank 131 is ready to process the payment and is waiting for your confirmation. - Confirm your payment by sending a
session/confirm
request, or cancel the payment sending asession/cancel
request.You can also use the
sberpay/push
method to additionally send PUSH or SMS notifications to customers (PUSH/SMS notification channel is set by Sber). Note that it is not recommended to use thesberpay/push
method withchannel = app
. In this case, Bank 131 cannot guarantee a successful payment. - Bank 131 will send you an
action_required
webhook containing a URL withinredirect.url
to forward the customer to a Sber mobile application. - For iOS devices, forward the customer by the deeplink passed within the
redirect.url
parameter to a Sber mobile application. Use the algorithm below to select the proper mobile application to forward the customer:- Open the
btripsexpenses://sbolpay/...
deeplink. - Wait 50ms.
- Reload the page to hide a possible alert if the deeplink could not open properly.
- Redirect back to your page with the new request settings.
- Open the
budgetonline-ios://sbolpay....
link. - Wait 50ms.
- Reload the page to hide a possible alert if the deeplink could not open properly.
- Redirect back to your page with the new request settings.
- Open the
ios-app-smartonline://sbolpay/...
deeplink. - Wait 50ms.
- Reload the page to hide a possible alert if the deeplink could not open properly.
- Redirect back to your page with the new request settings.
- Open the
app-online-ios://sbolpay/...
deeplink. - Wait 50ms.
- Reload the page to hide a possible alert if the deeplink could not open properly.
- Redirect back to your page with the new request settings.
- Open the
sberpay://...
deeplink. - Wait 50ms.
- Reload the page to hide a possible alert if the deeplink could not open properly.
- Redirect back to your page with the new request settings.
- Open the
sbolpay://...
deeplink. - Wait 50ms.
- Reload the page.
- Follow the deeplink to the Sber landing page.
- Open the
- Wait until the customer approves or cancels the payment. After that, Sber takes the customer back to the URL or deeplink passed within the
return_url
parameter. - Wait for a
payment_finished
webhook from Bank 131 with the transaction results. You can also send requests (no more than once in 5 seconds) to obtain the transaction status.If the customer cancels the transaction, the transaction status will renew only after 20 minutes, as soon as the customer's order expires.
- Pass the transaction status to the customer.
Request example
curl -X POST \
https://proxy.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": "internet_banking",
"internet_banking": {
"type": "sber_pay",
"sber_pay": {
"phone": "71234567890",
"channel": "app"
}
}
},
"amount_details": {
"amount": 1000,
"currency": "RUB"
},
"metadata": "app",
"customer": {
"reference": "user-ebf7-4815-af0a-b1f77e6de7e7"
},
"payment_options": {
"return_url": "https://t.me/bank131"
}
}'
Response example
{
"status": "ok",
"session": {
"id": "ps_12345",
"status": "in_progress",
"created_at": "2023-09-29T05:42:10.549869Z",
"updated_at": "2023-09-29T05:42:10.948457Z",
"acquiring_payments": [
{
"id": "pm_131",
"status": "in_progress",
"created_at": "2023-09-29T05:42:10.973559Z",
"customer": {
"reference": "user-ebf7-4815-af0a-b1f77e6de7e7"
},
"payment_details": {
"type": "internet_banking",
"internet_banking": {
"type": "sber_pay",
"sber_pay": {
"phone": "71234567890",
"channel": "app"
}
}
},
"amount_details": {
"amount": 1000,
"currency": "RUB"
},
"metadata": "order123",
"payment_options": {
"return_url": "https://t.me/bank131",
"recurrent": false
}
}
]
}
}
- Create a separate session using the
session/create
method, or create a session with the payment using thesession/init/payment
method and pass all the required parameters, including the following ones:
sber_pay
in thetype
parametermobile_web
in thechannel
parameterThe
session/start/payment
method is required to be sent after you created a separate session.
- Wait for a
ready_to_confirm
webhook from Bank 131 when Bank 131 is ready to process the payment and is waiting for your confirmation. - Confirm your payment by sending a
session/confirm
request, or cancel the payment sending asession/cancel
request._You can also use the
sberpay/push
method to additionally send PUSH or SMS notifications to customers (PUSH/SMS notification channel is set by Sber). - Bank 131 will send you an
action_required
webhook containing a URL withinredirect.url
to forward the customer to a Sber mobile application. For iOS devices, forward the customer by the deeplink passed within theredirect.url
parameter to a Sber mobile application. Use the algorithm below to select the proper mobile application to forward the customer:- Open the
btripsexpenses://sbolpay/...
deeplink. - Wait 50ms.
- Reload the page to hide a possible alert if the deeplink could not open properly.
- Redirect back to your page with the new request settings.
- Open the
budgetonline-ios://sbolpay....
link. - Wait 50ms.
- Reload the page to hide a possible alert if the deeplink could not open properly.
- Redirect back to your page with the new request settings.
- Open the
ios-app-smartonline://sbolpay/...
deeplink. - Wait 50ms.
- Reload the page to hide a possible alert if the deeplink could not open properly.
- Redirect back to your page with the new request settings.
- Open the
app-online-ios://sbolpay/...
deeplink. - Wait 50ms.
- Reload the page to hide a possible alert if the deeplink could not open properly.
- Redirect back to your page with the new request settings.
- Open the
sberpay://...
deeplink. - Wait 50ms.
- Reload the page to hide a possible alert if the deeplink could not open properly.
- Redirect back to your page with the new request settings.
- Open the
sbolpay://...
deeplink. - Wait 50ms.
- Reload the page.
- Follow the deeplink to the Sber landing page.
- Open the
- Wait until the customer approves or cancels the payment. After that, Sber takes the customer back to the URL or deeplink passed within the
return_url
parameter. - Wait for a
payment_finished
webhook from Bank 131 with the transaction results. You can also send requests (no more than once in 5 seconds) to obtain the transaction status.If the customer cancels the transaction, the transaction status will renew only after 20 minutes, as soon as the customer's order expires.
- Pass the transaction status to the customer.
Request example
curl -X POST \
https://proxy.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": "internet_banking",
"internet_banking": {
"type": "sber_pay",
"sber_pay": {
"phone": "71234567890",
"channel": "mobile_web"
}
}
},
"amount_details": {
"amount": 1000,
"currency": "RUB"
},
"metadata": "mobile_web",
"customer": {
"reference": "user-ebf7-4815-af0a-b1f77e6de7e7"
},
"payment_options": {
"return_url": "https://t.me/bank131"
}
}'
Response example
{
"status": "ok",
"session": {
"id": "ps_12345",
"status": "in_progress",
"created_at": "2023-09-29T05:42:10.549869Z",
"updated_at": "2023-09-29T05:42:10.948457Z",
"acquiring_payments": [
{
"id": "pm_131",
"status": "in_progress",
"created_at": "2023-09-29T05:42:10.973559Z",
"customer": {
"reference": "user-ebf7-4815-af0a-b1f77e6de7e7"
},
"payment_details": {
"type": "internet_banking",
"internet_banking": {
"type": "sber_pay",
"sber_pay": {
"phone": "71234567890",
"channel": "mobile_web"
}
}
},
"amount_details": {
"amount": 1000,
"currency": "RUB"
},
"metadata": "order123",
"payment_options": {
"return_url": "https://t.me/bank131",
"recurrent": false
}
}
]
}
}
- Create a separate session using the
session/create
method, or create a session with the payment using thesession/init/payment
and pass all the required parameters, including the following ones:
sber_pay
in thetype
parameterweb
in thechannel
parameter- the URL to forward the customer to in the
return_url
parameter.The
session/start/payment
method is required to be sent after you created a separate session.
- Wait for a
ready_to_confirm
webhook from Bank 131 when Bank 131 is ready to process the payment and is waiting for your confirmation. - Confirm your payment by sending a
session/confirm
request, or cancel the payment sending asession/cancel
request.You can also use the
sberpay/push
method to additionally send PUSH or SMS notifications to customers (PUSH/SMS notification channel is set by Sber). - Wait until the customer approves or cancels the payment. After that, Sber takes the customer back to the URL or deeplink passed within the
return_url
parameter. - Wait for a
payment_finished
webhook from Bank 131 with the transaction results. You can also send requests (no more than once in 5 seconds) to obtain the transaction status.If the customer cancels the transaction, the transaction status will renew only after 20 minutes, as soon as the customer's order expires.
- Pass the transaction status to the customer.
Request example
curl -X POST \
https://proxy.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": "internet_banking",
"internet_banking": {
"type": "sber_pay",
"sber_pay": {
"phone": "71234567890",
"channel": "web"
}
}
},
"amount_details": {
"amount": 1000,
"currency": "RUB"
},
"metadata": "web",
"customer": {
"reference": "user-ebf7-4815-af0a-b1f77e6de7e7"
},
"payment_options": {
"return_url": "https://131.ru"
}
}'
Response example
{
"status": "ok",
"session": {
"id": "ps_12345",
"status": "in_progress",
"created_at": "2023-09-29T05:42:10.549869Z",
"updated_at": "2023-09-29T05:42:10.948457Z",
"acquiring_payments": [
{
"id": "pm_131",
"status": "in_progress",
"created_at": "2023-09-29T05:42:10.973559Z",
"customer": {
"reference": "user-ebf7-4815-af0a-b1f77e6de7e7"
},
"payment_details": {
"type": "internet_banking",
"internet_banking": {
"type": "sber_pay",
"sber_pay": {
"phone": "71234567890",
"channel": "web"
}
}
},
"amount_details": {
"amount": 1000,
"currency": "RUB"
},
"metadata": "order123",
"payment_options": {
"return_url": "https://t.me/bank131",
"recurrent": false
}
}
]
}
}
Selecting a proper deeplink for Sber iOS mobile applications
Code example
const openBtripsexpenses = () => {
window.location.href =
"btripsexpenses://sbolpay/invoicing/v2?bankInvoiceId=1961101c8c524c7fa15a9f101e965c58&orderNumber=d76d899c-6ffb-7116-ae89-afc802a92bb01";
};
const openBudgetonline = () => {
window.location.href =
"budgetonline-ios://sbolpay/invoicing/v2?bankInvoiceId=1961101c8c524c7fa15a9f101e965c58&orderNumber=d76d899c-6ffb-7116-ae89-afc802a92bb0";
};
const openIosAppSmartonline = () => {
window.location.href =
"ios-app-smartonline://sbolpay/invoicing/v2?bankInvoiceId=1961101c8c524c7fa15a9f101e965c58&orderNumber=d76d899c-6ffb-7116-ae89-afc802a92bb0";
};
const openAppOnline = () => {
window.location.href =
"app-online-ios://sbolpay/invoicing/v2?bankInvoiceId=1961101c8c524c7fa15a9f101e965c58&orderNumber=d76d899c-6ffb-7116-ae89-afc802a92bb0";
};
const openSberpay = () => {
window.location.href =
"sberpay://invoicing/v2?bankInvoiceId=1961101c8c524c7fa15a9f101e965c58&orderNumber=d76d899c-6ffb-7116-ae89-afc802a92bb0";
};
const openSbolpay = () => {
window.location.href =
"sbolpay://invoicing/v2?bankInvoiceId=1961101c8c524c7fa15a9f101e965c58&orderNumber=d76d899c-6ffb-7116-ae89-afc802a92bb0";
};
const openLandingpage = () => {
window.location.href =
"https://www.sberbank.ru/ru/person/payments/online_sberpay";
};
const clearMessage = () => {
window.location.href =
"./same_page.html";
};
if (platform == "android") {
setTimeout(openSberpay, 100);
clearMessage();
setTimeout(openLandingpage, 800);
} else if (platform == "iPhone") {
setTimeout(openIosAppSmartonline, 50);
clearMessage();
setTimeout(openAppOnline, 50);
clearMessage();
setTimeout(openBtripsexpenses, 50);
clearMessage();
setTimeout(openBudgetonline, 50);
clearMessage();
setTimeout(openSberpay, 50);
clearMessage();
setTimeout(openSbolpay, 50);
clearMessage();
setTimeout(openLandingpage, 800);
}
Recurring payments
CIT recurring payments via SberPay are not supported.
To make MIT recurring payments via SberPay:
-
Get a token by sending
recurrent=true
(in thepayment_options
object) in the request.Example
curl -X
https://proxy.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": "internet_banking",
"internet_banking": {
"type": "sber_pay",
"sber_pay": {
"phone": "71234567890",
"channel": "app"
}
}
},
"amount_details": {
"amount": 1000,
"currency": "RUB"
},
"metadata": "app",
"customer": {
"reference": "user-ebf7-4815-af0a-b1f77e6de7e7"
},
"payment_options": {
"return_url": "https://t.me/bank131",
"recurrent": "true"
}
}' -
Use the token to make recurring payments.
Example
curl -X
https://proxy.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": 1000,
"currency": "RUB"
},
"metadata": "app",
"customer": {
"reference": "user-ebf7-4815-af0a-b1f77e6de7e7"
}
}'