Skip to main content

Product Quote Card

Embed dynamic Travel Insured products and choose a Travel Insured purchase handoff or a partner-controlled hybrid flow.

Audience: Partner product teams, developers, solution architects, and QA teamsLast Updated: October 2, 2026

The Product Quote Card is a supported embedded integration strategy, not only a UI widget. The product-quote-card web component renders Travel Insured quote results inside your site so customers can compare products, review prices and coverage details, select supported optional add-ons, and choose a product without your team building the product-shopping UI.

After selection, choose one of two models:

  • Expedited Embedded: configure a Pay Now or Buy Now destination supplied by Travel Insured. The card navigates the customer into the Travel Insured purchase experience, which owns the remaining consumer journey.
  • Hybrid Embedded: receive the card's selection events, validate the selected state on your server, and continue through the approved Travel Insured API or payment workflow for your account.

The component runtime and interactive test harness remain on the Product Web Component application.

Why Use It

The Product Quote Card can reduce the front-end work needed to present Travel Insured products while preserving a choice of downstream ownership. The verified component supports:

AreaSupported behavior
Product renderingOne or more dynamically rated products, plan names, prices, coverage details, carousel or grid layouts, and standard or comparison card variants
Coverage experienceBase coverage details, supported optional add-ons, updated price display, and coverageChanged events
SelectionProduct selection, a versioned selectedPlan event, and configurable CTA text
Purchase handoffDirect URL navigation or an event-driven partner handoff
PresentationCSS custom properties, allowlisted stylesheet injection, responsive layouts, localization controls, and product-detail display controls

Product availability, optional coverages, destinations, branding rules, and enabled markets are account-specific and provided during onboarding.

Choose Your Integration Model

IntegrationProduct UI ownerPurchase UI ownerPartner effort and controlBest fit
Expedited EmbeddedTravel Insured card in partner siteTravel Insured after Pay NowFastest embedded onboarding; Travel Insured owns the downstream consumer flowPartners that do not want to build the full insurance-shopping and purchase UI
Hybrid EmbeddedTravel Insured card in partner sitePartner-controlled approved flowModerate implementation; partner handles events and server validationPartners that want embedded shopping with more control after selection
Direct GraphQL APIPartnerPartnerMaximum implementation controlPartners building and orchestrating the complete quote-to-purchase experience
Hosted PaymentPartner upstream experienceTravel Insured-hosted payment entryDepends on the upstream integrationPartners that own the purchase flow but use Travel Insured payment entry and processing

Use the API Integration Guide for Direct GraphQL and the Payment Integration Guide for Hosted Payment.

Architecture

Expedited Embedded

MERMAID
sequenceDiagram
    participant Customer
    participant UI as Partner website
    participant API as Partner backend
    participant Auth as TII embed auth
    participant Quote as TII quote service
    participant Card as Product Quote Card
    participant Purchase as TII purchase experience

    Customer->>UI: Enter trip and traveler information
    UI->>API: Request quote experience
    API->>Auth: POST embed-token with apiToken and accessKey
    Auth-->>API: Short-lived embedToken
    API->>Quote: Create quote with Bearer embedToken
    Quote-->>API: Quote number and rated products
    API-->>UI: Client-safe quote response
    UI->>Card: Set quote-request-input
    Card-->>Customer: Render products and coverages
    Customer->>Card: Select product and optional coverages
    Customer->>Card: Select Pay Now
    Card->>Purchase: Navigate to configured TII destination
    Purchase-->>Customer: Continue purchase experience

apiToken and accessKey stay on the partner backend. The recommended flow also uses embedToken server-side to pre-fetch the quote, then gives the browser only the quote response and client-safe component configuration.

Hybrid Embedded

MERMAID
sequenceDiagram
    participant Customer
    participant UI as Partner website
    participant API as Partner backend
    participant Card as Product Quote Card
    participant TII as Travel Insured APIs

    Customer->>UI: Enter trip and traveler information
    UI->>API: Request quote experience
    API->>TII: Authenticate and create quote
    TII-->>API: Quote number and rated products
    API-->>UI: Client-safe quote response
    UI->>Card: Set quote-request-input
    Card-->>Customer: Render products and coverage options
    Customer->>Card: Select product or optional coverage
    Card-->>UI: coverageChanged and selectedPlan
    UI->>API: Submit selected identifiers and state
    API->>TII: Revalidate and continue approved workflow

Browser event data is untrusted input. Retrieve or validate the quote, product, price, eligibility, expiry, and applicable coverage state on the server before a sensitive downstream operation.

Authentication and Embed Token

Travel Insured supplies these partner credentials through an approved onboarding channel:

