# Cancel Booking

## Cancel Booking

> Cancel an event ticket protection booking. Typical cancellation reasons include the event being cancelled by the organizer, the customer being unable to attend, or a duplicate booking.\
> \
> When \`preview\` is \`true\`, returns a refund preview with a \`cancellation\_id\`. When \`preview\` is \`false\` (or omitted), the cancellation is applied immediately.

```json
{"openapi":"3.0.0","info":{"title":"Offers API - Event Ticket Protection","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\nRequires three mandatory headers in every request:\n\n### 1. X-Api-Key (Client Key)\n* **Purpose:** Public identifier for the API consumer.\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\n### 3. Authorization (Computed Signature)\n* **Purpose:** Cryptographic signature that verifies the request's authenticity and integrity.\n* **Format:** `SIGNATURE [authHeader]`\n\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 an event ticket protection booking. Typical cancellation reasons include the event being cancelled by the organizer, the customer being unable to attend, or a duplicate booking.\n\nWhen `preview` is `true`, returns a refund preview with a `cancellation_id`. When `preview` is `false` (or omitted), the cancellation is applied immediately.","tags":["Cancel Booking"],"requestBody":{"required":true,"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"]}}}}}}},"responses":{"200":{"description":"OK","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","nullable":true},"policy_cancellation_date":{"type":"string","format":"date-time","nullable":true},"status":{"type":"string"},"price":{"type":"number"},"refund_value":{"type":"number"},"adjustment_fee":{"type":"number"}}}},"policyholder":{"type":"object","properties":{"first_name":{"type":"string"},"last_name":{"type":"string"},"email":{"type":"string","format":"email"},"country":{"type":"string"}}},"total_price":{"type":"number"},"total_price_formatted":{"type":"string"},"total_refund":{"type":"number"},"total_refund_formatted":{"type":"string"},"currency":{"type":"string"},"cancellation_id":{"type":"string","nullable":true},"confirm_before":{"type":"string","format":"date-time","nullable":true},"refund_amount":{"type":"number"},"refund_amount_formatted":{"type":"string"}}}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"message":{"type":"string"}}}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"message":{"type":"string"},"errors":{"type":"array","items":{"type":"string"}}}}}}}}}}}}
```

## Cancel Booking - Confirm

> Finalize a previewed cancellation.

```json
{"openapi":"3.0.0","info":{"title":"Offers API - Event Ticket Protection","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\nRequires three mandatory headers in every request:\n\n### 1. X-Api-Key (Client Key)\n* **Purpose:** Public identifier for the API consumer.\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\n### 3. Authorization (Computed Signature)\n* **Purpose:** Cryptographic signature that verifies the request's authenticity and integrity.\n* **Format:** `SIGNATURE [authHeader]`\n\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":"Finalize a previewed cancellation.","tags":["Cancel Booking"],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"reason_for_cancellation":{"type":"string"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"quotes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"price":{"type":"number"},"refund_value":{"type":"number"},"cancelled_at":{"type":"string","format":"date-time"}}}},"total_refund":{"type":"number"},"total_refund_formatted":{"type":"string"},"refund_amount":{"type":"number"},"refund_amount_formatted":{"type":"string"}}}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"message":{"type":"string"}}}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"message":{"type":"string"}}}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"message":{"type":"string"},"errors":{"type":"array","items":{"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/vertical-examples/events-tickets/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.
