YooMoney API
Guides
Old versions of the API
Help
Sign up for YooMoney
“Credit purchases” by SberBank
 
Specifics
Integration scenarios
Ready-made solutions:
Overview
Who can apply for a loan
Users who have a valid SberBank debit card and access to SberBank Online can apply for credit from SberBank when paying for a purchase.
What loan options are available
Two options are available, loans and installment plans:
  • Loans (also known as consumer loans) require the user to repay the purchase cost to SberBank with added interest. You will receive the entire amount of the purchase cost minus the YooMoney commission.
  • Installment plans (loans without overpayments) include interest in the purchase cost, so formally the user does not pay interest for using the money borrowed from SberBank. Basically, when the customer applies for an installment plan, you provide them with a discount on the purchase amount (the discount is equal to the interest for using borrowed money). You will receive the purchase cost reduced by the discount amount, minus the YooMoney commission.
Example: purchase cost (payment amount) is 5,000 rubles, YooMoney commission is 3.5 %.
OptionAmount paid by the user to the bankAmount that you will receive
Loan
Purchase cost + interest to the bank for using borrowed money:
5,000 rubles + interest
Purchase cost minus the YooMoney commission:
5,000 * (1 - 0.035) = 5,000 * 0.965 = 4.825 rubles
Installment plan
Purchase cost:
5,000 rubles
Purchase cost reduced by the amount of the SberBank discount (for example, 10% of the purchase cost), minus the YooMoney commission:
(5,000 - 500) * (1 - 0.035) = 4,500 * 0.965 = 4,342.5 rubles
You can learn more about each options and its conditions by contacting the YooMoney manager.
You select the options when activating the payment method, with the confirmation from the manager. During payment, all selected options are displayed on the payment form, so the user can choose between them. More about how the payment process
What are the specifics of loans and installment plans
Specifics of loans
  • The payment amount does not change. You will receive the entire purchase price minus the YooMoney commission.
  • In case of partial capture, the amount must be within limits.
  • In case of partial capture, cancellation, and refund of the payment, YooMoney will return the money to the user’s card. The user needs to repay the debt independently in the app or via the SberBank Online website.
Specifics of installment plans
  • Payment amount changes: after a successful payment, YooMoney will recalculate the amount you specified in the request, taking into account the installment plan discount. You will receive the purchase cost reduced by the discount amount, minus the YooMoney commission.
  • When capturing, canceling, and refunding a payment, you need to specify the amount including the discount.
  • In case of partial capture, the amount must be within limits.
  • In case of partial capture, cancellation, and refund of the payment, YooMoney will return the money to the user’s card. The user needs to repay the debt independently in the app or via the SberBank Online website.
  • If you use the YooMoney solutions for sending receipts to the tax service, YooMoney will automatically recalculate the cost of goods (including discount) in the receipt when making a payment. In case of partial capture or partial refund of the payment, you will need to recalculate the cost of the goods independently and submit the data for the receipt, including discount.
More details about the specifics of installment plans:
What are the payment limits
Payment limits depend on SberBank's restrictions on the amount of the loan issued. There are limits during creating and capturing a payment.
Limits for creating a payment
Minimum payment amount:
  • For a loan: 3,000 rubles.
  • For an installment plan: 3,000 rubles plus the amount of the maximum installment discount among the options you have selected. Example: if your biggest discount for installment plans of 10%, then the minimum payment amount is 3,300 rubles (3,000 rubles + 300 rubles of discount).
