NAV Navbar
Logo

Introduction

Welcome to the setup and API documentation for Quote & Apply.

Website Setup

Below you will find instructions detailing how to put Quote & Apply on your website.

<!doctype html>
</html>
<head>
  <title>My Website!!!</title>
</head>
<body>
  <p>This is my website.</p>

  <div id="my-container"></div>
</body>
</html>

Determine where you wish to place Quote & Apply. In this website, we wish to place Quote & Apply inside the box represented by the black border.

Find the container in your source code and give it an ID if it does not already have one. The container in this example has the id of “my-container”.

<!doctype html>
</html>
<head>
  <title>My Website!!!</title>
</head>
<body>
  <p>This is my website.</p>

  <div id="my-container"></div>

  <script
    id="strife"
    src="https://s3-us-west-2.amazonaws.com/strife/production/strife.js"
    data-strife-key="SAMPLE"
    data-strife-container-id="my-container"
    ></script>
</body>
</html>

Place your unique Quote & Apply snippet at the bottom of your code (before the </body> tag). Replace the data-strife-container-id value with your container’s id.

That’s it! Save your changes and open your webpage. With our example, it should look something like this:

The following example details how you can use open Quote & Apply via a button and have it appear as a modal.

Place the code for your button where you want it to appear:

<!doctype html>
</html>
<head>
  <title>My Website!!!</title>
</head>
<body>
  <p>This is my website.</p>
  <img src="https://s3-us-west-2.amazonaws.com/portal-pictures/backnine.png">
</body>
</html>

<!doctype html>
</html>
<head>
  <title>My Website!!!</title>
</head>
<body>
  <p>This is my website.</p>
  <img class="strife-button" src="https://s3-us-west-2.amazonaws.com/portal-pictures/backnine.png">
</body>
</html>

In this example, the BackNine logo will be the trigger to open Quote & Apply. To bind this button to the application, add the CSS class “strife-button”:

Now place your unique Quote & Apply snippet anywhere below that button and above the </body> tag and remove the data-strife-container-id attribute.

<!doctype html>
</html>
<head>
  <title>My Website!!!</title>
</head>
<body>
  <p>This is my website.</p>
  <img class="strife-button" src="https://s3-us-west-2.amazonaws.com/portal-pictures/backnine.png">
  <script
    id="strife"
    src="https://s3-us-west-2.amazonaws.com/strife/production/strife.js"
    data-strife-key="SAMPLE"
    ></script>
</body>
</html>

Clicking the image should now result in opening Quote & Apply within a modal.

The following example details how you can setup Quote & Apply using Wordpress.

Log in to your WordPress site as admin. You should arrive at the Dashboard.

Go to your list of pages.

Find the page you wish to use Quote & Apply on. Click “Edit”. You should arrive at on some sort of editor that allows you to edit the content of the page.

Find and click on the “Text” mode at the top right of the editor. This will allow you to edit the content using HTML code.

Paste your snippet into the editor where you wish the button to appear. Replace the data-strife-container-id value with your container’s id.

Image 6

Next, go to the “Publish” section and hit “Update”. The screen should refresh with a success message.

Click on “View page” to see your results.

Google Analytics

You can receive Google Analytics data on your Quote & Apply sessions and advanced users can also setup Google Tag Manager on your Quote & Apply website.

To get started, log into BOSS > Quote & Apply > Setup and insert your Google Analytics and Google Tag Manager tracking ID’s. Google Tag Manager is optional. If you’d like to use Google Tag Manager, email support@back9ins.com so we can email you a Google Tag Manager container which you can import into your Google Tag Manager account.

Navigate to the Google Analytics Solutions Gallery and search for “Quote & Apply - Application Complete and Lead Created Funnel Goals” and click import next to the result authored by reidtattersall.

You should immediately see session data within your Google Analytics account. After 24 hours, you should see data within your Google Analytics Funnel Visualization report (see screenshot) which is located in Google Analytics > Conversions > Goals > Funnel Visualization.

API Setup

Both the user of this API and the writing agent must have an account on BOSS.

You will need to set up both your back end and your front end in order to use our API.

Endpoint

Our root API endpoint is:

https://app.back9ins.com/api/v1

All request endpoints must be prepended with the above root URL.

Authentication

Each request must contain an authentication header:

X-BACKNINE-AUTHENTICATION: your-api-key

We will provide you with an API key.

Snippet

Retrieving the snippet

<script
  id="strife"
  src="https://s3-us-west-2.amazonaws.com/strife/production/strife.js"
  data-strife-key="SAMPLE_KEY"
></script>

You will need to set up your snippet in order to integrate with Quote & Apply.

You should have domains set up in BOSS under Quote & Apply > Setup for all the websites you wish to use the API with.

If you grab the snippet from BOSS by using the “Copy Snippet” feature, your snippet should look something like the code to the side.

You actually do not need the exact snippet provided by BOSS, as you will see in the next section.