CredentialUsed byPurpose
apiTokenPartner backend onlyPartner API credential used to request an embed token
accessKeyPartner backend onlyPartner access credential used with apiToken
embedTokenPartner backend; browser only when client-side quote fetching is requiredShort-lived JWT scoped to quote operations and an allowed origin

Never expose apiToken or accessKey in HTML, JavaScript bundles, component attributes, query strings, browser storage, logs, analytics, screenshots, or version control.

Request an embed token

Your backend calls:

HTTP
POST https://productwebc-sbtii.azurewebsites.net/api/auth/embed-token
Content-Type: application/json
JSON
{
  "apiToken": "<server-side-api-token>",
  "accessKey": "<server-side-access-key>",
  "allowedOrigin": "https://partner.example",
  "scopes": ["quote:create", "quote:read"]
}
JSON
{
  "embedToken": "<short-lived-jwt>",
  "expiresIn": 3600
}

The documented token lifetime is 3,600 seconds. Cache it server-side by allowed origin and scopes, refresh it before expiry, and request a new token after a 401. The allowedOrigin must be registered with Travel Insured and must match the browser origin for browser-originated quote requests.

Sandbox URLs are shown here to document the contract. Production service and component URLs are provided by Travel Insured during onboarding.

Create a Quote

All sandbox quote endpoints use Authorization: Bearer <embedToken>.

EndpointPurposeRequired scope
POST /api/quotesCreate and rate a new quotequote:create

POST /api/quotes accepts the trip, residency, destination, and traveler request below. Dates use YYYY-MM-DD; at least one destination and traveler are required; exactly one traveler is primary; and tripCost is a positive per-traveler amount in the requested currency.

HTTP
POST https://productwebc-sbtii.azurewebsites.net/api/quotes
Authorization: Bearer <embed-token>
Content-Type: application/json
JSON
{
  "agencyNumber": "AGENCY-EXAMPLE",
  "agentId": "AGENT-EXAMPLE",
  "quoteNumber": null,
  "groupNumber": null,
  "residencyCountryIsoCode": "US",
  "residencyStateIsoCode": "FL",
  "language": "en",
  "currency": "USD",
  "tripType": "AIR",
  "trip": {
    "departureDate": "2027-06-10",
    "depositDate": null,
    "finalPaymentDate": null,
    "returnDate": "2027-06-22",
    "destinations": [
      {
        "countryIsoCode": "TR",
        "stateIsoCode": null
      }
    ],
    "travelers": [
      {
        "id": 1,
        "primaryTraveler": true,
        "dateOfBirth": "1994-02-16",
        "firstName": "Alex",
        "lastName": "Example",
        "email": "alex@example.com",
        "tripCost": 6000
      }
    ]
  }
}
FieldRequirement
agencyNumberRequired account identifier assigned by Travel Insured
agentId, groupNumberOptional or account-specific attribution values; omit or send null when not assigned
quoteNumbernull for a new quote; use the saved quote identifier only for the approved re-rate flow
residencyCountryIsoCodeRequired ISO country code
residencyStateIsoCodeRequired when the residency country or enabled product requires a state
language, currency, tripTypeRequired request context using values enabled for the account
trip.departureDate, trip.returnDateRequired ISO dates with return after departure
trip.depositDate, trip.finalPaymentDateOptional lifecycle dates; send null when not applicable
trip.destinationsAt least one destination with countryIsoCode; stateIsoCode is conditional
trip.travelersAt least one traveler with a stable request id, exactly one primaryTraveler, date of birth, name, and positive tripCost; email is included for the primary traveler in the supported browser contract

Representative response:

JSON
{
  "quoteNumber": "Q-EXAMPLE-001",
  "products": [
    {
      "productId": 2001,
      "productCode": "PARTNER_STANDARD",
      "productName": "Partner Standard",
      "productDescription": "Flexible protection for the covered journey",
      "upsellProduct": null,
      "imageUrl": "https://cdn.example.test/products/partner-standard.png",
      "availablePaymentMethod": [],
      "coverages": [
        {
          "available": true,
          "customDates": false,
          "productCoverageId": 101,
          "productCoverageType": "Trip Cancellation",
          "productCoverageTypeCode": "TC",
          "productCoverageExplanation": "Covers eligible trip cancellation",
          "coverageClassification": "Base",
          "selected": false,
          "coverageLimits": [
            {
              "maxPerPlanLimitAmount": 6000,
              "maxPerPersonLimitAmount": 6000,
              "productCoverageLimitId": 1001,
              "additionalText": "Coverage up to the eligible trip cost",
              "totalPrice": 124.5,
              "travelerBreakdown": [
                { "id": 1, "price": 124.5 }
              ]
            }
          ],
          "benefits": [
            {
              "categoryName": "Trip Protection",
              "description": "Trip cancellation or interruption",
              "limit": "100%",
              "limitDescription": "Up to the eligible trip cost",
              "toolTip": "Covered reasons apply"
            }
          ]
        }
      ]
    }
  ]
}