The maximum payment amount is 600,000 rubles.
Limits for capturing a payment
The minimum amount for partial payment capture is 3,000 rubles.
How does a payment get processed
When paying for goods, the user selects “Credit purchases” by SberBank and, if necessary, the credit option, i.e. a loan or an installment plan for a certain number of months.
How it looks in different integration scenarios:
Smart payment
Manual integration
YooMoney Checkout Widget
Example of a payment form when using Smart payment
After that, the user proceeds to SberBank Online, where they fill out the credit application. Once SberBank reviews the application, it will transfer money to you via YooMoney and redirect the user back to your website. Detailed diagrams of how payment and refund processes
You will know which option the user selected during payment as well as the amount of the discount for an installment plan after the successful payment. If the payment was successful (payment status is waiting_for_capture or succeeded), information about the selected option (loan_option parameter) and the discount for the installment plan (discount_amount object) will be returned in the payment_method object of the payment object. For installment plans, the payment amount in the amount object will change to the payment amount including the discount.
Example of a payment with the succeeded status (loan)
JSON
{
  "id": "22c5d0f0-000f-5000-8000-13ece77bc6c1",
  "status": "succeeded",
  "paid": true,
  "amount": {
    "value": "5000.00",
    "currency": "RUB"
  },
  "income_amount": {
    "value": "4825.00",
    "currency": "RUB"
  },
  "captured_at": "2021-06-22T21:44:55.506Z",
  "created_at": "2021-06-22T21:43:44.794Z",
  "description": "Order No. 37",
  "metadata": {
    "order_id": "37"
  },
  "payment_method": {
    "type": "sber_loan",
    "id": "22c5d0f0-000f-5000-8000-13ece77bc6c1",
    "saved": false,
    "loan_option": "loan"
  },
  "recipient": {
    "account_id": "100500",
    "gateway_id": "100700"
  },
  "refundable": true,
  "refunded_amount": {
    "value": "0.00",
    "currency": "RUB"
  },
  "test": true
}
Example of a payment with succeeded status (installment plan)
JSON
{
  "id": "22c5d0f0-000f-5000-8000-13ece77bc6c1",
  "status": "succeeded",
  "paid": true,
  "amount": {
    "value": "4500.00",
    "currency": "RUB"
  },
  "income_amount": {
    "value": "4342.50",
    "currency": "RUB"
  },
  "captured_at": "2021-06-22T21:44:55.506Z",
  "created_at": "2021-06-22T21:43:44.794Z",
  "description": "Order No. 37",
  "metadata": {
    "order_id": "37"
  },
  "payment_method": {
    "type": "sber_loan",
    "id": "22c5d0f0-000f-5000-8000-13ece77bc6c1",
    "saved": false,
    "loan_option": "installments_12",
    "discount_amount": {
      "value": "500.00",
      "currency": "RUB"
    }
  },
  "recipient": {
    "account_id": "100500",
    "gateway_id": "100700"
  },
  "refundable": true,
  "refunded_amount": {
    "value": "0.00",
    "currency": "RUB"
  },
  "test": true
}
What are the payment and refund scenarios like
Payment process
Payment process
The payment process is as follows:
  1. The user proceeds to the payment (for example, for Smart payment, they click the Pay button).
  2. You create a payment by sending a POST request to YooMoney, taking into account the integration scenario you have selected.
  3. YooMoney returns the created payment object with the pending status to you alongside the link to the payment form (the confirmation_url parameter in the payment object).
  4. You redirect the user to the payment page.
  5. The user selects the option they require.
  6. YooMoney redirects the user to SberBank Online.
  7. The user fills out a credit application in SberBank Online in accordance with the selected option.
  8. SberBank reviews the application.
  9. SberBank reports the result to YooMoney and the user, and redirects the user to your website.
  10. If the user has selected an installment plan, YooMoney will calculate the discount amount with the option selected by the user taken into account, and it will change the payment amount in the payment object and in receipts (if you send receipts to the tax office via YooMoney).
  11. If you have notifications enabled, YooMoney sends a notification about the payment status changing to succeeded (for payments made in one stage) or to waiting_for_capture (for two-stage payments).
  12. You request information about the payment by a GET request with the payment ID to YooMoney.
  13. YooMoney returns the created payment object in its current status to you.
  14. You inform the user of payment results.
If you process payments in two stages, then after receiving the payment from the user, you will need to capture or cancel the it.
How to capture or cancel a payment in two stages
Refund process
Refund process
The refund process is as follows:
  1. You create a refund by sending a POST request to YooMoney containing the payment ID and the information about what part of the payment needs to be refunded.
  2. YooMoney refunds the specified amount to the user.
  3. YooMoney returns the payment object with the succeeded status to you.
  4. You inform the user that you have refunded the payment to them, and warn them that they will need to repay the debt independently in SberBank Online.
  5. The user repays the debt.
How to activate this payment method
Make sure you can activate this payment method:
To activate this payment method:
  1. Tell the YooMoney manager that you want to use “Credit purchases” by SberBank.
  2. Select the options you need from the list that the manager will offer you.
  3. Integrate with YooMoney following the instructions:
  4. If necessary, add additional fields to the reports on payments and refunds.
  5. Test the integration by making a payment for the minimum amount, then make a refund.
