Cancel Booking
Composite Authentication Scheme (Client Key, Date, and Signature)
This scheme requires the client to provide three mandatory headers in every request:
1. X-Api-Key (Client Key)
- Purpose: Public identifier for the API consumer.
- Example:
X-Api-Key: a1b2c3d4e5f6g7h8
2. Date (Timestamp)
- Purpose: Timestamp used for generating the signature and preventing replay attacks.
- Format: RFC 7231 format (e.g., in GMT).
- Example:
Date: Sun, 09 Nov 2025 04:04:00 GMT
3. Authorization (Computed Signature)
- Purpose: The cryptographic signature that verifies the request's authenticity and integrity.
- Format:
SIGNATURE [authHeader]
Signature Generation Logic:
The 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.
Partner code identifier. Client Solutions Engineer (CSE) should provide this value.
The booking ID returned from the Confirm Offer endpoint.
When true, returns a preview of the cancellation without applying it. Use the returned cancellation_id to confirm.
Whether a refund is required for this cancellation
OK
Present when preview=true. Use this ID to confirm the cancellation.
Deadline to confirm the cancellation preview
Forbidden
Not Found
Unprocessable Entity
POST /x/partners/{partner_code}/bookings/{booking_id}/cancel HTTP/1.1
Host: api.xcover.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 40
{
"preview": false,
"refund_required": true
}{
"id": "CJTE3-PFJF7-INS",
"status": "CANCELLED",
"quotes": [
{
"id": "755100f6-d7a2-4a8f-a8b8-e054c747a375",
"policy_start_date": "2026-01-15T22:22:32.851000Z",
"policy_end_date": "2026-02-13T22:22:32.851000Z",
"policy_cancellation_date": "2026-01-16T10:00:00.000000Z",
"policy_coolingoff_date": "2026-01-29T22:22:32.851000Z",
"status": "CANCELLED",
"price": 454.92,
"refund_value": 454.92,
"adjustment_fee": 0,
"policy": {
"policy_type": "comprehensive_travel_insurance",
"policy_type_version": "1",
"policy_type_slug": "comprehensive_travel_insurance_v1",
"policy_type_group_name": "travel",
"policy_name": "Comprehensive Travel Protection (AU)",
"policy_code": "BKCTPAU0",
"policy_version": "7933ab1a-b00a-45fa-bfe6-16adba0a4765",
"category": "comprehensive_travel_insurance",
"policy_currency": "AUD"
},
"insured": [
{
"id": "8de4531a-4f56-4797-8b5b-b451fcbe4e1a",
"first_name": "d41d8cd98f00b204e9800998ecf8427e",
"last_name": "d41d8cd98f00b204e9800998ecf8427e",
"email": "[email protected]",
"age": 34,
"birth_date": "1987-02-24"
}
],
"created_at": "2026-01-15T22:22:32.851000Z",
"confirmed_at": "2026-01-15T22:22:32.900000Z",
"updated_at": "2026-01-16T10:00:00.000000Z",
"cancelled_at": "2026-01-16T10:00:00.000000Z",
"cancelled_from": "2026-01-16T10:00:00.000000Z",
"commission": null
}
],
"policyholder": {
"first_name": "d41d8cd98f00b204e9800998ecf8427e",
"last_name": "d41d8cd98f00b204e9800998ecf8427e",
"email": "[email protected]",
"country": "AU",
"allow_updates": false,
"fields_allowed_to_update": []
},
"pds_url": "https://www.xcover.com/en/pds/CJTE3-PFJF7-INS",
"coi": {
"url": "https://www.xcover.com/en/coi/CJTE3-PFJF7-INS?security_token=0rRaJ-WzAoa-oHjBK-14f6M",
"pdf": "https://www.xcover.com/en/coi/CJTE3-PFJF7-INS.pdf?security_token=0rRaJ-WzAoa-oHjBK-14f6M"
},
"created_at": "2026-01-15T22:22:32.851000Z",
"updated_at": "2026-01-16T10:00:00.000000Z",
"total_price": 0,
"total_price_formatted": "A$0.00",
"total_refund": 454.92,
"total_refund_formatted": "A$454.92",
"total_tax": 0,
"total_tax_formatted": "A$0.00",
"total_premium": 0,
"total_premium_formatted": "A$0.00",
"currency": "AUD",
"cancellation_id": null,
"confirm_before": null,
"refund_amount": 454.92,
"refund_amount_formatted": "A$454.92",
"cancellation_payout_url": null
}Composite Authentication Scheme (Client Key, Date, and Signature)
This scheme requires the client to provide three mandatory headers in every request:
1. X-Api-Key (Client Key)
- Purpose: Public identifier for the API consumer.
- Example:
X-Api-Key: a1b2c3d4e5f6g7h8
2. Date (Timestamp)
- Purpose: Timestamp used for generating the signature and preventing replay attacks.
- Format: RFC 7231 format (e.g., in GMT).
- Example:
Date: Sun, 09 Nov 2025 04:04:00 GMT
3. Authorization (Computed Signature)
- Purpose: The cryptographic signature that verifies the request's authenticity and integrity.
- Format:
SIGNATURE [authHeader]
Signature Generation Logic:
The 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.
Partner code identifier. Client Solutions Engineer (CSE) should provide this value.
The booking ID returned from the Confirm Offer endpoint.
The cancellation ID returned from the Cancel Booking preview endpoint.
Reason for the cancellation
OK
Forbidden
Not Found
Unprocessable Entity
POST /x/partners/{partner_code}/bookings/{booking_id}/confirm_cancellation/{cancellation_id}/ HTTP/1.1
Host: api.xcover.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 46
{
"reason_for_cancellation": "no longer needed"
}{
"id": "CJTE3-PFJF7-INS",
"status": "CANCELLED",
"quotes": [
{
"id": "755100f6-d7a2-4a8f-a8b8-e054c747a375",
"policy_start_date": "2026-01-15T22:22:32.851000Z",
"policy_end_date": "2026-02-13T22:22:32.851000Z",
"policy_cancellation_date": "2026-01-16T10:05:00.000000Z",
"policy_coolingoff_date": "2026-01-29T22:22:32.851000Z",
"status": "CANCELLED",
"price": 454.92,
"refund_value": 454.92,
"adjustment_fee": 0,
"created_at": "2026-01-15T22:22:32.851000Z",
"confirmed_at": "2026-01-15T22:22:32.900000Z",
"updated_at": "2026-01-16T10:05:00.000000Z",
"cancelled_at": "2026-01-16T10:05:00.000000Z",
"cancelled_from": "2026-01-16T10:05:00.000000Z",
"commission": null
}
],
"policyholder": {
"first_name": "d41d8cd98f00b204e9800998ecf8427e",
"last_name": "d41d8cd98f00b204e9800998ecf8427e",
"email": "[email protected]",
"country": "AU",
"allow_updates": false,
"fields_allowed_to_update": []
},
"pds_url": "https://www.xcover.com/en/pds/CJTE3-PFJF7-INS",
"coi": {
"url": "https://www.xcover.com/en/coi/CJTE3-PFJF7-INS?security_token=0rRaJ-WzAoa-oHjBK-14f6M",
"pdf": "https://www.xcover.com/en/coi/CJTE3-PFJF7-INS.pdf?security_token=0rRaJ-WzAoa-oHjBK-14f6M"
},
"created_at": "2026-01-15T22:22:32.851000Z",
"updated_at": "2026-01-16T10:05:00.000000Z",
"total_price": 0,
"total_price_formatted": "A$0.00",
"total_refund": 454.92,
"total_refund_formatted": "A$454.92",
"total_tax": 0,
"total_tax_formatted": "A$0.00",
"total_premium": 0,
"total_premium_formatted": "A$0.00",
"currency": "AUD",
"cancellation_id": null,
"confirm_before": null,
"refund_amount": 454.92,
"refund_amount_formatted": "A$454.92",
"cancellation_payout_url": null
}Last updated
Was this helpful?

