# Calculator iFrame

An **iframe** (inline frame) is an HTML element that allows you to embed another website or application within your webpage. This document provides guidance on integrating an iframe provided by Bumper, ensuring proper security and compliance.

### Implementation

#### 1. Adding the iFrame

To add an iframe to your webpage, follow these steps:

1. Open your HTML file in a text editor or an integrated development environment (IDE).
2. Locate the section of your webpage where you want the iframe to appear.
3. Copy and paste the following iframe code inside the `<body>` tag:

**Example Code:**

```html
<iframe
    width="100%"
    height="600"
    style="border:none;"
    title="Bumper Calculator"
    src="https://www.bumper.co/gb/thirdparty/calculator?defaultAmount=300&firstRepaymentAvailable=true&preApprovedButtonLink=&products=%7B%22products%22%3A%5B%7B%22deposit%22%3Afalse%2C%22deposit_percentage%22%3A%22%22%2C%22id%22%3A94.13936357912868%2C%22instalments%22%3A3%2C%22max%22%3A%223000%22%2C%22min%22%3A%2260%22%7D%2C%7B%22deposit%22%3Afalse%2C%22deposit_percentage%22%3A%22%22%2C%22id%22%3A83.92947152638605%2C%22instalments%22%3A6%2C%22max%22%3A%223000%22%2C%22min%22%3A%2260%22%7D%2C%7B%22deposit%22%3Afalse%2C%22deposit_percentage%22%3A%22%22%2C%22id%22%3A10.210993699885563%2C%22instalments%22%3A9%2C%22max%22%3A%223000%22%2C%22min%22%3A%2260%22%7D%5D%7D&amountPlacement=right&supplier=Bumper">
</iframe>
```

{% hint style="danger" %}
The above is example code and should not be used in a live environment. Please contact Bumper for the correct iFrame HTML specific to your integration.
{% endhint %}

4. Save your HTML file and open it in a web browser to confirm that the iframe loads correctly.

#### 2. Content Security Policy (CSP)

To allow embedding of the Bumper iframe, update your site's CSP settings to permit the Bumper domain.

**Example CSP Header:**

```
Content-Security-Policy: frame-src 'self' https://www.bumper.co;
```

If using a `meta` tag in HTML:

```
<meta http-equiv="Content-Security-Policy" content="frame-src 'self' https://www.bumper.co;">
```

### **BUMPER Parameters**

<table><thead><tr><th width="272">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><code>defaultAmount</code></td><td>Sets the default transaction amount for the calculator.</td></tr><tr><td><code>firstRepaymentAvailable</code></td><td>Indicates if the first repayment option is available.</td></tr><tr><td><code>products</code></td><td><p>Specifies the products included in the calculation.</p><ul><li><code>deposit</code>: Whether a deposit is required (<code>true/false</code>).</li><li><code>deposit_percentage</code>: Percentage of deposit required (if any).</li><li><code>id</code>: Unique identifier for the product.</li><li><code>instalments</code>: Number of instalments for repayment.</li><li><code>max</code>: Maximum amount for the product.</li><li><code>min</code>: Minimum amount for the product.</li></ul></td></tr><tr><td><code>amountPlacement</code></td><td>Defines the placement of the amount, options are right or left</td></tr><tr><td><code>supplier</code></td><td>Identifies the supplier, typically set to <code>Bumper</code>. This parameters also control the theme shown.</td></tr></tbody></table>

{% hint style="danger" %}
BUMPER will provide these fields fully configured; the information above is for reference only.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://api-docs.bumper.co/bumper-api-documentation/calculator-iframe.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