Done! You can accept payments from real users.
Payment on the ready-made YooMoney page
How it works
In this scenario, you independently implement the feature of selecting the payment method. After creating the payment, you redirect the user to the YooMoney page. This page will display the payment form with the options you have selected. By clicking the Loan from SberBank button, the user will be able to apply for a consumer loan, and in the block about Installment plan from SberBank, they will be able to select the installment plan they need and apply for it.
Example of a payment form for manual integration
If you have only enabled loans or installment plans, just one button with the corresponding name will be displayed.
To integrate, add a button to your website that will direct the user to the payment.
When the user follows the link, you will receive the link to the ready-made payment page from YooMoney: redirect the user to it. When the user returns to your website, request the payment results from YooMoney.
How a payment gets processed
Step 1. When the user selects “Credit purchases” by SberBank, create a payment  by sending a request to YooMoney containing the request authentication data, idempotency key, and payment data:
  • in the amount object, specify the amount to be debited from the user; the amount must be within limits;
  • in the payment_method_data object, specify the sber_loan payment method code;
  • in the confirmation object, specify the redirect type and the URL of the page on your side that the user will return to after the payment (in the return_url parameter);
  • in the description parameter, specify the description of the payment that the user will see when paying.
Example of a request
cURL
curl https://api.yookassa.ru/v3/payments \
  -X POST \
  -u <Shop ID>:<Secret Key> \
  -H 'Idempotence-Key: <Idempotence Key>' \
  -H 'Content-Type: application/json' \
  -d '{
        "amount": {
          "value": "5000.00",
          "currency": "RUB"
        },
        "payment_method_data": {
          "type": "sber_loan"
        },
        "confirmation": {
          "type": "redirect",
          "return_url": "https://www.example.com/return_url"
        },
        "description": "Order No. 37",
        "metadata": {
          "order_id": "37"
        }
      }'
The payment object in its current status will be returned in response to the request.
Step 2. Redirect the user to the YooMoney page, the URL of which will be provided in confirmation_url. This is a link to the YooMoney page where the user will select an option and proceed to payment confirmation.
Example of the body of a response
JSON
{
  "id": "22c5d0f0-000f-5000-8000-13ece77bc6c1",
  "status": "pending",
  "paid": false,
  "amount": {
    "value": "5000.00",
    "currency": "RUB"
  },
  "confirmation": {
    "type": "redirect",
    "confirmation_url": "https://yoomoney.ru/payments/internal/confirmation?orderId=22c5d0f0-000f-5000-8000-13ece77bc6c1"
  },
  "created_at": "2021-06-22T21:44:55.506Z",
  "description": "Order No. 37",
  "payment_method": {
    "type": "sber_loan",
    "id": "22c5d0f0-000f-5000-8000-13ece77bc6c1",
    "saved": false
  },
  "metadata": {
    "order_id": "37"
  },
  "recipient": {
    "account_id": "100500",
    "gateway_id": "100700"
  },
  "refundable": false,
  "test": false
}
Step 3. Wait for the successful completion of the payment: you will receive a notification from YooMoney, or you can send periodic requests for payment information .
If the payment was successful (payment status is waiting_for_capture or succeeded), information about the selected option (loan_option parameter) and the discount for the installment plan (discount_amount object) will be returned in the payment_method object of the payment object. For installment plans, the payment amount in the amount object will change to the payment amount including the discount.
Example of a payment with the succeeded status (loan)
JSON
{
  "id": "22c5d0f0-000f-5000-8000-13ece77bc6c1",
  "status": "succeeded",
  "paid": true,
  "amount": {
    "value": "5000.00",
    "currency": "RUB"
  },
  "income_amount": {
    "value": "4825.00",
    "currency": "RUB"
  },
  "captured_at": "2021-06-22T21:44:55.506Z",
  "created_at": "2021-06-22T21:43:44.794Z",
  "description": "Order No. 37",
  "metadata": {
    "order_id": "37"
  },
  "payment_method": {
    "type": "sber_loan",
    "id": "22c5d0f0-000f-5000-8000-13ece77bc6c1",
    "saved": false,
    "loan_option": "loan"
  },
  "recipient": {
    "account_id": "100500",
    "gateway_id": "100700"
  },
  "refundable": true,
  "refunded_amount": {
    "value": "0.00",
    "currency": "RUB"
  },
  "test": true
}
Example of a payment with the succeeded status (installment plan)
JSON
{
  "id": "22c5d0f0-000f-5000-8000-13ece77bc6c1",
  "status": "succeeded",
  "paid": true,
  "amount": {
    "value": "4500.00",
    "currency": "RUB"
  },
  "income_amount": {
    "value": "4342.50",
    "currency": "RUB"
  },
  "captured_at": "2021-06-22T21:44:55.506Z",
  "created_at": "2021-06-22T21:43:44.794Z",
  "description": "Order No. 37",
  "metadata": {
    "order_id": "37"
  },
  "payment_method": {
    "type": "sber_loan",
    "id": "22c5d0f0-000f-5000-8000-13ece77bc6c1",
    "saved": false,
    "loan_option": "installments_12",
    "discount_amount": {
      "value": "500.00",
      "currency": "RUB"
    }
  },
  "recipient": {
    "account_id": "100500",
    "gateway_id": "100700"
  },
  "refundable": true,
  "refunded_amount": {
    "value": "0.00",
    "currency": "RUB"
  },
  "test": true
}
Step 4. When the user returns to return_url, display the payment result (success or failure) depending on the payment status.
Done! If you process payments in two stages, capture or cancel the payment. Inform the user of the final payment result.
Specifics of processing two-stage payments
If you process payments in two stages, you need to account for certain specifics regarding partial capture and cancellation of a payment:
  • In case of partial capture, the amount must be within limits.
  • In case of partial capture or cancellation of the payment, YooMoney will return the money to the user’s card. Warn the user that they will need to repay the debt independently in the app or on the SberBank Online website. It is recommended to repay the debt as soon as possible to reduce or the amount of overpayment or avoid it altogether (this is relevant for all options, including installment plans).