Retain quoteNumber, productId, productCode, and the response-derived coverage and coverage-limit identifiers on the trusted server. The card needs the complete client-safe response to render. selectedPlan identifies the chosen quote and product for a Hybrid handoff; coverageChanged is a browser selection signal that still requires server validation. Expedited Pay Now uses the documented URL placeholders, subject to the optional-coverage owner-confirmation gap below.

Keep partner credentials and the authoritative quote request on the server. Pass only the short-lived embedToken when browser-side fetching is required, or preferably pass the client-safe quote response. Treat every identifier, price, event, and changed coverage returned by the browser as untrusted and revalidate it before purchase, payment, or issuance.

The component supports two input models:

  1. Pre-fetched response, recommended: the partner backend calls POST /api/quotes, then passes the complete response to quote-request-input. The component renders without another API request.
  2. Client-side request: pass quote request parameters to quote-request-input, set api-base-url, and set the short-lived embed-token. The component calls the quote service from the browser.

The pre-fetched model minimizes browser authorization and is recommended for both Expedited and Hybrid integrations.

Render Dynamic Products

Load the module once, wait for custom-element registration when your framework requires it, and set the quote response as a JSON string.

HTML
<script type="module" src="https://productwebc-sbtii.azurewebsites.net/component/tii-product-card/tii-product-card.esm.js"></script>

<product-quote-card
  id="quote-card"
  api-base-url="https://productwebc-sbtii.azurewebsites.net"
  button-text="Buy Now"
  view-mode="carousel">
</product-quote-card>

<script type="module">
  const card = document.querySelector('#quote-card');
  card.setAttribute('quote-request-input', JSON.stringify(quoteResponse));
  card.addEventListener('selectedPlan', ({ detail }) => submitSelectionToPartnerBackend(detail));
  card.addEventListener('coverageChanged', ({ detail }) => updateDisplayedSelection(detail));
</script>

quoteResponse is the complete response returned by your backend. Do not put apiToken or accessKey in this code or on the element.

Product and Coverage Features

Rated products can include productId, productCode, productName, coverage collections, product details, and pricing. The card can present one or multiple products, product details, base coverages, and optional add-ons returned for the partner's enabled catalog.

The display and event contract does not make browser state authoritative. In Hybrid integrations, retain identifiers from the current quote response and validate them server-side before purchase staging, payment, or policy issuance.

Pay Now and Travel Insured Purchase Handoff

For Expedited Embedded, Travel Insured provides the environment- and partner-specific purchase destination during onboarding. Configure the CTA in URL mode:

HTML
<product-quote-card
  button-text="Pay Now"
  button-url="https://purchase.example/quote/{quoteNumber}/product/{productCode}?productId={productId}"
  enable-internal-navigation="true">
</product-quote-card>
AttributeBehavior
button-urlURL template that replaces {quoteNumber}, {productCode}, and {productId} at click time
buy-now-urlNavigates to the configured URL without documented placeholder expansion
enable-internal-navigationMust be true to enable component navigation; defaults to false
button-textCTA label; defaults to Buy Now

When button-url or buy-now-url is configured, the component navigates instead of emitting selectedPlan. Use the exact Travel Insured destination supplied for your account; the example hostname above is documentation-only.

Hybrid Partner-Controlled Handoff

Omit button-url and buy-now-url so the CTA emits selectedPlan. Listen for both supported events and send the required selection to your backend over an authenticated partner session. Your backend then retrieves or validates authoritative state and continues through the approved API or Hosted Payment flow.

Do not use URL navigation and a selectedPlan listener as competing handoff mechanisms.

Component API

The custom element name is product-quote-card. Attribute values are strings; pass quote-request-input with JSON.stringify(...).

Core and CTA attributes

AttributeRequiredDefaultAllowed values or behavior
quote-request-inputYesNoneFull BFF quote response or quote request parameters as JSON
api-base-urlFor cross-origin or component fetchNoneAssigned BFF base URL
embed-tokenFor component fetchNoneShort-lived JWT sent as Authorization: Bearer
button-textNoBuy NowCTA label
button-urlNoNoneTemplate supporting {quoteNumber}, {productCode}, {productId}
buy-now-urlNoNoneDirect navigation URL
enable-internal-navigationNofalsetrue enables URL-mode navigation
view-modeNocarouselcarousel, grid
card-variantNostandardstandard, comparison
container-variantNononenone, comparison-shell
languageNoenen, fr; forwarded to quote API
localeNoDeriveden-CA, fr-CA; display-only UI chrome
currencyNoUSDUSD, CAD
trip-typeNoOTHERCRUISE, OTHER

