# GetAllPurchasedPolicies

The GetAllPurchasedPolicies endpoint enables the partners to get a list of the bookings purchased and cancelled by users.

#### Endpoint: /insurances/getAllPurchasedPolicies

#### Method: `POST`

{% tabs %}
{% tab title="POST /insurances/getAllPurchasedPolicies " %}

```perl
curl -i -X POST \
-H "X_API_KEY: [my-api-key]" \
-H "Content-Type: application/json" \
-d '{"FromDate":"2017-11-10 00:00:00","ToDate": "2018-11-20 00:00:00"}' \
https://api-staging.rentalcover.com/insurances/getAllPurchasedPolicies
```

{% endtab %}

{% tab title="Response" %}

```graphql
{
   "MetaData":{
      "TotalItems":1,
      "TotalPages":1,
      "CurrentPage":1,
      "ItemsPerPage":500,
      "Links":{
         "FirstPage":"https://api-staging.rentalcover.com/insurances/getAllPurchasedPolicies/page/1"
      }
   },
   "Bookings":[
      {
         "Booking":{
            "BookingId":"1971444",
            "Status":"Cancelled",
            "Reference":"7VC1-XZ75-INS",
            "FromDate":"2018-05-08 00:00:00",
            "ToDate":"2018-05-20 00:00:00",
            "Currency":"USD",
            "Amount":"52.56",
            "ModifiedOn":"2018-11-23 14:03:56"
         }
      }
   ]
}
```

{% endtab %}
{% endtabs %}

## Request Parameters

|                                                |                                       |
| ---------------------------------------------- | ------------------------------------- |
| `X_API_KEY` string \[varchar(32)] **required** | API Key, provided by RentalCover.com. |
| `FromDate` datetime                            | Start date/time for the filter.       |
| `ToDate` datetime                              | End date/time for the filter.         |
| `Page` integer                                 | Pagination index.                     |

{% hint style="info" %}
Note: Date filters do not refer to bookings FromDate or ToDate, but instead to the latest modification date of each item.
{% endhint %}


---

# 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://partner-docs.covergenius.com/rentalcover/endpoints/getallpurchasedpolicies.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.
