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

# Acquiring Insurance Quotes

> Merchant can use the Quote APIs to explore different competitive pricing for different products offered by our providers.

## Overview

The Quotes APIs enables businesses to request and retrieve insurance quotes dynamically
based on customer and product details. This section details how to request a quote and capture purchase intent while emphasizing the `additional_information` field, which varies based on the `product_type`.

### Request for Insurance Quote

Submit a request to generate insurance quotes for a specified product type and customer details.

**Endpoint**

* **URL:** `/api/v1/quotes/`
* **Method:** `POST`

```bash theme={null}
curl --request POST \
  --url https://dev.superpool.unyte.africa/api/v1/quotes \
  ...
```

### Request Body

| Parameter              | Type     | Required | Description                                                  |
| ---------------------- | -------- | -------- | ------------------------------------------------------------ |
| `customer_metadata`    | `object` | Yes      | Customer details including age, location, and personal data. |
| `insurance_details`    | `object` | Yes      | Contains product type, name, and additional metadata.        |
| `coverage_preferences` | `object` | No       | Custom coverage options such as risk preferences.            |

<Card>
  <Warning>
    P.S: Important Field: `additional_information`
  </Warning>

  <ParamField path="additional_information" type="object">
    Captures additional product-specific meta-information based on the provided product type [Learn more about this field](/api-reference/quotes#request-a-quote-for-an-insurance-policy-or-product#body-insurance-details-additional-information).
  </ParamField>

  The **`additional_information`** field, within the `insurance_details` object, dynamically adapts to the selected **product\_type** and must be structured according to the corresponding serializer.
</Card>

<Card>
  <Warning>
    P.S: Important Field: `insurance_options`
  </Warning>

  <ParamField path="insurance_options" type="string">
    The `insurance_option` field is an Enum choices field, as seen on our API Reference for Quote Request. For more detailed information, please see [Understanding the Insurance Option Field]()
  </ParamField>

  The **`insurance_options`** field, within the `insurance_details` object, is a `choice` from an Enum class that streamlines, policy choice from our 'featured' policies. In a sceneraio where, default
  flow of getting the insurance quote is needed, please select the string option `Other` and fire off your request.
</Card>

## Understanding `additional_information` for Different Product Types

The `additional_information` field contains nested objects relevant to the selected insurance product. This allows us to effectively capture just enough information for our providers and offer the best services for your customers. Below are the expected structures for each product type:

<Tabs>
  <Tab title="Health Insurance">
    ```json theme={null}
    {
      "health_condition": "Good",
      "pre_existing_conditions": ["Diabetes", "Hypertension"],
      "age": 28,
    }
    ```

    **Fields:**

    | Field                     | Type     | Required | Description                                                         |
    | ------------------------- | -------- | -------- | ------------------------------------------------------------------- |
    | `health_condition`        | `string` | Yes      | Health condition of the applicant                                   |
    | `pre_existing_conditions` | `list`   | No       | Customer or HMO-provided, known chronic illnesses affecting patient |
    | `age`                     | `number` | Yes      | Applicant's age                                                     |
  </Tab>

  <Tab title="Auto Insurance">
    ```json theme={null}
    {
      "vehicle_make": "Toyota",
      "vehicle_model": "Camry",
      "manufacture_year": 2019,
      "vehicle_value": 15000,
      "vehicle_value": "20000.00",
      "vehicle_usage": "Private",
      "vehicle_category": "Saloon",
      "insurance_options": "Comprehensive"
    }
    ```

    **Fields:**

    | Field               | Type     | Required | Description                                                                          |
    | ------------------- | -------- | -------- | ------------------------------------------------------------------------------------ |
    | `vehicle_type`      | `string` | Yes      | Type of vehicle e.g Car or Bike                                                      |
    | `vehicle_make`      | `string` | No       | Car manufacturer                                                                     |
    | `vehicle_model`     | `string` | No       | Specific model name                                                                  |
    | `manufacture_year`  | `number` | Yes      | Year of production                                                                   |
    | `vehicle_value`     | `number` | Yes      | Estimated market value                                                               |
    | `vehicle_usage`     | `string` | Yes      | Mode of use of this vehicle, e.g, Private or Commerical                              |
    | \`vehicle\_category | `string` | No       | Category in-which vehicle insured can be classified into e.g Saloon, SUV, Truck, etc |
    | `insurance_options` | `string` | No       | Available insurance product options that aligns with customer needs                  |
  </Tab>

  <Tab title="Travel Insurance">
    ```json theme={null}
    {
      "destination": "France",
      "travel_purpose": "Business",
      "trip_type": "one_way",
      "departure_date": "2024-11-01",
      "return_date": "2025-03-07",
      "frequent_traveler": true,
      "insurance_options": "Europe Schegen"
    }
    ```

    **Fields:**

    | Field                  | Type     | Required | Description                                 |
    | ---------------------- | -------- | -------- | ------------------------------------------- |
    | `destination`          | `string` | Yes      | Country of visit                            |
    | `departure_date`       | `date`   | Yes      | Estimated date of departure                 |
    | `return_date`          | `date`   | Yes      | Estimated date of return                    |
    | `trip_type`            | `string` | No       | Type of trip such as One-way or Round trip  |
    | `travel_purpose`       | `string` | No       | Purpose of travel (e.g., leisure, business) |
    | `insurance_options`    | `string` | No       | Policy-specific product option as provided  |
    | `international_flight` | `bool`   | No       | Flight type, Local or International         |
  </Tab>

  <Tab title="Personal Accident Insurance">
    ```json theme={null}
    {
      "occupation": "Construction Worker",
      "risk_level": "High",
    }
    ```

    **Fields:**

    | Field        | Type     | Description                       |
    | ------------ | -------- | --------------------------------- |
    | `occupation` | (string) | Profession of insured individual  |
    | `risk_level` | (string) | Risk category based on occupation |
  </Tab>

  <Tab title="Home Insurance">
    ```json theme={null}
    {
      "property_value": 500000,
      "building_type": "Apartment",
      "location": "Urban",
      "fire_protection": true
    }
    ```

    **Fields:**

    | Field                    | Type      | Required | Description                                                                    |
    | ------------------------ | --------- | -------- | ------------------------------------------------------------------------------ |
    | `property_value`         | `number`  | Yes      | Market value of the home                                                       |
    | `property_type`          | `string`  | Yes      | Type of residence (e.g., apartment, villa)                                     |
    | `stationary_items_value` | `number`  | Yes      | Estimated value of stationary (immobile) items in the property                 |
    | `mobile_items_value`     | `number`  | Yes      | Estimated value of mobile items in the property                                |
    | `location`               | `string`  | Yes      | Risk category based on area (urban, rural)                                     |
    | `fire_protection`        | `boolean` | No       | Whether fire safety measures are installed                                     |
    | `security_details`       | `object`  | No       | Customer-provided information on building security as captured by the Merchant |
  </Tab>

  <Tab title="Device Insurance">
    ```json theme={null}
    {
      "device_brand": "Apple",
      "device_model": "iPhone 13",
      "purchase_date": "2023-01-10",
      "device_value": 1200
    }
    ```

    **Fields:**

    | Field                | Type     | Required | Description                                                                                      |
    | -------------------- | -------- | -------- | ------------------------------------------------------------------------------------------------ |
    | `gadget_type`        | `string` | Yes      | Type of the device to be insured e.g Smartphone, Laptop, etc                                     |
    | `gadget_value`       | `number` | Yes      | Current market value of the device                                                               |
    | `gadget_information` | `object` | No       | Customer-provided information about the device e.g could contain device\_brand, etc              |
    | `insurance_options`  | `string` | Yes      | Preferred insurance options as provided by our providers e.g SmartCover Insurance, POS Insurance |
    | `usage_history`      | `object` | No       | Merchant-captured information about the device provided in JSON                                  |
  </Tab>

  <Tab title="Cargo/Shipment Insurance">
    ```json theme={null}
    {
      "shipment_value": 50000,
      "shipment_type": "international",
      "origin": "China",
      "destination": "USA",
      "transport_mode": "Air",
      "shipment_carrier": "XYZ Couriers",
      "shipment_carrier_details": {
         "tracking_number": "NG987654321",
         "service_type": "Air Freight"
      },
      "exchange_rate": "750.00"
    }
    ```

    **Fields:**

    | Field                      | Type     | Required     | Description                                                     |
    | -------------------------- | -------- | ------------ | --------------------------------------------------------------- |
    | `shipment_value`           | `number` | Yes          | Total value of goods                                            |
    | `origin`                   | `string` | Yes          | Country of shipment origin                                      |
    | `destination`              | `string` | Yes          | Delivery country                                                |
    | `transport_mode`           | `string` | No           | Shipping method (air, sea, land)                                |
    | `exchange_rate`            | `number` | (Read below) | Exchange rate as at the time of request                         |
    | `shipment_carrier`         | `string` | Yes          | Carrier company handling the shipment                           |
    | `shipment_carrier_details` | `object` | No           | Additional information about the shipment carrier, if available |
  </Tab>
</Tabs>

## Capturing Purchase Intent

Creates a new **purchase intent** for a selected insurance quote.

### Endpoint

* **URL:** `/api/v1/quotes/<quote_code>/intent/capture/`
* **Method:** `POST`

### Request Body

| Parameter           | Type     | Required | Description                                                                           |
| ------------------- | -------- | -------- | ------------------------------------------------------------------------------------- |
| `tenure`            | `number` | Yes      | Unique identifier of the selected quote.                                              |
| `customer_metadata` | `object` | Yes      | Captures essential personal information of the customer as required by our providers. |

### Sample Request

```json RequestExample [expandable] theme={null}
{
    "tenure": 5,
    "customer_metadata": {
      "first_name": "Chukwuemeka",
      "last_name": "Okoro",
      "email": "chukwuemeka.okoro@example.com",
      "phone": "08012345678",
      "residential_address": {
        "house_number": "12",
        "street": "Adeola Odeku Street",
        "city": "Lagos",
        "state": "Lagos",
        "postal_code": "101241",
        "country": "Nigeria"
      },
      "date_of_birth": "1985-03-25",
      "customer_gender": "M",
      "occupation": "Civil Engineer",
      "identity_card_img": "https://www.example.com/back",
      "utility_bill_img": "https://www.example.com/back",
      "identity_card_type": "driver_license",
      "identity_card_number": "ARES0n0Fzews",
      "identity_card_expiry_date": "2028-06-15"
    }
}
```

### Sample Response

```json theme={null}
{
  "intent_id": "pi789",
  "product": "SafeGuard Life Insurance",
  "selected_tenure": {
    "tenure": 5
  },
  "total_amount": 50000.00
}
```
