# Quote Setup

API specifications for the two Quote Setup endpoints which can be optionally used to assist with the configuration of quotes and/or integration of the API.

# Providers

Returns a list of the [insurance providers](https://docs.blackfin.tools/books/quoteengineapi/page/supported-providers "Supported Providers") supported by the API, along with the benefits and products that they offer. This data will only change a few times per year, depending on any renaming or addition/removal of products by the insurers.

### Request

---

- Type: **`GET`**
- Path: **`/providers`**

---

#### Authentication

A `userToken` API key is required to authenticate the request source. This should be included in the header of the request.See [Authentication](https://docs.blackfin.tools/books/quoteengineapi/page/authentication "Authentication") for more details.

### Response

---

#### Success 


<p class="callout success">**200**: Success</p>

##### JSON Schema

```
{
  "type": "object",
  "properties": {
    "providerId": {
      "type": "integer",
      "description": "The API's internal ID for the current provider. <br /><br />\r\nThis ID is used within the payload of the request of the `/quote` endpoint when requesting the calculation of a premium from this provider.",
      "format": "int32"
    },
    "providerName": {
      "type": "string",
      "description": "The display name of the current provider",
      "nullable": true
    },
    "hexColor": {
      "type": "string",
      "description": "A hex color value representing the dominant colour from the provider's logo that can be incorporated into the design of the UI if desired.",
      "nullable": true
    },
    "logoUrl": {
      "type": "string",
      "description": "The URL of the provider's logo image (hosted by BlackFin) that can be displayed with the UI if desired.",
      "nullable": true
    },
    "benefits": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "benefitId": {
            "type": "integer",
            "description": "The API's internal ID for the current benefit. <br /><br />\r\nThis ID is used within the payload of the request of the `/quote` endpoint when requesting the calculation of a premium for this benefit.",
            "format": "int32"
          },
          "benefitName": {
            "type": "string",
            "description": "The display name of the current benefit",
            "nullable": true
          },
          "products": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "productId": {
                  "type": "integer",
                  "description": "The API's internal ID for the current product. <br /><br />\r\nThis ID is used within the payload of the request of the '/quote' endpoint when requesting the calculation of a premium for this product.\"",
                  "format": "int32"
                },
                "productName": {
                  "type": "string",
                  "description": "The display name of the current product",
                  "nullable": true
                }
              },
              "additionalProperties": false
            },
            "description": "An array of one or more objects detailing the product(s) which the current provider offers under this benefit.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "description": "An array of benefit objects detailing which benefits the current provider offers.",
      "nullable": true
    }
  },
  "additionalProperties": false
}
```

##### Examples

<details id="bkmrk-example-1%3A-label-%C2%A0"><summary>Success Response</summary>

```json
{
  "providerId": 0,
  "providerName": "string",
  "hexColor": "string",
  "logoUrl": "string",
  "benefits": [
    {
      "benefitId": 0,
      "benefitName": "string",
      "products": [
        {
          "productId": 0,
          "productName": "string"
        }
      ]
    }
  ]
}
```

</details>---

#### Error

<p class="callout danger">**403**: `userToken` is invalid or no longer valid</p>

# QuoteConfig

Returns a list of input parameters that are used when configuring the different benefits within the [/quote calculation request](https://docs.blackfin.tools/books/quoteengineapi/page/quote-request "Quote"). The returned input parameters are defined by their `type` (eg. dropdown list) and their accepted option `values`, and are grouped by the benefits they are relevant for. This data could be used to render UI elements for data capture during the configuration of a quote.

### Request

---

- Type: **`GET`**
- Path: **`/quoteConfig`**

---

#### Authentication

A `userToken` API key is required to authenticate the request source. This should be included in the header of the request. See [Authentication](https://docs.blackfin.tools/books/quoteengineapi/page/authentication "Authentication") for more details.

### Response

---

#### Success 


<p class="callout success">**200**: Success</p>

##### JSON Schema

```json
{
  "type": "object",
  "properties": {
    "quoteConfig": {
      "type": "object",
      "properties": {
        "benefits": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "benefitId": {
                "type": "integer",
                "description": "The API's internal ID for the current benefit. <br /><br />\r\nThis ID is used within the payload of the request of the `/quote` endpoint when requesting the calculation of a premium for this benefit.",
                "format": "int32"
              },
              "benefitName": {
                "type": "string",
                "description": "The display name of the current benefit",
                "nullable": true
              },
              "inputs": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "inputId": {
                      "type": "string",
                      "description": "The underlying name of the input. Each of these values matches to an equivalent property in the payload schema of the `/quote` request.\r\nFor example \"calcPeriod\" or \"coverAmount\"",
                      "nullable": true
                    },
                    "inputLabel": {
                      "type": "string",
                      "description": "The human-friendly name of the input. This can be displayed as the field label in the UI.",
                      "nullable": true
                    },
                    "inputType": {
                      "type": "string",
                      "description": "Defines the type of field that could be used to capture the input. The possible values are: <br /><br />\r\n`checkbox` – a true/false boolean input <br />\r\n`currency` – a number representing a monetary value in NZD <br />\r\n`dropdown` – an input with pre-defined set of options(see below) <br />\r\n`number` – a quantity of something(non-currency)",
                      "nullable": true
                    },
                    "inputOptions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string",
                            "description": "The human-friendly name of the option which can be displayed in the dropdown in the UI.",
                            "nullable": true
                          },
                          "value": {
                            "type": "string",
                            "description": "The underlying value of the option. This value (for the chosen option) should be included in the `/quote` request payload",
                            "nullable": true
                          }
                        },
                        "additionalProperties": false
                      },
                      "description": "An array of pre-defined values for `dropdown` type inputs",
                      "nullable": true
                    }
                  },
                  "additionalProperties": false
                },
                "description": "An array of objects detailing the data capture inputs that are relevant for the current benefit. \r\nThe list of inputs varies for each type of benefit, although there is some crossover between most benefits.",
                "nullable": true
              }
            },
            "additionalProperties": false
          },
          "description": "An array of insurance benefits which are supported for quoting via the Quote Engine API.",
          "nullable": true
        }
      },
      "additionalProperties": false
    }
  },
  "additionalProperties": false
}
```


##### Examples

<details id="bkmrk-example-1%3A-label-%C2%A0"><summary>Success Response</summary>

```json
{
  "quoteConfig": {
    "benefits": [
      {
        "benefitId": 0,
        "benefitName": "string",
        "inputs": [
          {
            "inputId": "string",
            "inputLabel": "string",
            "inputType": "string",
            "inputOptions": [
              {
                "name": "string",
                "value": "string"
              }
            ]
          }
        ]
      }
    ]
  }
}
```

</details>---

#### Error

<p class="callout danger">**403**: `userToken` is invalid or no longer valid</p>