Available conditions
This method (available within the JavaScript library, nemuru.js
) allows you to obtain which are the products and terms available for a certain amount. With this utility, you will be able to determine what conditions are available before displaying any widget -or decide not to offer financing if no conditions are available.
Firstly, make sure to load and initialize the nemuru.js JavaScript library if you haven't already.
How to call available conditions
Once the library is loaded, the .availableConditions()
method, made available within the Nemuru
object provided by the library, can be called.
Nemuru.availableConditions({ amount: 300 });
[
{
"product": "split_pay",
"terms": [
3
]
},
{
"product": "instalments",
"terms": [
3,
10,
12
]
}
]
Parameter details:
Field | Type | Required | Description | Example |
---|---|---|---|---|
amount | number | Required | The amount to be financed (cents as decimals). | 300.00 |
products | string[] | Required | The financial product(s) to be included in the query. Possible values are: instalments , split_pay . | ["split_pay"] |
Although the types of products enabled depend on the agreement between the merchant and lender(s), the common ones are:
instalments
: Your customer pays in instalments with interest or fixed cost per instalment. Pay the first instalment at the checkout (which may have an opening fee) and the rest on the same day for the following X months.split_pay
: Your customer divides the payment in equal parts, no interests applied. Pay the first instalment at the checkout (which may have an opening commission) and the rest on the same day for the following X months.
When the .availableConditions()
method is called, the result is a breakdown of the various available products and their corresponding terms; that is, an array of objects where each object will refer to a product (product
) and, additionally, will include all terms (terms
) available for that product (in months). If the result is an empty array, it means that for the amount
(and products
) provided, there is no combination of conditions available.
Examples
The following examples are based on a fake pricing:
- Amount of 591€.
- Both products
split_pay
andinstalments
are available.
Nemuru.availableConditions({ amount: 591.00 });
[
{
"product": "split_pay",
"terms": [
3
]
},
{
"product": "instalments",
"terms": [
3,
10,
12
]
}
]
- Amount of 1000€.
- Only the
instalments
product is queried.
Nemuru.availableConditions({ amount: 1000.00, products: ['instalments'] });
[
{
"product": "instalments",
"terms": [
3,
10,
12
]
}
]
- Amount of 8000€.
- There're no products available for this amount.
Nemuru.availableConditions({ amount: 8000.00 });
[]