Widget for installments
If you implemented Yandex.Checkout before October 2017, learn more about the widget in the old protocol for payment acceptance.
The widget for installments is an additional Yandex.Checkout's solution for the Installments payment method. It allows you to quickly calculate the amount of a monthly installment and show it to the user.
If you want to show the amount of a monthly installment, use:
 YandexCheckoutCreditUI.js
You can use this JavaScript library to embed Yandex.Checkout's Installments widget into your system.
You can select a display mode for the widget: button or information block.
Button can be embedded in the cart (once the user selected the product). The button shows the actual amount of a monthly installment.
Information block can be placed in the product's description or in the catalog to inform the user that they can pay for this particular product in installments. The block shows the actual amount of a monthly installment.
 Getting started
To get started, implement the library and create an instance of
YandexCheckoutCreditUI
.
Implement the library
HTML
<script src="https://static.yandex.net/kassa/pay-in-parts/ui/v1/"></script>
Create an instance of YandexCheckoutCreditUI
JavaScript
const $checkoutCreditUI = YandexCheckoutCreditUI(params);
Where
params
are the configuration parameters.
 Configuration
ParameterTypeDescription
shopId
longID of a store, issued after you've signed up for Yandex.Checkout.
sum
CurrencyAmountOrder amount.
Example of YandexCheckoutCreditUI configuration
JavaScript
const $checkoutCreditUI = YandexCheckoutCreditUI(params);
    shopId: '6677',
    sum: '3000'
});
 Widget display
Use the
.UPDATE
method for displaying the widget.
JavaScript
$checkoutCreditUI.update();
NameDescriptionTypeDefault
domSelector
Selector of the element in the page's source code where the widget is displayed (id or class)string{void}
type
Widget's display mode. Possible values:
button
(button),
info
(information block).
string
button
tag
Tag used for displaying the button (can only be used with
type='button'
). Possible values:
button
,
input
.
string
button
theme
Button design (can only be used with
type='button'
). Possible values:
white
or
default
.
string
default
The button (
type='button'
) can be configured by selecting its design. If there is no
theme
or
theme='default'
, the button will be yellow. If
theme='white'
, the button will be white.
Yellow button with the input type='button' tag
JavaScript
const checkoutCreditButton1 = $checkoutCreditUI({
    type: 'button',
    theme: 'default',
    domSelector: '.parent1'
});
White button with the input type='submit' tag
JavaScript
const checkoutCreditButton2 = $checkoutCreditUI({
    type: 'button',
    tag: 'input',
    theme: 'white',
    domSelector: '.parent2'
});
Infoblock
JavaScript
const checkoutCreditText = $checkoutCreditUI({
    type: 'info',
    domSelector: '.parent3'
});
 Example of use
JavaScript
const $checkoutCreditUI = YandexCheckoutCreditUI({
    shopId: '6677',
    sum: '3000'
});

const checkoutCreditText = $checkoutCreditUI({
    type: 'info',
    domSelector: '.parent3'
});
 credit-pre-schedule method
This method allows pre-calculating the amount of a monthly installment repayment for a particular product when the payment is made via Yandex.Checkout's Installments service.
 Calling the method
Requests are sent using the GET method under the HTTP/1.1 protocol.
Address for sending requests:
https://money.yandex.ru/credit/order/ajax/credit-pre-schedule
Request parameters
ParameterTypeDescription
shopId
longStore's ID, issued after you've signed up for Yandex.Checkout.
sum
CurrencyAmountOrder amount.
Example of a request
JavaScript
https://money.yandex.ru/credit/order/ajax/credit-pre-schedule?shopId=6677&sum=10000
Response parameters
ParameterTypeDescription
term
longLoan or installment plan term, number of months.
creditPercent
longInterest rate (percentage per month).
amount
CurrencyAmountAmount of a monthly installment.
totalAmount
CurrencyAmountFull amount of a loan over the entire period including interest.
Example of a response
JSON
{
    "term":12,
    "creditPercent":"3.90",
    "amount":"1223.33",
    "totalAmount":"14680.00"
}
 See also
Processing paymentsInstallments