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

# Track bookings

Replace RentalCover status, list and invoice calls with Get Booking, List Bookings, webhooks and the Partner Portal.

RentalCover lets you check a booking's status and list purchased or cancelled policies. On the Offers API you look one booking up with **Get Booking**, list and filter bookings with **List Bookings**, and receive **webhooks** for changes made outside your platform. Invoices are in the Partner Portal.

{% stepper %}
{% step %}

#### Look up a booking

Look the booking up by its INS, or by your `partner_transaction_id`. Send no body.

{% tabs %}
{% tab title="Before: RentalCover" %}

```http
GET /insurances/status/{reference}
```

{% endtab %}

{% tab title="After: XCover Offers" %}

```http
GET /partners/{partner_code}/bookings/{booking_id}
```

{% endtab %}
{% endtabs %}

The response is the same booking object Confirm returns: `status` (such as `PENDING_PAYMENT`, `CONFIRMED` or `CANCELLED`), `quotes[]`, prices, document links and `policyholder.fields_allowed_to_update`.
{% endstep %}

{% step %}

#### Subscribe to webhooks

Webhooks replace RentalCover's cancellation notification. Give your CSE your listener URL, a webhook API key and secret, and the events you want. Ask them to enable delivery for both test and live bookings.

{% hint style="warning" %}
Verification changes. RentalCover signs the request body and `Timestamp` header into `X-Signature`. The Offers API signs the `Date` header into `Authorization`, and the payload is `{"event": ..., "payload": ...}`. Update your listener before you switch.
{% endhint %}

| Event               | Required? | When it fires                                                                 |
| ------------------- | --------- | ----------------------------------------------------------------------------- |
| `BOOKING_CANCELLED` | Yes       | The customer or Cover Genius cancelled a booking                              |
| `BOOKING_UPDATED`   | Optional  | The booking changed outside your API calls, such as in the customer's account |

To handle a webhook:

1. **Verify it.** Check `X-Api-Key`, then compare the `Authorization` header with an HMAC-SHA256 of `date: {Date}` using your webhook secret. Use a timing-safe comparison, and reject requests whose `Date` is far from your clock.
2. **Return a `2xx` quickly.** Cover Genius retries up to 3 times on an error response or a failed connection. Do slow work, such as refunds, afterwards.
3. **Refresh from the API.** Call Get Booking for the current state rather than relying on the payload alone.
4. **Be idempotent.** Key processing on the INS and the event, and treat a repeat as success.

{% hint style="info" %}
The webhook secret is the one you give Cover Genius. It is separate from the credentials you use to sign your own API requests.
{% endhint %}

See [Webhooks](https://partner-docs.covergenius.com/offers/api/webhooks.md) for the payloads and verification code.
{% endstep %}

{% step %}

#### List bookings

List Bookings replaces `getAllPurchasedPolicies` and `getAllCancelledPolicies`. Filter by `status` to get confirmed or cancelled bookings, and narrow by date.

{% tabs %}
{% tab title="Before: RentalCover" %}

```http
POST /insurances/getAllPurchasedPolicies
POST /insurances/getAllCancelledPolicies
```

{% endtab %}

{% tab title="After: XCover Offers" %}
{% code overflow="wrap" %}

```http
GET /partners/{partner_code}/bookings/?status=CONFIRMED&created_after=2027-03-01T00:00:00Z&created_before=2027-04-01T00:00:00Z
GET /partners/{partner_code}/bookings/?status=CANCELLED&updated_after=2027-03-01T00:00:00Z
```

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

All filters are optional and can be combined:

| Query parameter                                  | Filters on                                                                    |
| ------------------------------------------------ | ----------------------------------------------------------------------------- |
| `status`                                         | Booking status, such as `CONFIRMED`, `CANCELLED` or `PENDING_PAYMENT`         |
| `created_after`, `created_before`                | When the booking was created. ISO 8601 date-time with offset                  |
| `updated_after`, `updated_before`                | When the booking last changed, for example when it was cancelled. Same format |
| `id`                                             | A booking ID (INS)                                                            |
| `customer__email`, `customer__email__startswith` | Policyholder email, exact match or prefix                                     |
| `customer__phone`, `customer__phone__startswith` | Policyholder phone, exact match or prefix                                     |
| `limit`, `offset`                                | Paging. `limit` defaults to 50, and the maximum is 100                        |

The response is a page of booking objects, newest change first:

```json
{
  "count": 120,
  "next": "https://api.xcover.com/x/partners/{partner_code}/bookings/?limit=50&offset=50&status=CONFIRMED",
  "previous": null,
  "results": [ { "id": "XXXXX-XXXXX-INS", "status": "CONFIRMED", "...": "..." } ]
}
```

Follow `next` until it is `null`. Each item in `results` has the same shape as Get Booking. A test API key only returns test bookings.

{% hint style="info" %}
Your API key needs permission to read bookings. If List Bookings returns `403`, ask your CSE to enable it.
{% endhint %}

| RentalCover                                | XCover Offers                                                             |
| ------------------------------------------ | ------------------------------------------------------------------------- |
| `POST /insurances/getAllPurchasedPolicies` | `GET /bookings/?status=CONFIRMED` with `created_after` / `created_before` |
| `POST /insurances/getAllCancelledPolicies` | `GET /bookings/?status=CANCELLED` with `updated_after` / `updated_before` |
| `GET /insurances/invoice/{reference}`      | No endpoint. Invoices are in the Partner Portal                           |

To reconcile, combine your own records from Confirm and Cancel with webhooks, and use List Bookings to catch anything you missed for a period.
{% endstep %}
{% endstepper %}

## What to store

| Identifier               | Returned by                   | Use it for                                                       |
| ------------------------ | ----------------------------- | ---------------------------------------------------------------- |
| Offer ID                 | Create Offer                  | Confirm and Opt-out, while the offer is valid                    |
| Quote ID                 | Create Offer and Confirm      | `quotes[].id` in Confirm, Cancel and Modify requests             |
| INS (booking ID)         | Confirm                       | Get Booking, Cancel, Modify, support and rebooking               |
| `partner_transaction_id` | Your `partner.transaction_id` | Matching bookings and webhooks to your order                     |
| `cancellation_id`        | Cancel preview                | Confirming the cancellation                                      |
| `update_id`              | Quote for update              | Confirming a price-affecting change                              |
| Issuing API              | You                           | Sending each later call to the right API during the parallel run |

## Documents, emails and claims

* Link to `pds_url`, `coi.url`, `account_url` and `fnol_link` **exactly as returned**. Don't build URLs from the INS.
* Cover Genius sends the confirmation, reminder, modification and cancellation emails.
* For claims, show the `fnol_link`. You don't need a claims API.

Some RentalCover website features are not part of the API journey: credits and coupons, repurchase or reinstatement, price match, cancellation-resistance prompts and upsell banners, URL-parameter or account-locked quotes, the car rental guide, and a partner logo on the customer dashboard. If you rely on any of them, raise it with your CSE during scoping.

## See also

* [Webhooks](https://partner-docs.covergenius.com/offers/api/webhooks.md)
* [Claims](https://partner-docs.covergenius.com/offers/services/xcover/claim.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/track-bookings.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.