The legacy api-token and access-key attributes are deprecated. Do not use them; exposing those credentials in the browser violates the security boundary.

Product detail and presentation attributes

AttributeDefaultPurpose
logo-src / logo-altNone / Product logoProduct header image and accessible alternative text
show-cancellation-reasonstrueShow cancellation reasons in plan details
show-interruption-reasonstrueShow interruption reasons in plan details
show-assistance-servicestrueShow assistance services in plan details
show-eligibilitytrueShow eligibility in plan details
show-purchase-add-ons-listtrueShow optional add-ons list
show-purchase-add-ons-tabtrueShow the add-ons tab
show-plan-selectorfalseShow comparison-shell selection controls
show-coverage-headerstrueShow coverage section headings
custom-stylesheet-urlNoneInject an approved stylesheet into Shadow DOM
custom-stylesheet-allowed-originsNoneComma-separated external stylesheet origin allowlist
agency-numberNoneSelect a Travel Insured-managed partner stylesheet when configured

Comparison-shell, market-variant, and single-offer presentation controls are available only when enabled for the account. Confirm their configured product rules and copy with Travel Insured during onboarding rather than inferring market behavior.

Event Reference

Both events are bubbling and composed CustomEvent instances and cross the component's Shadow DOM boundary.

selectedPlan

Fires when the user selects the CTA in event-driven mode. It does not fire when button-url or buy-now-url controls navigation.

JSON
{
  "contractVersion": "1.0.0",
  "quoteNumber": "bcymm",
  "productCode": "WHLTH",
  "productId": 123
}

Use contractVersion for compatibility checks. Submit the identifiers to your backend, then validate the quote and product before downstream operations. The event is a user-selection signal, not authoritative purchase state.

coverageChanged

Fires when a customer toggles a supported optional add-on on a card or in the plan-detail modal.

JSON
{
  "contractVersion": "1.0.0",
  "quoteNumber": "bcymm",
  "productCode": "WHLTH",
  "productId": 123,
  "coverageType": "<coverage-identifier>",
  "checked": true,
  "totalPrice": 412.5,
  "source": "modal"
}

source is card or modal. Use the event to update partner-controlled display state and send the selection to your backend in a Hybrid integration. Do not treat totalPrice or coverage selection as authoritative without server validation. Its relationship to URL-mode Pay Now remains the owner-confirmation gap documented above.

Styling and Branding

The component uses Shadow DOM, so ordinary page selectors do not style its internals. Prefer CSS custom properties on the element or an ancestor:

CSS
product-quote-card {
  --quote-card-font-family: "Source Sans 3", sans-serif;
  --quote-card-bg: #ffffff;
  --quote-card-text-color: #263238;
  --quote-card-price-color: #005eb8;
  --quote-card-border-color: #c5d0d6;
  --quote-card-border-radius: 8px;
  --quote-card-button-bg: #0d5cab;
  --quote-card-button-hover-bg: #0a4a96;
  --quote-card-button-color: #ffffff;
  --quote-card-button-focus-outline: 2px solid rgba(13, 92, 171, 0.45);
}

External stylesheets must use HTTPS outside local development. Same-origin stylesheets are allowed; other origins must appear in custom-stylesheet-allowed-origins. Travel Insured's supported customization limits and partner branding approval still apply.

Framework Examples

React and Next.js

Load the module in an effect, wait for registration, set JSON through the DOM element, and attach native custom-event listeners.

TSX
'use client';

import { useEffect, useRef } from 'react';

export function ProductQuoteCard({ quoteResponse }: { quoteResponse: unknown }) {
  const cardRef = useRef<HTMLElement>(null);

  useEffect(() => {
    if (!customElements.get('product-quote-card')) {
      const script = document.createElement('script');
      script.type = 'module';
      script.src = 'https://productwebc-sbtii.azurewebsites.net/component/tii-product-card/tii-product-card.esm.js';
      script.dataset.productQuoteCard = 'true';
      document.head.appendChild(script);
    }

    void customElements.whenDefined('product-quote-card').then(() => {
      cardRef.current?.setAttribute('quote-request-input', JSON.stringify(quoteResponse));
    });

    const card = cardRef.current;
    const onSelected = (event: Event) => submitSelectionToPartnerBackend((event as CustomEvent).detail);
    card?.addEventListener('selectedPlan', onSelected);
    return () => card?.removeEventListener('selectedPlan', onSelected);
  }, [quoteResponse]);

  return <product-quote-card ref={cardRef} view-mode="carousel" />;
}

