> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fletch.co/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Fletch makes insurance products discoverable to and purchasable by AI agents, while the carrier keeps control of product rules, disclosures, consent, and payments. Fletch provides agentic commerce and agentic distribution for insurance, including APIs, an MCP server, a Web SDK, and journeys in assistants such as ChatGPT. Company overview: https://fletch.co/llms.txt. Agentic commerce: https://fletch.co/ai/. Contact: info@fletch.co.

# Integration Code

> Embed the renters insurance widget and pass customer data.

Follow these steps to integrate the widget into a website, web app, or mobile app.

Copy the following code to your website, web app, or mobile app. This code embeds the Fletch Insurance Widget (FIW). You can customize the iframe height and width.

Replace `#PARTNERCODE#` with the partner code. To get the partner code, contact Fletch at [info@fletch.co](mailto:info@fletch.co).

## Sandbox

```html theme={"dark"}
<iframe id="ifVCFrame" src="https://#PARTNERCODE#-wsb.fletch.co/" width="100%"
        height="400px" style="border: 0px !important;"></iframe>
```

## Production

```html theme={"dark"}
<iframe id="ifVCFrame" src="https://#PARTNERCODE#-wp.fletch.co/" width="100%"
        height="400px" style="border: 0px !important;"></iframe>
```

## Widget Display Types

The widget is optimized for 400px height.

Example widget source URL: `https://#PARTNERCODE#-wsb.fletch.co/`

## Appending Customer Data

Partners can pass customer data to prefill the widget. You can omit customer data without affecting widget operation.

Append query parameters to the widget URL in the `?key=value` format. Separate each pair with `&`.

### Approach 1: Sending data from widget URL

Use case: the widget is the full page redirect experience for the partner.

Fletch hosted widget URL:

`https://#PARTNERCODE#-wp.fletch.co/?customer_fname=Andrew&customer_lname=Miller`

| Key | Value |
| - | - |
| customer\_fname | Customer first name |
| customer\_lname | Customer last name |
| customer\_email | Customer email ID |
| customer\_phone | Customer phone number. Value should contain 10 digits |
| customer\_birth\_date | Customer date of birth in MM/DD/YYYY format |
| building\_street\_number | Building number of the property getting insured |
| street\_route\_name | Street name of the property getting insured |
| city\_locality | City of the property getting insured |
| country | Country code of the property getting insured. For example, US |
| zip\_code | 5-digit valid US zip code |
| apartment\_number | Apartment number (required if applicable) |

### Approach 2: Sending data from the client URL

Use case: redirect to a separate landing page that contains the widget.

Partner hosted website: `https://#PARTNERWEBSITE#/fletch/?customer_fname=Andrew&customer_lname=Miller`

Fletch hosted partner landing page: `https://fletch.co/#PARTNERCODE/?customer_fname=Andrew&customer_lname=Miller`

Add this script after the iframe:

```html theme={"dark"}
<script>
  var iframe = document.getElementById("ifVCFrame")
  if (typeof(iframe) != 'undefined' && iframe != null && window.location.search != '') {
    var url = iframe.src
    iframe.src = url + window.location.search
  }
</script>
```

### Approach 3: Sending data from a partner web or mobile application

Use case: the partner application and the Fletch widget are on the same page.

```html theme={"dark"}
<script>
  var iframe = document.getElementById("ifFLFrame")
  if (typeof(iframe) != 'undefined' && iframe != null) {
    var url = iframe.src
    var separator = url.indexOf('?') === -1 ? '?' : '&'
    iframe.src = url + separator + "key1=" + value1 + "&key2=" + value2
  }
</script>
```

The query parameters are the same as Approach 1.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.