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 confirm_request. 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. Receive the ready_to_confirm webhook from Bank 131 when the Bank 131 is ready to process the payment and is waiting for your confirmation.
  3. Confirm your payment by sending the confirm_request request, or cancel the payment sending the cancel_request request;

    You can also use the sberpay/push method to additionaly send PUSH or SMS notifications to customers (PUSH/SMS notification channel is set by Sber).

  4. Receive the 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. Receive the 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 --location 'https://proxy.bank131.ru/api/v1/session/init/payment' \
--header 'X-PARTNER-SIGN: key' \
--header 'X-PARTNER-PROJECT: your_project_name' \
--header 'Content-Type: application/json' \
--data '{
"payment_details": {
"type": "internet_banking",
"internet_banking": {
"type": "sber_pay",
"sber_pay": {
"phone": "71234567890",
"channel": "web_mobile"
}
}
},
"amount_details": {
"amount": 1000,
"currency": "RUB"
},
"metadata": "web_mobile",
"customer": {
"reference": "user-ebf7-4815-af0a-b1f77e6de7e7"
},
"payment_options": {


"return_url": "https://t.me/bank131"
}
}'

QR code payment response example

{
"status": "ok",
"session": {
"id": "12345",
"status": "in_progress",
"created_at": "2023-09-29T05:42:10.549869Z",
"updated_at": "2023-09-29T05:42:10.948457Z",
"acquiring_payments": [
{
"id": "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_mobile"
}
}
},
"amount_details": {
"amount": 1000,
"currency": "RUB"
},
"amounts": {
"gross": {
"amount": 1000,
"currency": "RUB"
}
},
"metadata": "order123",
"payment_options": {
"return_url": "https://t.me/bank131",
"recurrent": false
}
}
]
}
}