For Next.js, keep this in a Client Component. Acquire the quote or embed token through a server-only route; never read apiToken or accessKey from a NEXT_PUBLIC_ variable. Render the custom element only in the browser to avoid server-side custom-element and hydration failures.

Vue and Nuxt

Tell the Vue compiler that the tag is a custom element:

TypeScript
export default defineNuxtConfig({
  vue: {
    compilerOptions: {
      isCustomElement: (tag) => tag === 'product-quote-card',
    },
  },
});

In Vue 3, use an element ref, wait for customElements.whenDefined('product-quote-card'), call setAttribute('quote-request-input', JSON.stringify(quoteResponse)), and attach selectedPlan and coverageChanged with addEventListener. Vue 2 can add product-quote-card to Vue.config.ignoredElements.

Accessibility and Responsive Behavior

The card is responsive and offers carousel, grid, comparison, and account-configured market layouts. The host page remains responsible for the complete experience around it:

  • Give the quote region an accessible name and preserve logical heading and focus order.
  • Announce loading, errors, and completed host actions without relying on color alone.
  • Preserve the component's visible focus indicators and accessible logo text.
  • Test keyboard operation, plan-detail modal focus, screen readers, 200% zoom, 320 CSS-pixel reflow, contrast, and reduced motion.
  • Test every enabled product, optional coverage, language, currency, and supported viewport.

Automated checks cannot establish WCAG 2.2 Level AA conformance. Complete manual keyboard and assistive-technology review before launch. The current public contract does not list a browser support matrix; confirm supported browser versions during onboarding.

Testing and Test Harness

The Product Quote Card Integration Harness is a sandbox/testing tool. It can request an embed token, create or load a quote, inspect BFF JSON, render the component, change supported layout and theme controls, test URL or event handoffs, and inspect selectedPlan and coverageChanged payloads.

Use only assigned sandbox credentials and synthetic data. The harness stores entered partner credentials in page memory for the active test; do not use production credentials or shared screenshots. The harness and component runtime are supporting tools, not a second canonical documentation source.

Troubleshooting

SymptomLikely causeAction
Embed-token request returns 401Invalid, expired, revoked, or wrong-environment credentialsConfirm the server-side apiToken and accessKey with Travel Insured
Embed-token request returns 403Account lacks embed permissionRequest embed enablement through onboarding support
Quote returns INVALID_ORIGINBrowser origin differs from token allowedOriginUse the exact registered origin, including scheme and port
Quote returns AGENCY_MISMATCHRequest agency differs from credential mappingUse the agency assigned to the same credentials
No products are returnedNo enabled product matches input or account configurationVerify input, market, currency, catalog, and response correlation ID
Component remains loadingInvalid JSON, unreachable api-base-url, or script registration failureInspect Network and Console; pass JSON.stringify(quoteResponse) and await registration
selectedPlan does not fireURL mode is configuredRemove button-url and buy-now-url for event-driven Hybrid mode
Pay Now does not navigateInternal navigation is disabled or destination is invalidSet enable-internal-navigation="true" and use the assigned destination
Coverage price differs downstreamBrowser state is stale or coverage transfer is not definedRevalidate server-side; do not assume URL mode propagates changed coverages
Vue cannot resolve the elementMissing custom-element compiler configurationAdd isCustomElement or the Vue 2 ignored-element setting
React or Next.js hydration failsComponent loaded during server renderingLoad it in a Client Component effect after mount

Include the safe correlationId, environment, component version, and contract version in a support request. Never include credentials, tokens, or unnecessary traveler data.

Production Readiness

  • Confirm production BFF, component, and Travel Insured purchase destination URLs.
  • Confirm registered origins, scopes, agency mapping, product catalog, markets, languages, and currencies.
  • Keep apiToken and accessKey in an approved server-side secret store and bound all partner-facing requests.
  • Pin or control component versions according to the release policy supplied during onboarding.
  • Validate loading, empty, error, expiry, wrong-origin, stale-quote, replay, and unavailable-service states.
  • Verify server authorization and quote/product revalidation for Hybrid flows.
  • Resolve and test the optional-coverage state-transfer contract before enabling Expedited Pay Now with selectable add-ons.
  • Complete functional, security, privacy, accessibility, responsive, monitoring, rollback, and support reviews.

Complete the testing, certification, and production-readiness activities assigned through onboarding before launch.

Still need help?

Reach out to your account manager for support.