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#
No authentication header is needed for this endpoint.
Query parameters#
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#
Your store identifier (the myshopify.com domain on Shopify). shop is accepted as an alias.
One of SHOPIFY, BIGCOMMERCE, SHIFT4SHOP, LIGHTSPEED, LIGHTSPEED_R_SERIES, MAGENTO, WOOCOMMERCE.
Two-letter country code of the shopper, US or CA.
The visit identifier returned by the widget configuration call for this shopper session.
The platform cart token. When sent, SureBright reads the cart lines from the platform. Required unless you send productId, variantId and quantity.
Product being added to the cart. Required with variantId and quantity when there is no cartId.
Variant being added to the cart.
Quantity being added.
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#
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.
quoteIdstringQuote identifier. Send it with the selected quoteItemId when you record the order.
statusMessagestringPOLICY_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.
isCartModifiedbooleantrue when SureBright changed the plan line already in the cart to match the new covered items.
policyCartLineItemIdstringThe cart line of the plan SureBright added or updated, when isCartModified is true.
storeProductIdstringEcho of productId.
storeVariantIdstringEcho of variantId.
coverageV1objectCoverage bullets for the widget: info, popup, MOBILE_INFO, QUICK_VIEW_INFO, each a list of {coverageName, optionType, iconType}.
tncLinkstringLink to the plan's terms.
Errors#
Responses are not cached. Each call returns a fresh quote.