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

Client side

This page guides migration from quotes to offers using XCE script on the client-side.

Script Major Version bump

Migrating from quotes to offers endpoint introduce breaking changes into the XCE scripts. This means the changes must be introduced through a bump to the current major version of your script.

The major version change helps us to mitigate introducing any breaking change that would affect your existing XCE integration.

If you are still not getting the benefits of using Offers, please request your CSE an XCE script migration from quotes to offer.

Signals

set signal

The set signal will now create an offer instead of quotes. To do so you must pass in your offer request body in the property offer_request instead of quote_request in data as in the following example:

/* Traveling xce-protection-offer example */
window.signalLayer.push({
  signal: 'set',
  element: 'xce-protection-offer',
  onSet: async (req) => {
    try {
      const response = await req
      if (!response) throw new Error('Empty response');
      // your disable checkout logic here..
    } catch (err) {
      console.error('XCE Request Error: ', err);
    }
  },
  data: {
    offer_request: {
      schema: "demo-partner-travel:1",
      customer: {
        currency: "USD", 
        language: "en-US",
        country: "US",
        postcode: "12345",
        region: "NY",
      },
      partner: {
        customer_id: "220974115-8713648",
        subsidiary: "Cover Genius",
        metadata: {
          context_id: 220974115,
          event_id: 357
        },
      },
      context: {
        policy_start_date: "{{policy_start_date}}",
        event_datetime: "{{policy_end_date}}",
        event_name: "Lil Baby",
        event_country: "US",
        event_city: "Los Angeles",
        event_address: "1111 S. Figueroa Street",
        event_postcode: "90015",
        event_location: "Crypto.com Arena",
        number_of_tickets: 1,
        tickets: [
          {
            price: 99.5
          }
        ],
        total_event_cost: 99.5
      }
    },
    currency_config: {
      trailingZeroDisplay: 'stripIfInteger'
    },
    order_total: 99.5
  }
});

listen signal

selectedOption

The selectedOption property continues being a string value returned in the callback arguments object that will match the radio input value attribute that the customer selected, but the input value attribute changed.

Now, for option 'YES' the radio input value and the selectedOption property equals the product id not the policy type.

selectedPolicies is now selectedProducts

The selectedPolicies is now selectedProducts property.

It continues being an array of objects but the objects schema changed from a policy metadata to a product metadata.

XCover Product type metadata:

Last updated

Was this helpful?