Skip to content

Quotes

Quotes are available on a ready questionnaire as q.quotes.

if (q.ready) {
const quoteSet = await q.quotes.wait();
}

Polls until the quote set settles, honouring the server’s Retry-After.

  • options.timeoutMs (optional): default 120000. Rejects with TimeoutError after this.
  • options.signal (optional): an AbortSignal.

Returns Promise<QuoteSet>.

Caveats: if quoting fails, rejects with QuoteFailedError. Call its retry().


Polls once. Returns { state: "quoting", retryAfterMs } or { state: "quoted", quoteSet }.


  • quotes: Quote[].
  • quoteComparisonUrl: the signed URL to send the customer to. Pass it through untouched.
  • raw: the response body.

The wire fields (id, insurer, decision, premium, policy_expiry, …) plus:

Returns Promise<QuoteDetail>: covers, insurer responses and reference.

Chooses this quote; it’s carried to purchase. Returns Promise<void>.

Caveats: referred and declined quotes can’t be selected: this throws AffordanceUnavailableError.

const quoteSet = await q.quotes.wait();
const quote = quoteSet.quotes.find((x) => x.decision === 'quoted');
if (quote) await quote.select();
location.assign(quoteSet.quoteComparisonUrl);

Use toQuoteCards for formatted premiums and a selectable flag.