# Cancel Booking

## Cancel Booking

> Cancel a policy booking when a customer no longer requires coverage. This endpoint supports two modes controlled by the \`preview\` field:\
> \- \*\*Preview mode\*\* (\`preview: true\`): Calculate the refund amount without\
> &#x20; cancelling. Returns a \`cancellation\_id\` for use with the Confirm\
> &#x20; Cancellation endpoint.\
> \
> \- \*\*Immediate cancellation\*\* (\`preview: false\` or omitted): Cancel the\
> &#x20; booking immediately and process any applicable refunds.\
> \
> Use preview mode when you need customer confirmation before finalizing the cancellation.

```json
{"openapi":"3.0.0","info":{"title":"Offers API","version":"1.0.0"},"servers":[{"url":"https://api.xcover.com/x"}],"security":[{"CustomAPISignature":[]}],"components":{"securitySchemes":{"CustomAPISignature":{"type":"apiKey","name":"Authorization","in":"header","description":"**Composite Authentication Scheme (Client Key, Date, and Signature)**\n\nThis scheme requires the client to provide **three** mandatory headers in every request:\n\n### 1. X-Api-Key (Client Key)\n* **Purpose:** Public identifier for the API consumer.\n* **Example:** `X-Api-Key: a1b2c3d4e5f6g7h8`\n\n### 2. Date (Timestamp)\n* **Purpose:** Timestamp used for generating the signature and preventing replay attacks.\n* **Format:** RFC 7231 format (e.g., in GMT).\n* **Example:** `Date: Sun, 09 Nov 2025 04:04:00 GMT`\n\n### 3. Authorization (Computed Signature)\n* **Purpose:** The cryptographic signature that verifies the request's authenticity and integrity.\n* **Format:** `SIGNATURE [authHeader]`\n\n**Signature Generation Logic:**\nThe `authHeader` value is derived from a cryptographic hash (e.g., HMAC-SHA256) of canonical request components (HTTP Method, Path, and the contents of the `Date` header), signed with the private **Client Secret**.\n"}}},"paths":{"/partners/{partner_code}/bookings/{booking_id}/cancel":{"post":{"summary":"Cancel Booking","description":"Cancel a policy booking when a customer no longer requires coverage. This endpoint supports two modes controlled by the `preview` field:\n- **Preview mode** (`preview: true`): Calculate the refund amount without\n  cancelling. Returns a `cancellation_id` for use with the Confirm\n  Cancellation endpoint.\n\n- **Immediate cancellation** (`preview: false` or omitted): Cancel the\n  booking immediately and process any applicable refunds.\n\nUse preview mode when you need customer confirmation before finalizing the cancellation.","tags":["Cancel Booking"],"responses":{"200":{"description":"OK - cancelled","headers":{"Date":{"schema":{"deprecated":false}},"Transfer-Encoding":{"schema":{"deprecated":false}},"Connection":{"schema":{"deprecated":false}},"CF-Ray":{"schema":{"deprecated":false}},"CF-Cache-Status":{"schema":{"deprecated":false}},"Allow":{"schema":{"deprecated":false}},"Server":{"schema":{"deprecated":false}},"Strict-Transport-Security":{"schema":{"deprecated":false}},"content-security-policy":{"schema":{"deprecated":false}},"cross-origin-opener-policy":{"schema":{"deprecated":false}},"referrer-policy":{"schema":{"deprecated":false}},"Vary":{"schema":{"deprecated":false}},"Content-Encoding":{"schema":{"deprecated":false}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"quotes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"policy_start_date":{"type":"string","format":"date-time"},"policy_end_date":{"type":"string","format":"date-time"},"policy_cancellation_date":{"type":"string","format":"date-time"},"policy_coolingoff_date":{"type":"string","format":"date-time"},"status":{"type":"string"},"price":{"type":"number"},"refund_value":{"type":"number"},"adjustment_fee":{"type":"integer"},"policy":{"type":"object","properties":{"policy_type":{"type":"string"},"policy_type_version":{"type":"string","format":"utc-millisec"},"policy_type_slug":{"type":"string"},"policy_type_group_name":{"type":"string"},"policy_name":{"type":"string"},"policy_code":{"type":"string"},"policy_version":{"type":"string"},"category":{"type":"string"},"content":{"type":"object","properties":{"title":{"type":"string"},"header":{"nullable":true},"description":{"type":"string"},"optout_msg":{"type":"string"},"inclusions":{"type":"array","items":{}},"exclusions":{"type":"array","items":{}},"disclaimer":{"type":"string"},"disclaimer_html":{"type":"string"},"payment_disclaimer":{"type":"string"},"in_path_disclaimer":{"type":"string"}}},"underwriter":{"type":"object","properties":{"disclaimer":{"type":"string"},"name":{"type":"string"}}},"claim_selector_id":{"nullable":true},"policy_currency":{"type":"string"}}},"insured":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"},"email":{"type":"string","format":"email"},"region":{"nullable":true}}}},"created_at":{"type":"string","format":"date-time"},"confirmed_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"cancelled_at":{"type":"string","format":"date-time"},"cancelled_from":{"type":"string","format":"date-time"},"commission":{"nullable":true}}}},"policyholder":{"type":"object","properties":{"first_name":{"type":"string"},"last_name":{"type":"string"},"email":{"type":"string","format":"email"},"phone":{"type":"string"},"address1":{"nullable":true},"address2":{"nullable":true},"postcode":{"type":"string","format":"color"},"company":{"nullable":true},"company_reg_id":{"nullable":true},"middle_name":{"nullable":true},"country":{"type":"string"},"age":{"type":"integer"},"city":{"nullable":true},"region":{"type":"string"},"secondary_email":{"nullable":true},"birth_date":{"nullable":true},"allow_updates":{"type":"boolean"},"fields_allowed_to_update":{"type":"array","items":{}}}},"pds_url":{"type":"string","format":"uri"},"coi":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"pdf":{"type":"string","format":"uri"}}},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"total_price":{"type":"integer"},"total_price_formatted":{"type":"string"},"total_refund":{"type":"number"},"total_refund_formatted":{"type":"string"},"total_tax":{"type":"integer"},"total_tax_formatted":{"type":"string"},"total_premium":{"type":"integer"},"total_premium_formatted":{"type":"string"},"currency":{"type":"string"},"cancellation_id":{"nullable":true},"confirm_before":{"nullable":true},"partner":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"title":{"type":"string"},"logo":{"type":"string","format":"uri"},"contact_url":{"type":"string","format":"uri"},"partner_url":{"type":"string","format":"uri"},"help_center_url":{"type":"string","format":"uri"},"updated_at":{"type":"string","format":"date-time"},"xpay_payment_enabled":{"type":"boolean"},"xpay_b2c_payment_enabled":{"type":"boolean"},"xpay_refund_enabled":{"type":"boolean"},"automatic_refund_by_xcore":{"type":"boolean"},"allow_policy_modifications_on_xcover":{"type":"boolean"},"emails":{"type":"array","items":{}},"attributes":{"type":"object"},"signup_method_on_xcover":{"nullable":true},"use_standard_region":{"nullable":true},"allow_payout_customer":{"type":"boolean"},"eligible_for_xpay_charge_retry":{"type":"boolean"},"subsidiary":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"title":{"type":"string"},"logo":{"type":"string","format":"uri"},"contact_url":{"type":"string","format":"uri"},"partner_url":{"type":"string","format":"uri"},"help_center_url":{"type":"string","format":"uri"},"updated_at":{"type":"string","format":"date-time"},"xpay_payment_enabled":{"type":"boolean"},"xpay_b2c_payment_enabled":{"type":"boolean"},"xpay_refund_enabled":{"type":"boolean"},"automatic_refund_by_xcore":{"type":"boolean"},"allow_policy_modifications_on_xcover":{"type":"boolean"},"emails":{"type":"array","items":{}},"attributes":{"type":"object"},"signup_method_on_xcover":{"nullable":true},"use_standard_region":{"nullable":true},"allow_payout_customer":{"type":"boolean"},"eligible_for_xpay_charge_retry":{"type":"boolean"}}}}},"refund_amount":{"type":"number"},"refund_amount_formatted":{"type":"string"},"cancellation_payout_url":{"nullable":true}}}}}},"403":{"description":"Forbidden","headers":{"Date":{"schema":{"deprecated":false}},"Transfer-Encoding":{"schema":{"deprecated":false}},"Connection":{"schema":{"deprecated":false}},"CF-Ray":{"schema":{"deprecated":false}},"CF-Cache-Status":{"schema":{"deprecated":false}},"Allow":{"schema":{"deprecated":false}},"Server":{"schema":{"deprecated":false}},"Strict-Transport-Security":{"schema":{"deprecated":false}},"cross-origin-opener-policy":{"schema":{"deprecated":false}},"referrer-policy":{"schema":{"deprecated":false}},"Vary":{"schema":{"deprecated":false}},"Content-Encoding":{"schema":{"deprecated":false}}},"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Not Found","headers":{"Date":{"schema":{"type":"string"}},"Transfer-Encoding":{"schema":{"type":"string"}},"Connection":{"schema":{"type":"string"}},"CF-Ray":{"schema":{"type":"integer"}},"CF-Cache-Status":{"schema":{"type":"string"}},"Allow":{"schema":{"type":"string"}},"Server":{"schema":{"type":"string"}},"Strict-Transport-Security":{"schema":{"type":"string"}},"cross-origin-opener-policy":{"schema":{"type":"string"}},"referrer-policy":{"schema":{"type":"string"}},"Vary":{"schema":{"type":"string"}},"Content-Encoding":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"message":{"type":"string"}}}}}},"422":{"description":"Modify booking Copy","headers":{"Date":{"schema":{"deprecated":false}},"Content-Length":{"schema":{"deprecated":false}},"Connection":{"schema":{"deprecated":false}},"CF-Ray":{"schema":{"deprecated":false}},"CF-Cache-Status":{"schema":{"deprecated":false}},"Allow":{"schema":{"deprecated":false}},"Server":{"schema":{"deprecated":false}},"Strict-Transport-Security":{"schema":{"deprecated":false}},"cross-origin-opener-policy":{"schema":{"deprecated":false}},"referrer-policy":{"schema":{"deprecated":false}},"Vary":{"schema":{"deprecated":false}}},"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"message":{"type":"string"},"errors":{"type":"array","items":{"type":"string"}}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"preview":{"type":"boolean"},"refund_required":{"type":"boolean"},"quotes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"reason_for_cancellation":{"type":"string"}},"required":["id"]}}}}}}}}}}}
```

## Cancel Booking - confirm

> Confirm and finalize a previously previewed cancellation. This endpoint completes the cancellation process initiated by calling Cancel Booking with \`preview: true\`. You must provide the \`cancellation\_id\` returned from the preview request. The cancellation will be processed and any applicable refunds will be issued.

```json
{"openapi":"3.0.0","info":{"title":"Offers API","version":"1.0.0"},"servers":[{"url":"https://api.xcover.com/x"}],"security":[{"CustomAPISignature":[]}],"components":{"securitySchemes":{"CustomAPISignature":{"type":"apiKey","name":"Authorization","in":"header","description":"**Composite Authentication Scheme (Client Key, Date, and Signature)**\n\nThis scheme requires the client to provide **three** mandatory headers in every request:\n\n### 1. X-Api-Key (Client Key)\n* **Purpose:** Public identifier for the API consumer.\n* **Example:** `X-Api-Key: a1b2c3d4e5f6g7h8`\n\n### 2. Date (Timestamp)\n* **Purpose:** Timestamp used for generating the signature and preventing replay attacks.\n* **Format:** RFC 7231 format (e.g., in GMT).\n* **Example:** `Date: Sun, 09 Nov 2025 04:04:00 GMT`\n\n### 3. Authorization (Computed Signature)\n* **Purpose:** The cryptographic signature that verifies the request's authenticity and integrity.\n* **Format:** `SIGNATURE [authHeader]`\n\n**Signature Generation Logic:**\nThe `authHeader` value is derived from a cryptographic hash (e.g., HMAC-SHA256) of canonical request components (HTTP Method, Path, and the contents of the `Date` header), signed with the private **Client Secret**.\n"}}},"paths":{"/partners/{partner_code}/bookings/{booking_id}/confirm_cancellation/{cancellation_id}/":{"post":{"summary":"Cancel Booking - confirm","description":"Confirm and finalize a previously previewed cancellation. This endpoint completes the cancellation process initiated by calling Cancel Booking with `preview: true`. You must provide the `cancellation_id` returned from the preview request. The cancellation will be processed and any applicable refunds will be issued.","tags":["Cancel Booking"],"responses":{"200":{"description":"OK","headers":{"Date":{"schema":{"type":"string"}},"Transfer-Encoding":{"schema":{"type":"string"}},"Connection":{"schema":{"type":"string"}},"CF-Ray":{"schema":{"type":"integer"}},"CF-Cache-Status":{"schema":{"type":"string"}},"Allow":{"schema":{"type":"string"}},"Server":{"schema":{"type":"string"}},"Strict-Transport-Security":{"schema":{"type":"string"}},"content-security-policy":{"schema":{"type":"string"}},"cross-origin-opener-policy":{"schema":{"type":"string"}},"referrer-policy":{"schema":{"type":"string"}},"Vary":{"schema":{"type":"string"}},"Content-Encoding":{"schema":{"type":"string"}}}},"403":{"description":"Forbidden","headers":{"Date":{"schema":{"deprecated":false}},"Transfer-Encoding":{"schema":{"deprecated":false}},"Connection":{"schema":{"deprecated":false}},"CF-Ray":{"schema":{"deprecated":false}},"CF-Cache-Status":{"schema":{"deprecated":false}},"Allow":{"schema":{"deprecated":false}},"Server":{"schema":{"deprecated":false}},"Strict-Transport-Security":{"schema":{"deprecated":false}},"cross-origin-opener-policy":{"schema":{"deprecated":false}},"referrer-policy":{"schema":{"deprecated":false}},"Vary":{"schema":{"deprecated":false}},"Content-Encoding":{"schema":{"deprecated":false}}},"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Not Found","headers":{"Date":{"schema":{"deprecated":false}},"Transfer-Encoding":{"schema":{"deprecated":false}},"Connection":{"schema":{"deprecated":false}},"CF-Ray":{"schema":{"deprecated":false}},"CF-Cache-Status":{"schema":{"deprecated":false}},"Allow":{"schema":{"deprecated":false}},"Server":{"schema":{"deprecated":false}},"Strict-Transport-Security":{"schema":{"deprecated":false}},"cross-origin-opener-policy":{"schema":{"deprecated":false}},"referrer-policy":{"schema":{"deprecated":false}},"Vary":{"schema":{"deprecated":false}},"Content-Encoding":{"schema":{"deprecated":false}}},"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"message":{"type":"string"}}}}}},"422":{"description":"Unprocessable Entity","headers":{"Date":{"schema":{"deprecated":false}},"Content-Length":{"schema":{"deprecated":false}},"Connection":{"schema":{"deprecated":false}},"CF-Ray":{"schema":{"deprecated":false}},"CF-Cache-Status":{"schema":{"deprecated":false}},"Allow":{"schema":{"deprecated":false}},"Server":{"schema":{"deprecated":false}},"Strict-Transport-Security":{"schema":{"deprecated":false}},"cross-origin-opener-policy":{"schema":{"deprecated":false}},"referrer-policy":{"schema":{"deprecated":false}},"Vary":{"schema":{"deprecated":false}}},"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"message":{"type":"string"},"errors":{"type":"array","items":{"type":"string"}}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"reason_for_cancellation":{"type":"string"}}}}}}}}}}
```


---

# 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/offers/api/reference/cancel-booking.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.
