> For the complete documentation index, see [llms.txt](https://partner-docs.covergenius.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://partner-docs.covergenius.com/offers/guides/migrating-from-rentalcover/modification.md).

# Modification

Replace RentalCover updateCustomer and update calls with in-place booking modification on the Offers API.

On RentalCover you change customer details with `updateCustomer`, and many trip changes mean cancelling and repurchasing. On the Offers API you **update the booking in place**. The INS doesn't change, so one booking ID covers the booking for its whole life.

{% stepper %}
{% step %}

#### Check what can change

Read the booking with [Get Booking](https://partner-docs.covergenius.com/offers/guides/migrating-from-rentalcover/track-bookings.md) before you offer an edit:

* `policyholder.allow_updates` is `true` when the booking can be modified.
* `policyholder.fields_allowed_to_update` lists the fields you may change. Don't show an edit option for anything not listed.

Residency (`country`), `age` and `secondary_email` can't be changed through the API. If the residency changes, create a new offer.
{% endstep %}

{% step %}

#### Update customer details

Send policyholder changes in the top-level `policyholder` object, and changes to the insured person in `quotes[].update_fields`. Send an `x-idempotency-key`.

{% tabs %}
{% tab title="Before: RentalCover" %}
{% code title="POST /insurances/updateCustomer" %}

```json
{
  "Email": "alex.example@email.com",
  "FirstName": "Alexandra",
  "LastName": "Example"
}
```

{% endcode %}
{% endtab %}

{% tab title="After: XCover Offers" %}
{% code title="PATCH /partners/{partner\_code}/bookings/{booking\_id}/" %}

```json
{
  "quotes": [
    {
      "id": "{quote_id}",
      "update_fields": {
        "insured": [
          { "first_name": "Alexandra", "last_name": "Example", "email": "alex.example@email.com" }
        ]
      }
    }
  ],
  "policyholder": { "first_name": "Alexandra" }
}
```

{% endcode %}
{% endtab %}
{% endtabs %}

The response is the full booking. `status` stays `CONFIRMED`, and `price_diff` is `0` for changes that don't affect the price.

{% hint style="danger" %}
**`update_fields` replaces, `policyholder` merges**

* Each key inside `update_fields` **replaces the stored value in full**. That applies to arrays such as `insured[]` and to nested objects such as `pickup`. Send every element and every field you want to keep. If you leave out `email`, it is removed.
* The top-level `policyholder` object is **merged**. Send only the keys you change.
  {% endhint %}
  {% endstep %}

{% step %}

#### Price-affecting changes

Changes that affect the price, such as new rental dates, take two calls, so the customer can see the new price first.

1. **Quote the change.** The booking isn't changed yet. The response gives the new price, the `price_diff` and an `update_id`.

   ```http
   PATCH /partners/{partner_code}/bookings/{booking_id}/quote_for_update
   ```
2. **Confirm the change** once the customer accepts. The booking is updated in place with the same INS.

   ```http
   POST /partners/{partner_code}/bookings/{booking_id}/confirm_update/{update_id}/
   ```

Send the new values in `quotes[].update_fields`, in the same structure as above. The field names for date changes are agreed with your CSE during scoping. Don't reuse an `update_id` for a different change.

Who collects the difference depends on your payment model. Under single payment, you collect an increase or refund a reduction. Under dual payment, Cover Genius does.
{% endstep %}
{% endstepper %}

## Changes made by the customer

Depending on your integration, customers can also modify a booking from their XCover account. Subscribe to the optional `BOOKING_UPDATED` [webhook](https://partner-docs.covergenius.com/offers/guides/migrating-from-rentalcover/track-bookings.md) to stay in sync. When it arrives, read the booking with Get Booking and update your record. Don't apply the same change again through the API.

<details>

<summary>Full modification field mapping</summary>

**Request**

| RentalCover              | XCover Offers                               | Notes                                      |
| ------------------------ | ------------------------------------------- | ------------------------------------------ |
| `Email` (booking lookup) | `{booking_id}` in the URL                   | The INS                                    |
| —                        | `quotes[].id`                               | Quote to update                            |
| —                        | `quotes[].update_fields`                    | Keys mirror the quote fields being changed |
| —                        | `quotes[].update_fields.insured[]`          | Replaces the stored array in full          |
| `FirstName`, `LastName`  | `policyholder.first_name`, `last_name`      | Merged                                     |
| `NewEmail`               | `policyholder.email`                        |                                            |
| `OtherEmail`             | `policyholder.secondary_email`              | Can't be changed through the API           |
| `DateOfBirth`            | `policyholder.birth_date`                   |                                            |
| `CustomerAge`            | `policyholder.age`                          | Can't be changed through the API           |
| `CompanyName`            | `policyholder.company`                      |                                            |
| `Address1`, `City`       | `policyholder.address1`, `address2`, `city` |                                            |
| `Country`                | —                                           | Residency can't be modified                |

**Response**

| RentalCover                              | XCover Offers                                                |
| ---------------------------------------- | ------------------------------------------------------------ |
| —                                        | `update_id` (from quote for update)                          |
| `TotalAmountOutstanding`, `RefundAmount` | `quotes[].price_diff`, `total_price_diff` (and `_formatted`) |
| `Modified`                               | `updated_at`                                                 |

</details>

## See also

* [Modify Booking](https://partner-docs.covergenius.com/offers/guides/purchase-workflow-overview/modify-booking.md)
* [Policy Management](https://partner-docs.covergenius.com/offers/services/xcover/policy-management.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://partner-docs.covergenius.com/offers/guides/migrating-from-rentalcover/modification.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
