By Product
Get the protection plans and prices for a platform product and variant in a given country. Parameters, example request and response, and errors.
GET https://{HOST_NAME}/quote/api/quote/listWarrantyQuotes
Use this endpoint to price protection plans for one product variant, for example on a product page. You identify the product by the productId and variantId it has in your store. SureBright returns the plans it can offer for that variant, each with a price, a tenure and the plan product to add to the cart.
The product has to be in the catalogue SureBright holds for your store. Pick the quote endpoint by what you know about the item:
Headers#
Query parameters#
Example request#
curl 'https://{HOST_NAME}/quote/api/quote/listWarrantyQuotes?platform=SHOPIFY&storeId=example-store.myshopify.com&productId=8606368530686&variantId=45667967238398&country=US'Example response#
200, trimmed to the fields you are most likely to use:
{
"warrantyQuoteId": "929d14dd-2937-4290-9818-8fca2a00a9a3",
"productTitle": "Example Espresso Machine",
"categoryName": "Small Home Appliance",
"sbCategoryId": "4c3103e4-38dc-4171-96e5-b4b77ab0e96f",
"coverageWidgetHeading": "Add premium product protection",
"warrantyQuoteItemList": [
{
"warrantyQuoteItemId": "8c78bc1a-0790-4cd3-a3f9-5ed97bbe59f5",
"warrantyTenure": 2,
"warrantyPrice": 64.99,
"warrantyProductId": 7080029454439,
"warrantyVariantId": 40937702359143,
"policyProductSKU": "SBW-1U-SHAB-2900"
}
],
"coverageList": [
{
"coverageItemType": "COVERAGE_OPTION",
"coverageItemTitle": "Your warranty plan provides,",
"coverageItemList": ["Coverage bullet shown to the shopper"]
},
{
"coverageItemType": "WHY_SUREBRIGHT_OPTION",
"coverageItemTitle": "Why Surebright?",
"coverageItemList": ["Benefit bullet shown to the shopper"]
}
],
"tncLink": "https://customer.surebright.com/t-c/..."
}Errors#
Every error has the shape below. The HTTP status code and errorType carry the same value.
{ "isError": true, "errorType": 504, "errorMessage": "PRODUCT_NOT_ELIGIBLE" }See HTTP status codes for the full list shared with By Url.
Behaviour notes#
No plan is an error, not an empty list. When a product cannot be covered you get one of the
504,505or500bodies above instead of an emptywarrantyQuoteItemList. Hide the offer on any status other than200.What makes a product ineligible. The product is missing from the catalogue SureBright holds for your store, it is marked as not eligible, protection is switched off for it, its price is zero or missing, there is no plan priced for its category and price, or plans are not offered in the shopper's country for your store.
Quotes can be reused. Calling again for the same store, product, variant and country can return the same
warrantyQuoteIdand item IDs.statedoes not change the price on this endpoint.Recording the sale yourself. This endpoint takes no
quoteSyncMode. If you create contracts through Create Contracts for Order, quote with By Category, which can save the quote before it responds.
Country and State Codes#
Country codes (Alpha 2): IBAN Country Codes
US State codes: FIPS State Codes
Related#
https://api.surebright.com/quote/api/quote/listWarrantyQuotesThis endpoint retrieves a list of warranty quotes for a specific product and its price.
Query parameters
platformstringThe platform of the merchant's store. Defaults to SHOPIFY when omitted.
SHOPIFYstoreIdstringrequiredThe unique identifier for the merchant's store. This is typically the store's domain name (e.g., 'yourstore.myshopify.com' for Shopify stores).
strictlyapple.myshopify.comproductIdstringrequiredThe ID of the product that is shown to the customer
8606368530686variantIdstringrequiredThe ID of the variant that is shown to the customer
45667967238398countrystringrequiredThe country code of the identified customer location
USstatestringThe state code of the identified customer location. Accepted but not currently used by this endpoint.
AL