# Renewal Workflow

For certain policy types (eg. Warranty/Product Insurance/Renters) a renewal period may be established for ongoing protection.\
Eg. A laptop warranty with an annual renewal cycle. Or a renters insurance product

Before the policy end date the customer can be sent a notification that their policy is expiring and depending on the settings, the policy renewals will be automatically proceeded or triggered by API calls.

An example of the API triggered renewal workflow is illustrated below.

<picture><source srcset="/files/Suhqzdw3yDVRL0f9twq3" media="(prefers-color-scheme: dark)"><img src="/files/3LrUuocthArl7tXwXSQD" alt=""></picture>

## Quote for Renewal

<mark style="color:purple;">`PATCH`</mark> `https://api.xcover.com/x/partners/:partner_id/renewals/:quote_package_id/quote_for_renewal/`

Generates an updated booking with a renewal price that should be charged to the customer. It also contains any other changes to benefits/limits or policy wording that may have changed since the first policy was purchased.\
\
Request contains no payload.

#### Path Parameters

| Name               | Type   | Description            |
| ------------------ | ------ | ---------------------- |
| partner\_id        | string | Unique Partner Code    |
| quote\_package\_id | string | Quote Package ID (INS) |

#### Headers

| Name          | Type   | Description      |
| ------------- | ------ | ---------------- |
| Content-Type  | string | application/json |
| Date          | string | Current Datetime |
| Authorization | string | HMAC Signature   |
| X-API-Key     | string | API Key          |

{% tabs %}
{% tab title="200 A successful request" %}

```
{
    "renewal_id": "xeJsp-UcMlR-FXv0U-UPD",
    "quotes": [
        {
            "id": "25fb6ea3-3236-4743-b077-ce77b8631fe0",
            "policy_start_date": "2021-07-27T13:25:00+00:00",
            "policy_end_date": "2021-08-26T13:25:00+00:00",
            "status": "RECEIVED",
            "price": 16.0,
            "price_formatted": "US$16.00",
            "policy": {
                "policy_type": "renters_insurance",
                "policy_name": "Renters Insurance",
                "policy_code": "RE01RHI",
                "policy_version": "cca6cb3a-5cdf-412b-959a-9911e30e7dd1",
                "category": null,
                "content": {},
                "underwriter": {
                    "disclaimer": "This plan is arranged by XCover.com and underwritten by Markel International Insurance Company Limited",
                    "name": "Markel International Insurance Company Limited"
                },
                "claim_selector_id": "",
                "show_benefits": true
            },
            "insured": [
                {
                }
            ],
            "tax": {
                "total_tax": 0.0,
                "total_amount_without_tax": 16.0,
                "total_tax_formatted": "US$0.00",
                "total_amount_without_tax_formatted": "US$16.00",
                "taxes": [
                ]
            },
            "duration": "30 00:00:00",
            "benefits": [
                {}
            ],
            "commission": {
            },
            "created_at": "2021-06-22T16:04:55.416289Z",
            "confirmed_at": null,
            "updated_at": "2021-06-22T16:04:55.416306Z",
            "cancelled_at": null,
            "is_renewable": false,
            "is_pricebeat_enabled": null,
            "cover_amount": null,
            "cover_amount_formatted": null,
            "pds_url": "https://www.xcover.com/en-us/pds/4XNE7-B8YGP-INS?policy_type=renters_insurance_v1",
            "attachments": [],
            "files": [],
            "extra_fields": {
            },
            "surcharge": {
                "total_amount": null,
                "total_amount_formatted": null,
                "surcharges": null
            },
            "discount_price": 16.0,
            "discount_price_formatted": "US$16.00",
            "discount_amount": 0.0,
            "discount_amount_formatted": "US$0.00"
}
```

{% endtab %}
{% endtabs %}

## Confirm Renewal

To confirm a renewal once payment has been collected a request to the following endpoint needs to be made.

## Confirm Renewal

<mark style="color:green;">`POST`</mark> `https://api.xcover.com/x/partners/:partner_id/renewals/:quote_package_id/confirm/:renewal_id/`

Confirms the renewal and issues the updated policy to the customer.

#### Path Parameters

| Name               | Type   | Description                |
| ------------------ | ------ | -------------------------- |
| partner\_id        | string | Unique Partner ID          |
| quote\_package\_id | string | Quote Package ID (INS)     |
| renewal\_id        | string | ID referencing the renewal |

#### Headers

| Name          | Type   | Description      |
| ------------- | ------ | ---------------- |
| Content-Type  | string | application/json |
| Date          | string | Current Datetime |
| Authorization | string | HMAC Signature   |
| X-API-Key     | string | API Key          |

#### Request Body

| Name                                                  | Type   | Description                         |
| ----------------------------------------------------- | ------ | ----------------------------------- |
| id<mark style="color:red;">\*</mark>                  | String | The policy quote requires updating. |
| policy\_start\_date<mark style="color:red;">\*</mark> | String | The new policy start date           |

{% tabs %}
{% tab title="200 " %}

```
{
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Request Payload" %}

```javascript
{
    "quotes": [
        {
            "id": "{{quote_1_id}}",
            "policy_start_date": "{{policy_start_date}}",
            "insured": [
                {
                    ...
                }
            ]
        }
    ]
}
```

{% endtab %}
{% endtabs %}


---

# 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.covergenius.com/xcover/renewal.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.