Additional information for installment plans
When creating a request for partial payment capture, please specify the amount including the discount.
For example, you created a payment in the amount of 5,000 rubles. The user selected an installment plan, and the discount was 10 % (500 rubles). As a result, you received 4,500 rubles. If you want to debit, for example, just three quarters of the payment, capture the payment for the amount of 3,375 rubles.
Refunds
Terms of refunds are standard.
Return period is 1 to 3 business days.
After the refund, YooMoney will credit the money to the user’s card. Warn the user that they will need to repay the debt independently in the app or on the SberBank Online website. It is recommended to repay the debt as soon as possible to reduce or the amount of overpayment or avoid it altogether (this is relevant for all options, including installment plans).
Additional information for installment plans
When creating a request for a refund, please specify the amount including the discount.
For example, you created a payment in the amount of 5,000 rubles. The user selected an installment plan, and the discount was 10 % (500 rubles). As a result, you received 4,500 rubles. If you want to refund the entire payment, set the amount of 4,500 rubles. If you want to refund, for example, half of the payment, set the amount of 2,250 rubles.
Sending receipts to the tax service
To send receipts to the tax service, you can use the YooMoney solutions. If you selected a loan, the process is standard; if you selected an installment plan, certain specifics regarding the cost will need to be specified in the receipts.
Additional information for installment plans
Receipt during the payment
If the user selected installment plans during payment, then YooMoney will automatically recalculate the cost of goods (including discount) in the receipt when making a payment.
Example: when creating a payment, you specified the following data for the receipt.
ProductCostQuantity
Product 13,000.001
Product 21,000.002
Total order amount is 5,000 rubles.
The user selected an installment plan, and the discount was 10 % (500 rubles).
YooMoney will recalculate the amount of the goods in the receipt.
ProductCostQuantity
Product 12,700.001
Product 2900.002
Total order amount is 4,500 rubles.
Receipts for partial payment capture and partial refunds
In case of partial capture (for two-stage payment) or partial refund of the payment, you will need to recalculate the cost of the goods independently and submit the data for the receipt, including discount.
To do that, save a list of the options you have selected as well as the corresponding values in the API and the discount percentage in your system before making the payment.
When making a partial capture or partial refund:
Step 1. Find out what option the user selected for payment. This information is contained in the payment_method.loan_option parameter of the payment object.
Step 2. Determine the discount percentage for this option.
Step 3. Adjust the cost of goods in accordance with the discount. If you need to round a value, use mathematical rounding. Example:
  • Original cost of the product in the receipt: 999.90 rub.
  • Discount percentage: 5 %
  • Discount amount: RUB 49.995 rub.
  • Product cost including discount: RUB 949.905 rub.
  • Cost of the product including the discount that must be specified in the request: 949.91 rub.
Step 4. Send a request for a partial refund or partial capture to YooMoney and specify the cost of the goods adjusted for discount in the receipt object.
Additional fields in reports
You can add additional fields with the loan rates and the discount amount to the reports of successful payments and refunds. How to do that:
See also