Skip to main content

SberPay with a QR code

This scenario describes how to receive payments via SberPay with QR codes. These payments do not require card details from customers.

Generation of QR codes, as well as providing QR codes to customers, falls under your responsibility.

More information including guidelines and the SDK can be found here.

You should confirm a payment within 20 minutes by sending session/confirm. Otherwise, the session terminates within 20 minutes with the canceled status.

Payment scenario

  1. Create a separate session using the session/create method, or create a session with the payment using the session/init/payment method. Both methods should pass the required settings including the payment channel within the channel setting and URL to forward the customer to a Sber application within the return_url setting.

    The session/start/payment method is required to be sent after you created a separate session.

  2. 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.
  3. Confirm your payment by sending a session/confirm request, or cancel the payment sending a session/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).

  4. Wait for an action_required webhook containing a deeplink passed within the redirect.url parameter, generate a QR code from this deeplink, and forward the customer to a Sber mobile application (Sberbank Online or SBOL).
  5. 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.
  6. Wait for a payment_finished webhook from Bank 131 with the transaction results. You can also send requests (1 time or less 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 lifetime of the customer's order ends.

  7. Pass the transaction status to the customer.
QR code payment 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"
}
}'
QR code payment 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
}
}
]
}
}