Surebright API Documentation
Introduction :
Surebright API first solution allows merchants to offer product protection plans to their customers with complete peace of mind. Through its unique proprietary technology, Surebright does all the heavy lifting from offering merchandising, to capturing contracts, to handling claims, to seamless end-to-end customer experiences. Our Industry first AI solutions handle the product categorisation automatically, taking away all the operational heavy lifting from merchants.
This documentation will guide you through the process of getting up and running with Surebright so you’ll be offering best-in-class product protection to your customers in no time.
Authentication:
The Surebright API uses private API keys to authenticate requests in the header 'X-Surebright-Access-Token'. You can view and manage your API key from the Surebright Merchant Portal under Account Settings.
Your API key carries many privileges so be sure to keep it secure! Do not share your secret API keys in any publicly accessible areas like GitHub, client-side code, etc.
All API requests must be made over HTTPS. Calls made over plain HTTP will fail, as will API requests without proper authentication.
Security Scheme Type | API Key |
---|---|
Header parameter name | X-Surebright-Access-Token |
Example Sandbox Request:
curl -X GET \
https://api-demo.surebright.com/api/v1/store/listProducts \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'X-Surebright-Access-Token: {sandbox access token}'
Quote API :
Generate quotes to be shown for a product in a particular country and province/state
- Generate Quote by Product URL & price :
Method : GET
/api/v1/quote/listQuotes
Header
X-Surebright-Access-Token | Not Required |
---|
Query Params
Param | Description | Data Type | Mandatory | Example |
---|---|---|---|---|
storeId | A unique identifier for a store ; To be shared as part of integration kit | String | Yes | ecca4210-09a4-446c-ad87-5e65bd50df12 |
country | Country from customer location identified | Alpha 2 Code | Yes | US / CA |
province | State / Province of customer location identified from customer location | Alpha code | No (US), Yes (Canada) | AL | NY | WA |
productUrl | Url containing product details shown to customer like Product title, Product description, SKU information, pricing information, | text.string | Yes | https://dummy-store.com/product/<productId> |
price | Price of the product (USD if country passed is US, CAD if country passed is Canada) | Decimal | Yes | 230.54 |
Response :
Field | Description | Data type | Example | Mandatory |
---|---|---|---|---|
quoteId | Unique Id generated whenever an api call is made to generate quotes | String | 929d14dd-2937-4290-9818-8fca2a00a9a3 | Yes |
quoteItemList | A pricing option generated for a particular tenure(coverage years). Each quoteItem contains price (float) for a coverage year (integer). Each quoteItem has a unique identifier quoteItemId to be passed back whenever | list | [{ "coverageYears": 2, "price": 64.99, "quoteId": "929d14dd-2937-4290-9818-8fca2a00a9a3", "quoteItemId": "8c78bc1a-0790-4cd3-a3f9-5ed97bbe59f5" }, { "coverageYears": 3, "price": 74.99, "quoteId": "929d14dd-2937-4290-9818-8fca2a00a9a3", "quoteItemId": "78adfa49-b058-4ce5-a65b-afa0c504a7de" }] | Yes |
productCategoryId | Unique identifier for the product category that product belongs to. Generated for each product category that a store is allowed to offer policy for | String | ecca4210-09a4-446c-ad87-5e65bd50df12 | Yes |
tcnLink | Unique link for Terms & Conditions for each productCategoryId. Could be customised if hosted by store | String | https://customer.surebright.com/t-c/c1a8661621492282a574fb3ff19a5bed119c3bcc96bea784675e0fffc93667d37a0a38efa176a69421e7e013186aaadf482bf066434056578fc29f3d6a2bdc2d | No |
productImageUrl | Link for the product image that can be shown as part of offer widget | Url | https://cdn.shopify.com/s/files/1/0254/6227/6182/products/bedbathandimage.jpg?v=1664467971 | No |
offeringTitle | Title for the widget that nudges the customers to buy a warranty for their product purchase | String | Don’t want to spend extra on this product for the next few years? We've got you covered! | No |
coverageList | List of coverage options grouped under different sections to give customers a brief insight into what all they stand to gain if they choose to buy warranty policy for their product purchase | list | [ { "optionType": "COVERAGE_OPTION", "optionTitle": "Your warranty plan provides,", "optionList": [ "Protection against everyday spills (food, beverages, human or pet biological stains, cosmetics, etc) and accidental stains from items like pens and crayons.", "Repairs for burns or heat caused by household items (excluding fire)", "Coverage for punctures and cuts in fabric, microfiber, and leather.", "Repairs for manufacturing defects in non-motorized mechanisms, springs, and wood frames." ] }, { "optionType": "WHY_SUREBRIGHT", "optionTitle": "Why Surebright ? ", "optionList": [ "$0 Deductible", "Cancel anytime", "24x7 Support and quick online claim filing in under 5 minutes" ] } ] | Yes |
Example request :
curl 'https://{HOST_NAME}/api/v1/quote/listQuotes?storeId={storeId}&country=US&productUrl={PRODUCT_URL}&price=235.6
Response Example :
- Https status code 200 : Quotes found
{
"quoteId": "929d14dd-2937-4290-9818-8fca2a00a9a3",
"quoteItemList": [
{
"coverageYears": 2,
"price": 64.99,
"quoteId": "929d14dd-2937-4290-9818-8fca2a00a9a3",
"quoteItemId": "8c78bc1a-0790-4cd3-a3f9-5ed97bbe59f5"
},
{
"coverageYears": 3,
"price": 64.99,
"quoteId": "929d14dd-2937-4290-9818-8fca2a00a9a3",
"quoteItemId": "78adfa49-b058-4ce5-a65b-afa0c504a7de"
}
],
"productCategoryId": "ecca4210-09a4-446c-ad87-5e65bd50df12",
"tncLink": "https://customer.surebright.com/t-c/c1a8661621492282a574fb3ff19a5bed119c3bcc96bea784675e0fffc93667d37a0a38efa176a69421e7e013186aaadf482bf066434056578fc29f3d6a2bdc2d",
"productImageUrl": "https://cdn.shopify.com/s/files/1/0254/6227/6182/products/bedbathandimage.jpg?v=1664467971",
"offeringTitle": "Don’t want to spend extra on this product for the next few years? We've got you covered!",
"coverageList": [
{
"optionType": "COVERAGE_OPTION",
"optionTitle": "Your warranty plan provides,",
"optionList": [
"Protection against everyday spills (food, beverages, human or pet biological stains, cosmetics, etc) and accidental stains from items like pens and crayons.",
"Repairs for burns or heat caused by household items (excluding fire)",
"Coverage for punctures and cuts in fabric, microfiber, and leather.",
"Repairs for manufacturing defects in non-motorized mechanisms, springs, and wood frames."
]
},
{
"optionType": "WHY_SUREBRIGHT",
"optionTitle": "Why Surebright ? ",
"optionList": [
"$0 Deductible",
"Cancel anytime",
"24x7 Support and quick online claim filing in under 5 minutes"
]
}
]
}
- Https Status Code 200 : No Quotes generated
{
"isError": true,
"errorType": 101,
"errorMessage": "Insufficient Params. Mandatory Params missing"
}
Error Type :
101 : Insufficient Params
102 : Validation failed for Input params
103 : Invalid Url
104 : Product not found
105 : No Quotes found
- Https Status code 500 : Something went wrong
- Fetch Price bands by Product URL (w/o Product Price) :
Method : GET
/api/v1/storeCategory/listPriceBands
Header
X-Surebright-Access-Token | Not Required |
---|
Query Params
Param | Description | Data Type | Mandatory | Example |
---|---|---|---|---|
storeId | A unique identifier for a store ; To be shared as part of integration kit | String | Yes | ecca4210-09a4-446c-ad87-5e65bd50df12 |
country | Country from customer location identified | Alpha 2 Code | Yes | US / CA |
province | State / Province of customer location identified from customer location | ISO 3166-2 | No (US), Yes (Canada) | AL | NY | WA |
productUrl | Url containing product details shown to customer like Product title, Product description, SKU information, pricing information, | text.string | Yes | https://dummy-store.com/product/<productId> |
Response :
Field | Description | Data type | Example | Mandatory |
---|---|---|---|---|
priceBandList | List of price bands, with each price band uniquely identified by priceBandId. A price band is generated for a unique combination of lowPrice, upperPrice, and coverageYears. | list | [ { "lowPrice": 0, "upperPrice": 499.99, "priceBandList": [{ "priceBandId": "121d14dd-2937-4290-8818-8fca2a00a9b1" "price": 64.99, "coverageYears": 2 },{ "coverageYears": 3, "priceBandId": "646d14dd-2937-4290-8818-8fca2a00a9b1", "price": 84.99 } ]}] | Yes |
productCategoryId | Unique identifier for the product category that product belongs to. Generated for each product category that a store is allowed to offer policy for | String | ecca4210-09a4-446c-ad87-5e65bd50df12 | Yes |
tcnLink | Unique link for Terms & Conditions for each productCategoryId. Could be customised if hosted by store | String | https://customer.surebright.com/t-c/c1a8661621492282a574fb3ff19a5bed119c3bcc96bea784675e0fffc93667d37a0a38efa176a69421e7e013186aaadf482bf066434056578fc29f3d6a2bdc2d | No |
productImageUrl | Link for the product image that can be shown as part of offer widget | String | https://cdn.shopify.com/s/files/1/0254/6227/6182/products/bedbathandimage.jpg?v=1664467971 | No |
offeringTitle | Title for the widget that nudges the customers to buy a warranty for their product purchase | String | Don’t want to spend extra on this product for the next few years? We've got you covered! | No |
coverageList | List of coverage options grouped under different sections to give customers a brief insight into what all they stand to gain if they choose to buy warranty policy for their product purchase | list | [ { "optionType": "COVERAGE_OPTION", "optionTitle": "Your warranty plan provides,", "optionList": [ "Protection against everyday spills (food, beverages, human or pet biological stains, cosmetics, etc) and accidental stains from items like pens and crayons.", "Repairs for burns or heat caused by household items (excluding fire)", "Coverage for punctures and cuts in fabric, microfiber, and leather.", "Repairs for manufacturing defects in non-motorized mechanisms, springs, and wood frames." ] }, { "optionType": "WHY_SUREBRIGHT", "optionTitle": "Why Surebright ? ", "optionList": [ "$0 Deductible", "Cancel anytime", "24x7 Support and quick online claim filing in under 5 minutes" ] } ] | Yes |
Example request :
curl 'https://{HOST_NAME}/api/v1/storeCategory/listPriceBands?storeId={storeId}&country=US&productUrl={PRODUCT_URL}
Response Example :
- Https status code 200 : Quotes found
{
"coverageOptions": [
{
"lowPrice": 0,
"upperPrice": 499.99,
"priceBandList": [{
"priceBandId": "121d14dd-2937-4290-8818-8fca2a00a9b1",
"price": 64.99,
"coverageYears": 2
},{
"coverageYears": 3,
"priceBandId": "646d14dd-2937-4290-8818-8fca2a00a9b1",
"price": 84.99
}
]
},
{
"lowPrice": 500,
"upperPrice": 999.99,
"priceBandList": [{
"priceBandId": "abcd14dd-2937-4290-8818-8fca2a00a9b1",
"price": 74.99,
"coverageYears": 2,
},
{
"coverageYears": 3,
"priceBandId": "343d14dd-2937-4290-8818-8fca2a00a9b1",
"price": 94.99
}]
},
],
"productCategoryId": "ecca4210-09a4-446c-ad87-5e65bd50df12",
"tncLink": "https://customer.surebright.com/t-c/c1a8661621492282a574fb3ff19a5bed119c3bcc96bea784675e0fffc93667d37a0a38efa176a69421e7e013186aaadf482bf066434056578fc29f3d6a2bdc2d",
"productImageUrl": "https://cdn.shopify.com/s/files/1/0254/6227/6182/products/bedbathandimage.jpg?v=1664467971",
"offeringTitle": "Don’t want to spend extra on this product for the next few years? We've got you covered!",
"coverageList": [
{
"optionType": "COVERAGE_OPTION",
"optionTitle": "Your warranty plan provides,",
"optionList": [
"Protection against everyday spills (food, beverages, human or pet biological stains, cosmetics, etc) and accidental stains from items like pens and crayons.",
"Repairs for burns or heat caused by household items (excluding fire)",
"Coverage for punctures and cuts in fabric, microfiber, and leather.",
"Repairs for manufacturing defects in non-motorized mechanisms, springs, and wood frames."
]
},
{
"optionType": "WHY_SUREBRIGHT",
"optionTitle": "Why Surebright ? ",
"optionList": [
"$0 Deductible",
"Cancel anytime",
"24x7 Support and quick online claim filing in under 5 minutes"
]
}
]
}
- Https Status Code 200 : No Quotes generated
{
"isError": true,
"errorType": 101,
"errorMessage": "Insufficient Params. Mandatory Params missing"
}
Error Type :
101 : Insufficient Params
102 : Validation failed for Input params
103 : Invalid Url
104 : Product not found
105 : No Quotes found
106 : No Price bands found
- Https Status code 500 : Something went wrong
- Order API
Method : POST
Order API to create, update or cancel an order
- Creates contracts for an order if partnerOrderId does not exist with Surebright
- Updates contracts if partnerOrderId already exists for an order
- To Cancel a lineItem, pass a field isCancelled : true as part of lineItem details. For details refer to example below
URL : /api/v1/order
Header
X-Surebright-Access-Token | Required |
---|
Body Params :
Param | Description | Data Type | Mandatory | Example |
---|---|---|---|---|
storeId | Unique Identifier for a store. Shared as part of onboarding kit | String | Yes | f4c059b2-5b74-4e4c-a3c5-85bc80cf8a09 |
partnerOrderId | Unique identifier for a successful order placed by a customer on merchant site. Could represent multiple line items of different quantity as part of order | String (Max length : 48) | Yes | 83737121380 |
orderPurchaseDateTime | Date time at which the order was purchased by customer | ISO Datetime String | Yes | 2024-01-07T10:15:30Z |
lineItemList | lineItemList is a list of line items for which policy was purchased. Each lineItem is identified by a unique lineItemId (String: max length 48 chars). quoteId and quoteItemId are used to identify quote option bought by customer. A line item must contain either quoteItemId and quoteId, or it should have priceBandId. unitSalePrice and totalPrice are price at which policy was bought by customer. Please do not send a line item in which no policy sales have been made | List | Yes | [ { "lineItemId": "374dc3c3-94a3-4b85-a876-8651e461446d", "policyPurchaseDate": " 2024-01-07T10:15:30Z", "quoteId": "929d14dd-2937-4290-9818-8fca2a00a9a3", "quoteItemId": "8c78bc1a-0790-4cd3-a3f9-5ed97bbe59f5", "totalPrice": 99, "quantity": 3, "unitSalePrice": 33, “productTitle”: “Nourison Alpha Floral Modern, Indoor/Outdoor Area Rug”, “productId”: “17338270”, “variantId”: “80400330”, “productSKU”: “ALH05”, “priceBandId”: null } ] |
customerDetails | Customer details required to create contracts for any order. - firstName, lastName, addressLine1, city, province, country, zipCode, customerEmail are mandatory. - mobileNumber and addressLine2 of customer are optional. For US, state value should be passed in province field. | Object (Province is ISO 3166-2 code, Country is Alpha 2 code) | Yes | { "firstName": "John", "lastName": "Doe", "addressLine1": "123 Hathway Street", "addressLine2": "", "city": "New York City", "province": "", "country": "NY", "zipCode": "10005", "customerEmail": "johndoe@gmail.com", "mobileNumber": “7872323781” } |
Response Details
Field | Description | Data type | Example | Mandatory |
---|---|---|---|---|
storeId | Unique Identifier for a store. Shared as part of onboarding kit | String | f4c059b2-5b74-4e4c-a3c5-85bc80cf8a09 | Yes |
partnerOrderId | Unique identifier for a successful order placed by a customer on merchant site. Could represent multiple line items of different quantity as part of order | String (Max length : 48) | 83737121380 | Yes |
sbOrderId | Unique identifier for each partnerOrderId generated by Surebright | String | 9b4f204a-8150-4559-a2b2-6cb1722bb296 | No |
contractList | List of contracts generated for each quantity in each line item. isCancelled indicates if a contract is currently cancelled or not | list | [ { "lineItemId": "374dc3c3-94a3-4b85-a876-8651e461446d", "contractId": "eb46a2ba-050f-4d40-9105-02ccd497d99e", "quoteId": "929d14dd-2937-4290-9818-8fca2a00a9a3", "quoteItemId": "8c78bc1a-0790-4cd3-a3f9-5ed97bbe59f5", "isCancelled": false } ] | Yes |
errorList | Contains errorType, errorMessage if contract creation fails for a line item | list | [ { "lineItemId": "374dc3c3-94a3-4b85-a876-8651e461446d", "quoteId": "929d14dd-2937-4290-9818-8fca2a00a9a3", "quoteItemId": "ab78bc1a-0790-4cd3-a3f9-5ed97bbe59f5" "errorType": 105, "errorMessage": "No quotes found" } ] | Yes |
Example 1 : Create Contracts using quoteId and quoteItemId for each lineItem
Request
{
"storeId": "f4c059b2-5b74-4e4c-a3c5-85bc80cf8a09",
"partnerOrderId": "83737121380",
"orderPurchaseDate": "2024-01-07T10:15:30Z",
"lineItemList": [
{
"lineItemId": "374dc3c3-94a3-4b85-a876-8651e461446d",
"policyPurchaseDate": "2024-01-07T10:15:30Z",
"quoteId": "929d14dd-2937-4290-9818-8fca2a00a9a3",
"quoteItemId": "8c78bc1a-0790-4cd3-a3f9-5ed97bbe59f5",
"totalPrice": 99,
"quantity": 3,
"unitSalePrice": 33,
"productTitle": "Nourison Alpha Floral Modern, Indoor/Outdoor Area Rug",
"productId": "17338270",
"variantId": "80400330",
"productSKU": "ALH05"
}
],
"customerDetails": {
"firstName": "John",
"lastName": "Doe",
"addressLine1": "123 Hathway Street",
"addressLine2": "",
"city": "New York City",
"province": "NY",
"country": "US",
"zipCode": "10005",
"customerEmail": "johndoe@gmail.com",
"mobileNumber": “7872323781”
}
}
Response
- 200 :
{
"storeId": "f4c059b2-5b74-4e4c-a3c5-85bc80cf8a09",
"partnerOrderId": "83737121380",
"sbOrderId": "9b4f204a-8150-4559-a2b2-6cb1722bb296",
"contractList": [
{
"lineItemId": "374dc3c3-94a3-4b85-a876-8651e461446d",
"contractId": "eb46a2ba-050f-4d40-9105-02ccd497d99e",
"quoteId": "929d14dd-2937-4290-9818-8fca2a00a9a3",
"quoteItemId": "8c78bc1a-0790-4cd3-a3f9-5ed97bbe59f5",
"isCancelled": false
},
{
"lineItemId": "374dc3c3-94a3-4b85-a876-8651e461446d",
"contractId": "ab46a2ba-050f-4d40-9105-02ccd497d99e",
"quoteId": "929d14dd-2937-4290-9818-8fca2a00a9a3",
"quoteItemId": "8c78bc1a-0790-4cd3-a3f9-5ed97bbe59f5",
"isCancelled": false
},
{
"lineItemId": "374dc3c3-94a3-4b85-a876-8651e461446d",
"contractId": "cd46a2ba-050f-4d40-9105-02ccd497d99e",
"quoteId": "929d14dd-2937-4290-9818-8fca2a00a9a3",
"quoteItemId": "8c78bc1a-0790-4cd3-a3f9-5ed97bbe59f5",
"isCancelled": false
}
],
"errorList": [
{
"lineItemId": "374dc3c3-94a3-4b85-a876-8651e461446d",
"quoteId": "929d14dd-2937-4290-9818-8fca2a00a9a3",
"quoteItemId": "1278bc1a-0790-4cd3-a3f9-5ed97bbe59f5"
"errorType": 105,
"errorMessage": "No quotes found"
}
]
}
Example 2: Create contracts using priceBandId for each lineItem
Request
{
"storeId": "f4c059b2-5b74-4e4c-a3c5-85bc80cf8a09",
"partnerOrderId": "83737121380",
"orderPurchaseDate": "2024-01-07T10:15:30Z",
"lineItemList": [
{
"lineItemId": "374dc3c3-94a3-4b85-a876-8651e461446d",
"policyPurchaseDate": "2024-01-07T10:15:30Z",
"priceBandId": "767d14dd-1237-4290-9818-8fca2a00a9a3",
"totalPrice": 99,
"quantity": 3,
"unitSalePrice": 33,
"productTitle": "Nourison Alpha Floral Modern, Indoor/Outdoor Area Rug",
"productId": "17338270",
"variantId": "80400330",
"productSKU": "ALH05",
"isCancelled": false
}
],
"customerDetails": {
"firstName": "John",
"lastName": "Doe",
"addressLine1": "123 Hathway Street",
"addressLine2": "",
"city": "New York City",
"province": "NY",
"country": "US",
"zipCode": "10005",
"customerEmail": "johndoe@gmail.com",
"mobileNumber": “7872323781”
}
}
Response
{
"storeId": "f4c059b2-5b74-4e4c-a3c5-85bc80cf8a09",
"sbOrderId": "9b4f204a-8150-4559-a2b2-6cb1722bb296",
"contractList": [
{
"lineItemId": "374dc3c3-94a3-4b85-a876-8651e461446d",
"contractId": "eb46a2ba-050f-4d40-9105-02ccd497d99e",
"priceBandId": "767d14dd-1237-4290-9818-8fca2a00a9a3",
"isCancelled": false
},
{
"lineItemId": "374dc3c3-94a3-4b85-a876-8651e461446d",
"contractId": "ab46a2ba-050f-4d40-9105-02ccd497d99e",
"priceBandId": "767d14dd-1237-4290-9818-8fca2a00a9a3",
"isCancelled": false
},
{
"lineItemId": "374dc3c3-94a3-4b85-a876-8651e461446d",
"contractId": "cd46a2ba-050f-4d40-9105-02ccd497d99e",
"priceBandId": "767d14dd-1237-4290-9818-8fca2a00a9a3",
"isCancelled": false
}
],
"errorList": [
]
}
Example 3 : Cancel a line item
Request
{
"storeId": "f4c059b2-5b74-4e4c-a3c5-85bc80cf8a09",
"partnerOrderId": "83737121380",
"orderPurchaseDate": "2024-01-07T10:15:30Z",
"lineItemList": [
{
"lineItemId": "374dc3c3-94a3-4b85-a876-8651e461446d",
"policyPurchaseDate": "2024-01-07T10:15:30Z",
"priceBandId": "767d14dd-1237-4290-9818-8fca2a00a9a3",
"totalPrice": 99,
"quantity": 3,
"unitSalePrice": 33,
"productTitle": "Nourison Alpha Floral Modern, Indoor/Outdoor Area Rug",
"productId": "17338270",
"variantId": "80400330",
"productSKU": "ALH05",
"isCancelled": true
}
],
"customerDetails": {
"firstName": "John",
"lastName": "Doe",
"addressLine1": "123 Hathway Street",
"addressLine2": "",
"city": "New York City",
"province": "NY",
"country": "US",
"zipCode": "10005",
"customerEmail": "johndoe@gmail.com",
"mobileNumber": “7872323781”
}
}
Response
{
"storeId": "f4c059b2-5b74-4e4c-a3c5-85bc80cf8a09",
"sbOrderId": "9b4f204a-8150-4559-a2b2-6cb1722bb296",
"contractList": [
{
"lineItemId": "374dc3c3-94a3-4b85-a876-8651e461446d",
"contractId": "eb46a2ba-050f-4d40-9105-02ccd497d99e",
"priceBandId": "767d14dd-1237-4290-9818-8fca2a00a9a3",
"isCancelled": true
},
{
"lineItemId": "374dc3c3-94a3-4b85-a876-8651e461446d",
"contractId": "ab46a2ba-050f-4d40-9105-02ccd497d99e",
"priceBandId": "767d14dd-1237-4290-9818-8fca2a00a9a3",
"isCancelled": true
},
{
"lineItemId": "374dc3c3-94a3-4b85-a876-8651e461446d",
"contractId": "cd46a2ba-050f-4d40-9105-02ccd497d99e",
"priceBandId": "767d14dd-1237-4290-9818-8fca2a00a9a3",
"isCancelled": true
}
],
"errorList": [
]
}
Appendix
- Alpha 2 Code for Country : https://www.iban.com/country-codes.
- Alpha code for US states : https://en.wikipedia.org/wiki/Federal_Information_Processing_Standard_state_code
- Alpha code for CA states : https://en.wikipedia.org/wiki/Canadian_postal_abbreviations_for_provinces_and_territories