Booking

Booking process overview

The Booking endpoint is used to confirm the purchase of the insurance offering.

If a customer has chosen to purchase the insurance product(s) offered in the previous Quote step the customer must complete the checkout process with payment being successfully collected before proceeding with the following steps to confirm and distribute the policy.

After customers complete the booking process and insurance premiums are collected by the partner a request to the booking endpoint must be made. Validations: 1. Given the initial status after the Quote Request is RECEIVED , when a booking request is submitted, the expected status returned in response payload after a successful booking request is CONFIRMED. 2. The price field should also be validated, to confirm the final price matches the quote stage price. 3. The presence of an "errors" object in response payload indicates an important logic error in booking, that should be noted. A CONFIRMED INS is considered booked, sold, provisioned, and will result in a policy confirmation being submitted to the user.

Make a Booking

POST https://api.xcover.com/x/partners/:partner_id/bookings/:quote_package_id

The booking endpoint accepts a JSON payload against the URI containing the quote package ID returned in the quote request. The payload consists of policyholder information (most likely the same as the customer) and a list of quotes selected for purchase. the most relevant policies available for distribution

Path Parameters

NameTypeDescription

partner_id

string

Unique Partner Code

quote_package_id

string

Quote Package ID

Headers

NameTypeDescription

Content-Type

string

application/json

Date

string

Current Datetime

Authorization

string

HMAC Signature

X-Api-Key

string

API Key

{
  "id": "string",
  "status": "string",
  "currency": "str",
  "total_price": 0,
  "total_price_formatted": "string",
  "partner_transaction_id": "string",
  "created_at": "2021-01-04T17:10:37Z",
  "updated_at": "2021-01-04T17:10:37Z",
  "pds_url": "http://example.com",
  "security_token": "string",
  "quotes": [
    {
      "id": "string",
      "policy_start_date": "2021-01-04T17:10:37Z",
      "policy_end_date": "2021-01-04T17:10:37Z",
      "status": "string",
      "price": 0,
      "price_formatted": "string",
      "policy": {
        "policy_type": "string",
        "policy_name": "string",
        "policy_code": "string",
        "policy_version": "string",
        "category": "string",
        "content": {
          "title": "string",
          "header": "string",
          "description": "string",
          "optout_msg": "string",
          "inclusions": [
            {
              "title": "string",
              "description": "string"
            }
          ],
          "exclusions": [
            {
              "title": "string",
              "description": "string"
            }
          ],
          "disclaimer": "string",
          "disclaimer_html": "string",
          "payment_disclaimer": "string",
          "in_path_disclaimer": "string"
        },
        "underwriter": {
          "disclaimer": "string",
          "name": "string"
        }
      },
      "insured": [
        {
          "id": "string",
          "first_name": "string",
          "middle_name": "string",
          "last_name": "string",
          "email": "[email protected]",
          "country": "AF",
          "address1": "string",
          "address2": "string",
          "city": "string",
          "postcode": "string",
          "region": "string",
          "phone": "string",
          "age": 0,
          "birth_date": "2021-01-04",
          "metadata": {
            "property1": "string",
            "property2": "string"
          },
          "company": "string"
        }
      ],
      "tax": {
        "total_tax": 0,
        "total_amount_without_tax": 0,
        "total_tax_formatted": "string",
        "total_amount_without_tax_formatted": "string",
        "taxes": [
          {
            "tax_amount": 0,
            "tax_code": "string",
            "tax_amount_formatted": "string"
          }
        ]
      },
      "duration": "string",
      "benefits": [
        {
          "description": "string",
          "limit_description": "string",
          "limit": 0,
          "limit_policy_currency": 0,
          "limit_formatted": "string",
          "limit_policy_currency_formatted": "string",
          "limit_per_unit": 0,
          "limit_per_unit_policy_currency": 0,
          "limit_per_unit_formatted": "string",
          "limit_per_unit_policy_currency_formatted": "string",
          "excess_description": "string",
          "excess": 0,
          "excess_policy_currency": 0,
          "excess_formatted": "string",
          "excess_policy_currency_formatted": "string",
          "minimum_claim_amount": 0,
          "minimum_claim_amount_policy_currency": 0,
          "minimum_claim_amount_formatted": "string",
          "minimum_claim_amount_policy_currency_formatted": "string"
        }
      ],
      "commission": {
        "total_commission": 0,
        "total_commission_formatted": "string"
      },
      "created_at": "2021-01-04T17:10:37Z",
      "confirmed_at": "2021-01-04T17:10:37Z",
      "updated_at": "2021-01-04T17:10:37Z",
      "cancelled_at": "2021-01-04T17:10:37Z",
      "is_renewable": true,
      "cover_amount": 0,
      "cover_amount_formatted": "string",
      "pds_url": "http://example.com",
      "attachments": "string",
      "files": "string",
      "extra_fields": {
        "property1": "string",
        "property2": "string"
      },
      "next_renewal": {
        "id": "string",
        "package_id": "string",
        "quote_id": "string",
        "status": "string",
        "start_date": "2021-01-04T17:10:37Z",
        "notification_date": "2021-01-04T17:10:37Z",
        "due_date": "2021-01-04T17:10:37Z",
        "expiry_date": "2021-01-04T17:10:37Z",
        "cancelled_on": "2021-01-04T17:10:37Z",
        "paid_on": "2021-01-04T17:10:37Z",
        "created_at": "2021-01-04T17:10:37Z"
      },
      "can_be_cancelled": true,
      "errors": [
        "string"
      ]
    }
  ],
  "coi": {
    "pdf": "http://example.com",
    "url": "http://example.com"
  },
  "account_url": "http://example.com",
  "policyholder": {
    "first_name": "string",
    "middle_name": "string",
    "last_name": "string",
    "email": "[email protected]",
    "phone": "string",
    "country": "AF",
    "age": 0,
    "address1": "string",
    "address2": "string",
    "city": "string",
    "postcode": "string",
    "region": "string",
    "secondary_email": "[email protected]",
    "birth_date": "2021-01-04",
    "company": "string",
    "tax_payer_id": "string"
  },
  "total_tax": 0,
  "total_tax_formatted": "string",
  "total_premium": 0,
  "total_premium_formatted": "string"
}
{
    "quotes": [
        {
            "id": "d7780bcc-c47c-446b-a9fb-b41f62fc1e81",
            "insured": [
                {
                    "first_name": "User",
                    "last_name": "Example",
                    "birth_date": "1991-03-11",
                    "email": "[email protected]"
                }
            ]
        }
    ],
    "policyholder": {
        "first_name": "User",
        "last_name": "Example",
        "birth_date": "1991-03-11",
        "email": "[email protected]",
        "country": "GB"
    }
}

Last updated