Modifying the snippet

First step is to remove the data-strife-key attribute because your API will not use it.

<script
  id="strife"
  src="https://s3.amazonaws.com/strife/production/strife.js"
  data-strife-npn="10790698"
  data-strife-subscriber-id="SAMPLE_SUBSCRIBER_ID"
></script>

Next, you will need to generate a page on your website that contains the snippet in the page with two new attributes: data-strife-npn and data-strife-subscriber-id.

The NPN must be the NPN of the writing agent you wish to use. Look it up on NIPR’s website if you don’t already know it. Both the user of this API and the writing agent must have an account in BOSS. If the API user is not the agent, the API user must have a parent connection to the agent.

The value for data-strife-subscriber-id can be any value you wish, but it ideally should be random each time the client starts a session in order to ensure that no other parties receive the messages sent between Quote & Apply and BOSS.

Adding the required JavaScript functionality

If you have followed the instructions up until this point, when you open the Quote & Apply app on your webpage, you will notice that the screen is darkened but blank. At some point, you will need to tell your server to send a request to BOSS that will tell BOSS to create a session that will populate your app.

Let’s assume you wish to tell BOSS to fill the app when the Quote & Apply button is clicked. In order to do so, you may wish to bind a click event that sends a request to your server, which then prompts your server to send a request to BOSS. BOSS will then fill the form with the data you provide.

Example - Sending an AJAX request to your server when the button is clicked

Your snippet will generate a button that has the HTML class attribute strife-button. You can use that class name to identify the button and bind it to the click.

$(".strife-button").click(function() {
  var yourServerEndpoint = "/start_session" // Modify the endpoint according to your setup.

  $.post(yourServerEndpoint)
})

This example assumes you are using jQuery, but you can bind the events manually or using another library if you wish.

Place the following code in a <script></script> tag or run it within your own JavaScript source file. When the user clicks the button, it should send a request to your server.

See the next section for instructions on sending our endpoint a request.

Pre-filling Quote & Apply

Endpoint

The endpoint for this action is as follows:

POST https://app.back9ins.com/api/v1/apply/create

Parameters

{
  "domain": "http://example.org",
  "npn": "10790698",
  "subscriber_id": "your-subscriber-id",
  "consumer_user_id": "your-customer-id",
  "electronic_application": {
    "face_amount": 1000000,
    "gender": "Male",
    "birthdate": "1975-07-04",
    "state": "CA",
    "health": 3,
    "smoker": false,
    "mode": 12,
    "product_category": "15 Year Term",
    "test": true,
    "application_roles_attributes": [
      {
        "role": "Insured",
        "ownable_attributes": {
          "ownable_type": "Individual",
          "first_name": "John",
          "last_name": "Doe",
          "drivers_license_attributes": {
            "number": "C1234567",
            "state": "CA"
          },
          "addresses_attributes": [
            {
              "address_type": "home",
              "street_address": "1234 My Street",
              "city": "Westlake Village",
              "state": "CA",
              "zip": "91362",
              "country": "United States",
              "start_date": "2016-04-04"
            }
          ]
        }
      }
    ]
  }
}

Send an HTTPS POST request to the above route along with the request body to generate an eApp session for your client.

Top-level parameters

These are the top-level JSON parameters you will be sending to our endpoint.

Key Type Requiredness Description
domain String required The domain you registered in BOSS to use for Quote and Apply.
npn String required The NPN of the writing agent for the case. This agent must have the above domain registered in BOSS. Use https://www.nipr.com/PacNpnSearch.htm to look up your agent’s NPN. If the user of this API is not the writing agent, the user must have a parent connection to the writing agent.
subscriber_id String required A custom value you pass in to both the API and the snippet. It is assumed that this value is unique across each session for security purposes.
consumer_user_id String required A custom value you provide that identifies your client. This value must be the same every time for the same client so we can link eApps to that client.
electronic_application Object required See parameters below.

Electronic Application parameters

These describe the electronic_application parameter listed above.

All of these parameters are optional, but providing all of them will display quotes (if any) to the consumer the instant the app is loaded.

Key Type Requiredness Default Description
face_amount Number optional null The face amount applied for.
gender String optional null The gender of the applicant. Must be “Male” or “Female”.
birthdate String optional null The birthdate in YYYY-MM-DD format.
state String optional null The 2 digit state abbreviation.
health Number optional null A scale of 1 to 5 of the health of the applicant. 1 is poor and 5 is excellent.
smoker Boolean optional null Whether or not the applicant smokes tobacco.
mode Number optional 12 A number representing the premium mode. Currently we only support the value 12, which is monthly.
product_category String optional null The type of product. The valid options are: “To Age 120”, “To Age 100”, “To Age 95”, “30 Year Term”, “30 Year Return of Premium Term”, “25 Year Term”, “20 Year Term”, “20 Year Return of Premium Term”, “15 Year Term”, “10 Year Term”.
test Boolean optional null Indicates whether this is a test eApp or a real eApp.
application_roles_attributes Array optional null Creates roles such as “insured” on the policy.

