Cart quotes

Price a protection plan for a cart, so one plan covers every eligible item the shopper has added.

POST https://{HOST_NAME}/quote/api/cart/listQuotes

Use this endpoint when the widget sits on the cart page or in a cart drawer and you want one plan that covers the eligible items in the cart, instead of one plan per product. SureBright reads the cart, works out which items are eligible, prices the plan on their combined value, and returns the same quote object the product endpoints return.

For a single product on a product page, use By Product instead.

Headers#

HeaderDescriptionRequired
Content-Typeapplication/jsonYes

No authentication header is needed for this endpoint.

Query parameters#

string

SYNC to have the quote saved before the response is returned. Send it when you will record an order with the returned quoteId and quoteItemId. Default ASYNC.

Body#

stringrequired

Your store identifier (the myshopify.com domain on Shopify). shop is accepted as an alias.

stringrequired

One of SHOPIFY, BIGCOMMERCE, SHIFT4SHOP, LIGHTSPEED, LIGHTSPEED_R_SERIES, MAGENTO, WOOCOMMERCE.

stringrequired

Two-letter country code of the shopper, US or CA.

stringrequired

The visit identifier returned by the widget configuration call for this shopper session.

string

The platform cart token. When sent, SureBright reads the cart lines from the platform. Required unless you send productId, variantId and quantity.

string

Product being added to the cart. Required with variantId and quantity when there is no cartId.

string

Variant being added to the cart.

number

Quantity being added.

object[]

Items already covered by a plan in the cart (productId, variantId, quantity). When empty, policyAmountOffset on each plan equals the plan price; otherwise it is the difference against the plan already in the cart.

Example request#

bash
curl -X POST 'https://{HOST_NAME}/quote/api/cart/listQuotes?quoteSyncMode=SYNC' \
  -H 'Content-Type: application/json' \
  -d '{
    "storeId": "example-store.myshopify.com",
    "platform": "SHOPIFY",
    "country": "US",
    "visitId": "6a0d0c1e-2b4f-4d8e-9f21-3c5e7a9b1d2f",
    "cartId": "c1-0f4a9b2e7d6c5b4a3f2e1d0c9b8a7f6e",
    "cartItemList": []
  }'

Response#

The body is the standard quote object. The fields below are specific to cart quotes; the rest are described on By Product.

quoteIdstring

Quote identifier. Send it with the selected quoteItemId when you record the order.

statusMessagestring

POLICY_FETCHED_SUCCESSFULLY when plans were found. Otherwise the reason, for example STORE_DETAILS_NOT_FOUND or POLICY_BAND_NOT_FOUND.

PolicyDataobject[]

One entry per plan. Each carries quoteItemId, price, monthlyPrice, coverageYears, deductibleAmount, defaultSelection, and the store's plan productId and variantId to add to the cart.

coveredProductListobject[]

The cart items the plan covers: productId, variantId, quantity, sku, price.

isCartModifiedboolean

true when SureBright changed the plan line already in the cart to match the new covered items.

policyCartLineItemIdstring

The cart line of the plan SureBright added or updated, when isCartModified is true.

storeProductIdstring

Echo of productId.

storeVariantIdstring

Echo of variantId.

coverageV1object

Coverage bullets for the widget: info, popup, MOBILE_INFO, QUICK_VIEW_INFO, each a list of {coverageName, optionType, iconType}.

tncLinkstring

Link to the plan's terms.

Errors#

CodeBodyMeaning
200statusMessage other than POLICY_FETCHED_SUCCESSFULLY, empty PolicyDataNo plan for this cart (store, product or price not covered)
400{"isError": true, "message": "Insufficient params"}country, visitId, platform or storeId missing, or neither cartId nor productId + variantId + quantity sent
500{"isError": true, "message": "Internal Server Error"}Unexpected failure

Responses are not cached. Each call returns a fresh quote.