By Category
Get the protection plans and prices for a SureBright category and product price, without a product in your catalogue. Parameters, example request and response, and errors.
GET https://{HOST_NAME}/quote/api/quote/category/listQuotes
Use this endpoint to price protection plans from a category and a product price, when the item is not a product SureBright can look up in your store's catalogue. It suits quoting tools, in-store sales and custom checkouts. One call can price several items, and the IDs it returns are the ones Create Contracts for Order accepts.
Get the category IDs from List Category first. If the item is in your store's catalogue, By Product or By Url is simpler, and for a whole cart use Cart quotes.
Note#
All quote inputs go inside the payload JSON, which is sent Base64-encoded (UTF-8) as a query parameter. Send quoteSyncMode=SYNC when you will record an order with the returned quoteId and quoteItemId.
Headers#
No authentication header is needed for this endpoint.
Query parameters#
Payload fields#
Example request#
The payload before encoding:
{
"storeParentId": "{storeParentId}",
"country": "US",
"visitId": "3d99a4ae-5cf0-4d87-8436-46c0cdc03676",
"platform": "OFFLINE_PORTAL",
"storeCategoryList": [
{ "sbCategoryId": "4c3103e4-38dc-4171-96e5-b4b77ab0e96f", "productPrice": 899.99 }
]
}Encode it and call the endpoint. --data-urlencode takes care of the +, / and = characters in the Base64 string.
PAYLOAD=$(printf '%s' '{"storeParentId":"{storeParentId}","country":"US","visitId":"3d99a4ae-5cf0-4d87-8436-46c0cdc03676","platform":"OFFLINE_PORTAL","storeCategoryList":[{"sbCategoryId":"4c3103e4-38dc-4171-96e5-b4b77ab0e96f","productPrice":899.99}]}' | base64 | tr -d '\n')
curl -G 'https://{HOST_NAME}/quote/api/quote/category/listQuotes' \
--data-urlencode "payload=${PAYLOAD}" \
--data-urlencode 'quoteSyncMode=SYNC'Example response#
200, trimmed to the fields you are most likely to use:
{
"quoteList": [
{
"quoteId": "33f21a29-95ca-4150-b5df-afe36f5ef537",
"sbCategoryId": "4c3103e4-38dc-4171-96e5-b4b77ab0e96f",
"storeCategoryId": "ecca4210-09a4-446c-ad87-5e65bd50df12",
"country": "US",
"productPrice": 899.99,
"coverageType": "AD",
"quoteItemList": [
{
"quoteId": "33f21a29-95ca-4150-b5df-afe36f5ef537",
"quoteItemId": "a7defcbd-aa07-4e01-9076-c1935af20a98",
"coverageYears": "1",
"policyPrice": "79",
"lowerPrice": 749.99,
"upperPrice": 999.99,
"storeProductVariantPrice": "899.99"
}
],
"coverageList": [
{
"optionType": "COVERAGE_OPTION",
"info": "Coverage bullet shown to the shopper",
"popup": "Coverage bullet shown in the details popup"
}
]
}
]
}Errors#
Behaviour notes#
An entry with no plan is left out. The call still returns
200. If nothing can be priced,quoteListis empty. Do not match quotes to entries by position; usesbCategoryIdorstoreCategoryId.What stops an entry being priced. The category ID is not set up for your store,
countrydiffers from the category's country, no price band containsproductPrice, or the entry carriessbCategoryIdwhile the payload has nostoreParentId.Every call creates new quotes. Each priced entry gets a fresh
quoteIdon every call.Use
SYNCbefore creating contracts. With the default mode the quote is saved in the background, so a create call sent immediately afterwards may not find it.sbCategoryIdwins. When an entry has both IDs and the payload hasstoreParentId, the entry is quoted bysbCategoryId.platform: SHOPIFY. Each quote comes back in the storefront widget format instead, with plans underPolicyDataas described on Cart quotes.
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/category/listQuotesLists warranty quote options for one or more products, by category and product price. Each quoteItemList entry carries a quoteId and quoteItemId; send these in planDetails when recording the order.
Query parameters
payloadstringrequiredBase64-encoded (UTF-8) JSON object. All quote inputs go inside this object, not as separate query parameters.
| Field | Type | Required | Description |
|---|---|---|---|
| country | string | Yes | Alpha-2 country code of the customer, e.g. US |
| visitId | string | Yes | Any unique identifier for the shopper session |
| platform | string | Yes | Calling platform, e.g. OFFLINE_PORTAL |
| storeParentId | string | Yes, unless storeId is sent | Unique identifier for the store parent. Required when quoting by sbCategoryId |
| storeId | string | Yes, unless storeParentId is sent | A unique identifier for a store |
| province | string | No | State or province code of the customer |
| storeCategoryList | array | Yes | One entry per product to quote. Must not be empty |
| storeCategoryList[].sbCategoryId | string | sbCategoryId or storeCategoryId | SureBright category ID from List Categories |
| storeCategoryList[].storeCategoryId | string | sbCategoryId or storeCategoryId | Store category ID from List Categories |
| storeCategoryList[].productPrice | number | Yes | Price of the product being protected |
| storeCategoryList[].sbProductId | string | No | SureBright product ID |
| storeCategoryList[].manufacturerWarrantyDuration | integer | No | Manufacturer warranty, in months |
Example: JSON before Base64 encoding
{
"storeParentId": "13612f29-8ec5-49ad-bab1-5ab09b51367e",
"country": "US",
"visitId": "3d99a4ae-5cf0-4d87-8436-46c0cdc03676",
"platform": "OFFLINE_PORTAL",
"storeCategoryList": [
{
"sbCategoryId": "4c3103e4-38dc-4171-96e5-b4b77ab0e96f",
"productPrice": 199.99
}
]
}eyJzdG9yZVBhcmVudElkIjoiMTM2MTJmMjktOGVjNS00OWFkLWJhYjEtNWFiMDliNTEzNjdlIiwiY291bnRyeSI6IlVTIiwidmlzaXRJZCI6IjNkOTlhNGFlLTVjZjAtNGQ4Ny04NDM2LTQ2YzBjZGMwMzY3NiIsInBsYXRmb3JtIjoiT0ZGTElORV9QT1JUQUwiLCJzdG9yZUNhdGVnb3J5TGlzdCI6W3sic2JDYXRlZ29yeUlkIjoiNGMzMTAzZTQtMzhkYy00MTcxLTk2ZTUtYjRiNzdhYjBlOTZmIiwicHJvZHVjdFByaWNlIjoxOTkuOTl9XX0=
quoteSyncModestringSend SYNC to save the quote before the response returns, so its quoteId and quoteItemId can be used to record an order straight away.
SYNC