pk_live_… (or pk_test_… for testing). The key is not secret: it appears in your page source.https://www.yourshop.hu. Send us every domain you sell on, plus the return URL(s) where shoppers should land after a pre-assessment or credit limit request.https://bnpl-staging.instacash.hu/widget/v1/loader.js with a key created on staging.#instacash-widget and on every element with the data-instacash-widget attribute, so one page can hold several boxes.| Attribute | Required | Description |
|---|---|---|
data-box | optional | calculation (default), limit or prescore. Only the box types enabled for your shop are shown. |
data-layout | optional | full, compact, card or badge. If omitted or not enabled for your shop, your default layout is used. |
data-amount | required for calculation and prescore | The product's gross price in HUF, e.g. 549990. |
data-product-name | optional | Product name, shown in the pop-ups and passed to the pre-assessment. |
data-sku | optional | Product SKU, passed to the pre-assessment. |
data-quantity | optional | Quantity, passed to the pre-assessment (1–999). |
data-offer-id | optional | Offer to calculate with. Must be one of the offers enabled for your shop, otherwise your default offer is used. |
data-return-url | optional | Where the shopper returns after a pre-assessment or credit limit request. Must start with one of your allowed return URLs, otherwise the first one is used. |
data-key | optional | Publishable key for this element only, e.g. a different merchant per market. Defaults to the script tag's data-key. |
data-amount, data-product-name, data-sku and data-quantity: when your theme changes them (for example on a variant change), the box recalculates by itself.| Attribute | Required | Description |
|---|---|---|
src | required | https://bnpl.instacash.hu/widget/v1/loader.js (staging: https://bnpl-staging.instacash.hu/widget/v1/loader.js) |
data-key | required | Your publishable key. |
async | recommended | The widget never blocks your page. |
window.Instacash. Commands can be queued before the script has loaded:| Command | Description |
|---|---|
mount(element, options) | Mounts a box on an element added after the page loaded. options take the same keys as the attributes: box, layout, amount, name, sku, qty, offer, returnUrl, key. |
update(element, data) | Changes amount, name, sku or qty of a mounted box, e.g. on a variant change. |
refresh() | Mounts boxes on new #instacash-widget / [data-instacash-widget] elements and forgets removed ones. Call it after your app re-renders the page. |
on(event, fn) / off(event, fn) | Subscribes to or unsubscribes from an event. fn receives (detail, element). |
Instacash.update(el, { amount: 259990 }).instacash:<event>, with the details in event.detail.| Event | Detail | When |
|---|---|---|
ready | { box } | The box has loaded. |
calculation | { offerId, count, amount, thm, total } | A calculation box has figures: count instalments of amount, THM in percent, total payable. |
unavailable | { reason } | The box is not shown. reason: BOX_NOT_ENABLED, NO_OFFER, NO_AMOUNT, AMOUNT_OUT_OF_RANGE, DISABLED, ERROR or TIMEOUT. |
action | { action } | The shopper opened a pop-up from the box (summary or info). |
modal:open | { view } | A pop-up opened. |
modal:close | {} | The pop-up closed. |
Content-Security-Policy header, allow our host:script-src https://bnpl.instacash.hu;
frame-src https://bnpl.instacash.hu;data-amount with the product's price.pk_test_… keys also work on http://localhost (ask us to allow your local origin), so you can try the widget before going live. Use the staging script URL with a key created on staging to test the whole pre-assessment and credit limit flow.