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.
Do not forget to generate QR codes and provide them to 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 thecanceledstatus.
Payment scenario
- Create a separate session using the
session/createmethod, or create a session with the payment using thesession/init/paymentmethod. Both methods should pass the required settings including the payment channel within thechannelsetting and URL to forward the customer to a Sber application within thereturn_urlsetting.The
session/start/paymentmethod is required to be sent after you created a separate session. - Wait for a
ready_to_confirmwebhook 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/confirmrequest, or cancel the payment sending asession/cancelrequest.You can also use the
sberpay/pushmethod to additionally send PUSH or SMS notifications to customers (PUSH/SMS notification channel is set by Sber). - Wait for an
action_requiredwebhook containing a deeplink passed within theredirect.urlparameter, generate a QR code from this deeplink, and forward the customer to a Sber mobile application (Sberbank Online or SBOL). - 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_urlparameter. - Wait for a
payment_finishedwebhook 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.
- 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
}
}]
}
}
