For the complete documentation index, see llms.txt. This page is also available as Markdown.

Cancel Booking

Cancel Booking

post

The Cancel Booking endpoint is used when a customer no longer requires coverage and has contacted the partner directly to cancel the policy. This endpoint handles the cancellation process and calculates any applicable refunds.

When preview is set to true, the cancellation is not applied but a preview of the refund is returned along with a cancellation_id that can be used to confirm the cancellation.

When preview is set to false (or omitted), the cancellation is applied immediately.

Authorizations
AuthorizationstringRequired

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.

Path parameters
partner_codestringRequired

Partner code identifier. Client Solutions Engineer (CSE) should provide this value.

booking_idstringRequired

The booking ID returned from the Confirm Offer endpoint.

Body
previewbooleanOptional

When true, returns a preview of the cancellation without applying it. Use the returned cancellation_id to confirm.

refund_requiredbooleanOptional

Whether a refund is required for this cancellation

Responses
200

OK

application/json
idstringOptional
statusstringOptional
total_pricenumberOptional
total_price_formattedstringOptional
total_refundnumberOptional
total_refund_formattedstringOptional
currencystringOptional
cancellation_idstring · nullableOptional

Present when preview=true. Use this ID to confirm the cancellation.

confirm_beforestring · date-time · nullableOptional

Deadline to confirm the cancellation preview

refund_amountnumberOptional
refund_amount_formattedstringOptional
post/partners/{partner_code}/bookings/{booking_id}/cancel
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
}

Cancel Booking - Confirm

post

The Confirm Cancellation endpoint finalizes a previewed cancellation. Use the cancellation_id returned from the Cancel Booking endpoint when preview was set to true.

Authorizations
AuthorizationstringRequired

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.

Path parameters
partner_codestringRequired

Partner code identifier. Client Solutions Engineer (CSE) should provide this value.

booking_idstringRequired

The booking ID returned from the Confirm Offer endpoint.

cancellation_idstringRequired

The cancellation ID returned from the Cancel Booking preview endpoint.

Body
reason_for_cancellationstringOptional

Reason for the cancellation

Responses
200

OK

application/json
idstringOptional
statusstringOptional
total_refundnumberOptional
total_refund_formattedstringOptional
refund_amountnumberOptional
refund_amount_formattedstringOptional
post/partners/{partner_code}/bookings/{booking_id}/confirm_cancellation/{cancellation_id}/
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?