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

Set signal

This page details the requirements to integrate the set signal which is used to request the offers and display aligned currency formatting and order total values across the panel.

Using set signal

The set signal is how a partner 1) creates an offer request for a customer and 2) formats the displayed currency in the element.

For existing XCover partners, this replaces the create offer API request, with a similar field structure.

Call signalLayer.push() with set as the value for the signal property, add onSet and data as in the following example:

/* Travel 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: 'AUD',
        country: 'AU',
        language: 'en',
      },
      context: {
        total_tickets_price: 344,
        departure_country: 'AU',
        destination_country: 'US',
        is_return: false,
        number_of_children: 0,
        number_of_adults: 1,
        number_of_infants: 0,
        trip_start_date: '2026-05-19T19:03:36.671Z',
        trip_end_date: '2026-05-19T19:02:21.444Z',
        flights: [
          {
            legs: [
              {
                departure_datetime: '2025-09-19T18:59:13.958Z',
                arrival_datetime: '2025-09-19T18:59:13.958Z',
                flight_number: 'SK1530',
                marketing_airline_iata_code: 'SK',
                marketing_airline_icao_code: 'SAS',
                operating_airline_iata_code: 'SK',
                operating_airline_icao_code: 'SAS',
                departure_airport: 'SYD',
                arrival_airport: 'JFK',
                departure_country: 'AU',
                arrival_country: 'US',
              },
            ],
            departure_datetime: '2025-09-19T18:59:13.958Z',
            arrival_datetime: '2025-09-19T18:59:13.958Z',
            departure_country: 'AU',
            departure_city: 'SYD',
            arrival_city: 'JFK',
          },
        ],
      },
    },
    currency_config: {
      trailingZeroDisplay: 'stripIfInteger'
    }
  }
});

The onSet property is a Promise function that will resolve with the quote response if successful, and the data.offer_request property is the create offer request body.

See Create Offer request fields for a simplified reference to the data object

onSet may be invoked more than once

  • Every set signal you push receives its own fresh promise, including integrations that reuse a single onSet handler function.

  • Elements with in-element update actions (for example a coverage date change) invoke onSet again when the customer updates the offer. That promise resolves with the updated offer on success, or with the unchanged previous offer if the update fails; update promises never reject. Treat each resolution as the current offer, and store it for the Confirm Offer request.

See Checkout Enablement for the rejection codes and recommended handling.

Last updated

Was this helpful?