Skip to main content

SberPay

You can receive payments via SberPay. These payments, regular and recurring, do not require card details from customers. To select a recurring payment method, inform your manager in Smart Glocal during boarding.

Payment scenarios

The payment scenario depends on the customer's channel of payment: mobile application (app), mobile browser (mobile_web), or desktop browser (web).

  1. Create a session using the session/create method.
  2. Start the payment using the session/start/payment method.
    Specify the following data:
    • sber_pay in the type parameter
    • app in the channel parameter
    • a URL in the return_url parameter to forward the customer to.
Request example
curl --location 'https://demo.smart-glocal.com/api/v1/session/start/payment' \
--header 'X-PARTNER-SIGN: signature' \
--header 'X-PARTNER-PROJECT: your_project_name' \
--header 'Content-Type: application/json' \
--data '{
"session_id": "ps_3230",
"payment_details": {
"type": "internet_banking",
"internet_banking": {
"type": "sber_pay",
"sber_pay": {
"channel": "app"
}
}
},
"amount_details": {
"amount": 1000,
"currency": "RUB"
},
"metadata": "app",
"customer": {
"reference": "user-ebf7-4815-af0a-b1f77e6de7e7"
},
"payment_options": {
"return_url": "https://t.me/smartglocal"
}
}'
Response example
{
"status": "ok",
"session": {
"id": "ps_3230",
"status": "in_progress",
"created_at": "2023-09-29T05:42:10.549869Z",
"updated_at": "2023-09-29T05:42:10.948457Z",
"acquiring_payments": [
{
"id": "pm_1313",
"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": {
"channel": "app"
}
}
},
"amount_details": {
"amount": 1000,
"currency": "RUB"
},
"amounts": {
"gross": {
"amount": 1000,
"currency": "RUB"
}
},
"metadata": "order123",
"payment_options": {
"return_url": "https://t.me/smartglocal",
"recurrent": false
}
}
]
}
}
  1. When you receive a ready_to_confirm webhook from Smart Glocal, confirm your payment by sending a session/confirm request, or cancel it by sending a session/cancel request.

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

We do not recommend to use the sberpay/push method to additionally send PUSH or SMS notifications to customers as in this case Smart Glocal cannot guarantee a successful payment.

  1. When you receive an action_required webhook containing a URL within redirect.url, forward the customer to the Sber mobile application.

    4.1 For iOS devices, to select the proper mobile application to forward the customer to, use the deeplink from the redirect.url parameter and follow the algorithm below:

    1. Open the btripsexpenses://sbolpay/... deeplink.
    2. Wait 50ms.
    3. Reload the page to hide a possible alert if the deeplink could not open properly.
    4. Redirect back to your page with the new request settings.
    5. Open the budgetonline-ios://sbolpay/... deeplink.
    6. Wait 50ms.
    7. Reload the page to hide a possible alert if the deeplink could not open properly.
    8. Redirect back to your page with the new request settings.
    9. Open the ios-app-smartonline://sbolpay/... deeplink.
    10. Wait 50ms.
    11. Reload the page to hide a possible alert if the deeplink could not open properly.
    12. Redirect back to your page with the new request settings.
    13. Open the sberpay://... deeplink.
    14. Wait 50ms.
    15. Reload the page to hide a possible alert if the deeplink could not open properly.
    16. Redirect back to your page with the new request settings.
    17. Open the sbolpay://... deeplink.
    18. Wait 50ms.
    19. Reload the page.
    20. Follow the deeplink to the Sber landing page.

    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 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(openBtripsexpenses, 50);
    clearMessage();
    setTimeout(openBudgetonline, 50);
    clearMessage();
    setTimeout(openSberpay, 50);
    clearMessage();
    setTimeout(openSbolpay, 50);
    clearMessage();
    setTimeout(openLandingpage, 800);
    }
  2. 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.

The transaction will automatically move to the Canceled status after 20 minutes.

  1. Wait for a payment_finished webhook from Smart Glocal with the transaction results. Or, you can use the session/status method to check the transaction status (no more than once in 5 seconds).

  2. Pass the transaction status to the customer.