Shipping protection quote

Price shipping protection for the items in a cart and learn which items are eligible.

POST https://{HOST_NAME}/quote/api/quote/shipping

Use this endpoint on the cart page or in checkout to offer shipping protection for the whole order. Send the cart lines; SureBright drops items that cannot carry shipping protection, prices the rest, and returns the plan product to add to the cart together with the coverage bullets. Shipping protection must be enabled on your store; see Shipping protection.

Shipping protection is priced for US shipments.

Headers#

HeaderDescriptionRequired
Content-Typeapplication/jsonYes

No authentication header is needed for this endpoint.

Body#

stringrequired

Your store identifier. shop is accepted as an alias.

string

Default SHOPIFY.

string

Cart currency. Default USD.

stringrequired

Shopper's two-letter country code. A quote is only returned for US.

string

Shopper's state or province code, used for the per-item eligibility check.

string

The visit identifier for this session.

object[]required

The cart lines. Each needs productId, variantId, price and quantity; a line missing any of them is returned unpriced.

boolean

true when the call comes from the checkout extension. The per-item product-protection eligibility then follows the checkout settings.

Example request#

bash
curl -X POST 'https://{HOST_NAME}/quote/api/quote/shipping' \
  -H 'Content-Type: application/json' \
  -d '{
    "storeId": "example-store.myshopify.com",
    "platform": "SHOPIFY",
    "currency": "USD",
    "country": "US",
    "visitId": "6a0d0c1e-2b4f-4d8e-9f21-3c5e7a9b1d2f",
    "cartItems": [
      { "productId": "8011223344556", "variantId": "44011223344556", "price": 349.00, "quantity": 1 },
      { "productId": "8011223344999", "variantId": "44011223344999", "price": 29.00, "quantity": 2 }
    ]
  }'

Response#

quoteIdstring

Shipping protection quote identifier.

pricenumber

Price of the shipping protection plan for this cart.

siProductIdstring

The shipping protection product to add to the cart.

siVariantIdstring

The variant of that product priced for this cart.

policyProductOptionValueListstring[]

Option values of the plan product, on platforms that use them.

policyProductModifierIdstring

Modifier id, on platforms that use product modifiers.

coveredProductsListobject[]

The lines the plan covers, as priced.

productListobject[]

Every line you sent, with the eligibility result.

coverageListobject[]

Coverage bullets to show, {coverageName, optionType, iconType}. optionType is COVERAGE_OPTION for the desktop list and MOBILE_COVERAGE_OPTION for the mobile list.

brandLogoSrcstring

Your brand logo, when configured on the widget.

Errors#

No-quote outcomes come back with HTTP 200 and isError: true; productList is still returned so you can show per-item eligibility.

CodeBodyMeaning
200{"isError": true, "message": "Shipping insurance is not enabled for this store", "productList": [...]}Shipping protection is off for the store
200{"isError": true, "message": "No products eligible for shipping protection", "productList": [...]}Every line was dropped
200{"isError": true, "message": "Insufficient data in cart items", "productList": [...]}No line had all of productId, variantId, price, quantity
200{"isError": true, "message": "Unable to get Quote."} or "Shipping quote service error"Pricing failed, including a non-US country
400{"isError": true, "message": "Insufficient params"}storeId missing
500{"isError": true, "message": "Internal Server Error"}Unexpected failure

Responses are not cached.