# Quote

## Quote object

| Name                   | Type    | Description                                       |
| ---------------------- | ------- | ------------------------------------------------- |
| token                  | String  | Generated quote token.                            |
| gross\_payment\_amount | Integer | Gross payment amount calculated from the pricing. |
| extra\_data            | Object  | Object with extra data provided from the pricing. |

<details>

<summary>Quote object example</summary>

```json
{
    "token": "<QUOTE-TOKEN>",
    "gross_payment_amount": 275000,
    "extra_data": {
        "gross_premium": 275000,
        "premium_tax": 25000,
        "net_premium": 250000,
        "tax_rate": 0.1
    }
}
```

</details>

## Create a quote

## Create a quote

<mark style="color:green;">`POST`</mark> `https://api.qa-u.eu1.kaskoqa.com/quotes`

#### Query Parameters

| Name                                  | Type   | Description |
| ------------------------------------- | ------ | ----------- |
| key<mark style="color:red;">\*</mark> | String | Public key  |

#### Headers

| Name                                     | Type   | Description                   |
| ---------------------------------------- | ------ | ----------------------------- |
| Accept<mark style="color:red;">\*</mark> | String | application/vnd.kasko.v3+json |

#### Request Body

| Name                                                     | Type   | Description                                                                                                     |
| -------------------------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------- |
| item\_id<mark style="color:red;">\*</mark>               | String | Item ID                                                                                                         |
| subscription\_plan\_id<mark style="color:red;">\*</mark> | String | Subscription plan ID                                                                                            |
| integration\_id<mark style="color:red;">\*</mark>        | String | Integration ID                                                                                                  |
| integration\_version\_id                                 | String | Integration version ID. Can be used instead of `live_integration` parameter to indicate specific version to use |
| product\_version\_id                                     | String | Product version ID. Can be used instead of `live_product` parameter to indicate specific version to use         |
| data<mark style="color:red;">\*</mark>                   | JSON   | Product-specific quote data fields                                                                              |
| live\_integration                                        | String | Indicates whether to load most recent published or unpublished integration                                      |
| live\_integration                                        | String | Indicates whether to load most recent published or unpublished product                                          |

{% tabs %}
{% tab title="200: OK Successful quote request" %}

```json
{
    "token": "<QUOTE-TOKEN>",
    "gross_payment_amount": 0,
    "extra_data": {
        "gross_premium": 0,
        "premium_tax": 0,
        "net_premium": 0,
        "tax_rate": 0.1
    }
}
```

{% endtab %}

{% tab title="400: Bad Request Data validation failed" %}

```json
{
    "status": "Bad Request",
    "message": "Data validation failed.",
    "errors": [
    ...
        {
            "code": "invalid_value",
            "field": "invalid_field_name"
        }
    ...
    ]

```

{% endtab %}

{% tab title="400: Bad Request Bad Request" %}

<pre class="language-json"><code class="lang-json"><strong>{
</strong>    "status": "Bad Request",
    "message": "Brief description"
}
</code></pre>

{% endtab %}

{% tab title="404: Not Found Resource not found" %}
This response is returned in case any of the provided resources such as the integration, subscription plan or pricing logic cannot be located within the platform.

Some examples of such cases are:

```json
{
    "status": "Not Found",
    "message": "Subscription plan with id - pp_a6c37bc94f56cafaa7fcc02d77111 not found."
}
```

```json
{
    "status": "Not Found",
    "message": "Integration - in_e2b0a5a90e0595939c2b1978e5ccf product - ins_97980026870abce8b812668b2d11 not found."
}
```

{% endtab %}

{% tab title="409: Conflict Conflict" %}
This response indicates that a conflict condition is met. In such cases, during the execution of the quote request, pricing calculation logic creation is in process.

```json
{
    "status": "Conflict",
    "message": "Pricing calculation creation is in progress."
}
```

{% endtab %}

{% tab title="422: Unprocessable Entity Knockout condition met" %}
This response indicates that the quote calculation resulted in knockout condition.

```json
{
    "status": "Unprocessable Entity",
    "message": "knockout"
}
```

{% endtab %}

{% tab title="503: Service Unavailable Service unavailable" %}
This response indicates that quote calculation failed and server cannot handle the request. In such cases either the third party quote integration execution or the calculator client failed execution.

{% endtab %}
{% endtabs %}

<details>

<summary>Example request</summary>

```
curl --location 'https://api.eu1.kaskocloud.com/quotes?key=pk_test_2jngq6d7GRmxQ58w0yVKW3PBrJXbEvoM' \
--header 'Accept: application/vnd.kasko.v3+json' \
--header 'Content-Type: application/json' \
--data '{
  "data": {
    "insured_sum": 10000
  },
  "item_id": "ins_97980026870abce8b812668b2d09",
  "subscription_plan_id": "pp_a6c37bc94f56cafaa7fcc02d771a0",
  "integration_id": "in_e2b0a5a90e0595939c2b1978e5ccf",
    "live_product": "false",
    "live_integration": "false",
  "key": "pk_test_2jngq6d7GRmxQ58w0yVKW3PBrJXbEvoM"
}'
```

</details>


---

# 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://docs.kasko.io/kasko-api-documentation/rest-api/resources/quote.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.