Application Roles parameters

These describe the application_roles_attributes parameter listed above. You can use this parameter to pre-fill the insured’s info on the eApp.

Key Type Requiredness Default Description
role String required null The role of the ownable on the policy. Valid options are: “Insured”.
ownable_attributes Object required null Attributes describing the ownable.

Ownable parameters

These describe the ownable_attributes parameter listed above for Application Roles. This is a polymorphic association, but we currently only support parameters describing an individual. You can use this parameter to pre-fill the insured’s info on the eApp.

Key Type Requiredness Default Description
ownable_type String required null The type of the ownable. Must be “Individual”.
first_name String optional null
middle_name String optional null You can supply this for completeness, but it won’t show up on the app.
last_name String optional null
phone_mobile String optional null The individual’s cell phone number. It must be in the format (XXX) XXX-XXXX. This is the phone number that shows up on the personal information section (step 2) of the app.
email String optional null Must be in a valid email format.
ssn String optional null Must be in the format XXX-XX-XXXX.
birthdate String optional null Must be in the format YYYY-MM-DD.
gender String optional null Must be either “Male” or “Female”.
marital_status String optional null Must be “Single” or “Married”.
income Number optional 0 The individual’s annual income. Do not send commas or dollar signs. Only send a number, such as 1000000.00.
assets Number optional 0
liabilities Number optional 0
bankruptcy Boolean optional null Whether or not this individual has had a bankruptcy.
bankruptcy_type String optional null Must be null if bankruptcy is false. Valid options are: “Chapter 7”, “Chapter 11”, “Chapter 12”, “Chapter 13”, “Chapter 15”.
bankruptcy_discharge_date String optional null Must be null if bankruptcy is false. Must be in the format YYYY-MM-DD.

Address parameters

This section describes one entry in the addresses_attributes array.

Key Type Requiredness Default Description
address_type String required null Currently can only be “home”.
street_address String optional null The ownable’s street address, both name and number. For example, “1234 My Street”.
city String optional null
state String optional null The state’s two letter abbreviation, such as “CA” for California.
zip String optional null The 5 digit postal code. Must be in the format “XXXXX”.
country String optional null Currently we only support “United States”.
start_date String optional null Start date of when the ownable started living at this address. For the insured, this shows up on step 3 of Quote & Apply as the number of years lived at address. Must be in the format YYYY-MM-DD.

Driver’s License parameters

Key Type Requiredness Default Description
number String optional NULL The driver’s license number.
state String optional NULL The state’s two letter abbreviation, such as “CA” for California.

Getting Quotes

Endpoint

GET https://app.back9ins.com/api/v1/quotes

Sample request

{
  "domain": "example.org",
  "npn": "11111111",
  "quote": {
    "face_amount": 1000000,
    "gender": "Male",
    "birthdate": "1990-05-11",
    "state": "CA",
    "health": 5,
    "smoker": false,
    "product_category": "To Age 120"
  }
}

Send an HTTPS GET request to the above route along with the request body in order to retrieve an array of quotes:

Response format

{
  "quotes": [
    {
      "carrier": {
        "id": 82,
        "name": "Prudential Financial",
        "avatar": "https://s3-us-west-2.amazonaws.com/portal-pictures/prudential_qa_logo.png",
        "strife_disclosure": "Prudential Life Insurance Company, 2101 Welsh Road, Dresher, PA 19025-5000."
      },
      "product": {
        "id": 605,
        "name": "PruLife Universal Protector",
        "product_details": null
      },
      "premiums": {
        "12": 287.76
      },
      "health_class": "Preferred Plus Non-Tobacco"
    },
    {
      "carrier": {
        "id": 37,
        "name": "American General",
        "avatar": "https://s3-us-west-2.amazonaws.com/portal-pictures/FMAOLPFO.png",
        "strife_disclosure": "American General Life Insurance Company, 2727 A Allen Pkwy #B-F4, Houston, TX 77019-2107."
      },
      "product": {
        "id": 1913,
        "name": "Secure Lifetime GUL III",
        "product_details": null
      },
      "premiums": {
        "12": 307.59
      },
      "health_class": "Preferred Plus Non-Tobacco"
    }
  ]
}

If the request is successful, we will return quotes in an array under the top-level quotes key of the JSON object.

Quote format

Each entry in the quotes array will contain the following data:

Key Type Description
carrier Object
product Object
premiums Object An object describing all the possible premiums. It will consist of key-value pairs in which the keys are integer representations of the mode, and the values are the corresponding premiums. Currently we only return premiums for the monthly mode ("12").
health_class String The carrier’s verbiage for the health class returned.

Pre-filling Quote & Apply

You can use the data from the quotes to pre-fill your eApp with a selected quote (potentially chosen by the user). All you have to do is set the premium, mode, and product_id returned from the quote response.