> 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/cancellation.md).

# Cancellation

Replace the RentalCover cancel call with the Offers API preview and confirm cancellation flow.

On RentalCover, a single call cancels the booking. On the Offers API you can **preview the refund first**, then confirm. A single call still works if you don't need the preview. The booking is identified by its INS in the URL.

{% stepper %}
{% step %}

#### Preview the refund (optional)

Use the preview when the customer should see the refund before agreeing, or when an adjustment fee may apply. Nothing is cancelled yet.

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

```json
{ "CancelReason": "Customer trip has been cancelled" }
```

{% endcode %}
{% endtab %}

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

```json
{ "preview": true }
```

{% endcode %}

Response (trimmed):

```json
{
  "id": "XXXXX-XXXXX-INS",
  "quotes": [
    { "id": "{quote_id}", "price": 52.51, "refund_value": 52.51, "adjustment_fee": 0 }
  ],
  "total_refund": 52.51,
  "cancellation_id": "{cancellation_id}",
  "confirm_before": "2027-02-21T17:04:09Z"
}
```

{% endtab %}
{% endtabs %}

Show `total_refund` to the customer and keep the `cancellation_id`.
{% endstep %}

{% step %}

#### Confirm the cancellation

```http
POST /partners/{partner_code}/bookings/{booking_id}/confirm_cancellation/{cancellation_id}/
```

Send an `x-idempotency-key`. The booking moves to `CANCELLED`, and the response has the final `refund_value`, `adjustment_fee` and `total_refund`.

If `confirm_before` has passed, request a new preview.
{% endstep %}

{% step %}

#### Or cancel in one step

For automated cancellations, such as a rental cancelled by the supplier, skip the preview. The body is optional.

{% code title="POST /partners/{partner\_code}/bookings/{booking\_id}/cancel" %}

```json
{
  "quotes": [
    { "id": "{quote_id}", "reason_for_cancellation": "Customer no longer needs cover" }
  ]
}
```

{% endcode %}
{% endstep %}
{% endstepper %}

## Rules

* **Cancellation window.** The window and any grace period after pickup are set per integration, usually to match your current RentalCover terms. Send an accurate `pickup.date` with its offset at Create Offer.
* **Outside the window** the call returns an error. Show the customer a message instead of retrying.
* **Already cancelled?** A cancel call with a new idempotency key on a cancelled booking returns an error. Check with [Get Booking](https://partner-docs.covergenius.com/offers/guides/migrating-from-rentalcover/track-bookings.md) and treat `CANCELLED` as success.
* **Not sure it worked?** After a timeout, call Get Booking. If the status is still `CONFIRMED`, retry with the same idempotency key.
* **Refunds under single payment.** Refund the customer `refund_value`, not the full premium, whenever an `adjustment_fee` applies. Under dual payment, Cover Genius refunds the card.

## Rebooking

If your platform changes a booking by cancelling it and creating a new one, mark the new booking as a rebooking:

1. Cancel the existing booking with `"reason_for_cancellation": "Cancel and rebook"`.
2. Create a new offer with these extra `partner.metadata` fields:

   ```json
   "metadata": {
     "rebooking": true,
     "rebooking_prior_id": "XXXXX-XXXXX-INS"
   }
   ```
3. Confirm the new offer. It gets its own INS, so store it and link it to the old one.

`rebooking` and `rebooking_prior_id` are free-form metadata. They are stored with the booking as a reference to the cancelled one, and don't change how the new booking is priced or processed.

{% hint style="info" %}
For changes to rental dates or customer details, prefer [modification](https://partner-docs.covergenius.com/offers/guides/migrating-from-rentalcover/modification.md). The booking keeps its INS, so you reconcile one booking instead of two.
{% endhint %}

## Cancellations you didn't make

Customers can cancel from their XCover account, and Cover Genius can also cancel a booking. In both cases you receive a `BOOKING_CANCELLED` [webhook](https://partner-docs.covergenius.com/offers/guides/migrating-from-rentalcover/track-bookings.md).

{% hint style="warning" %}
Don't call Cancel for a booking you learned about through `BOOKING_CANCELLED`. It is already cancelled. Under single payment, read the refund amount with Get Booking.
{% endhint %}

## See also

* [Cancel Booking](https://partner-docs.covergenius.com/offers/guides/purchase-workflow-overview/cancel-booking.md)
* [Webhooks](https://partner-docs.covergenius.com/offers/api/webhooks.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/cancellation.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.
