---
title: "Order quotes (post-purchase)"
description: "List the plans still available for the items on an existing order, after the customer has bought."
---

Use these endpoints to offer protection after checkout: on the order status page, in a follow-up email, or in a registration flow. You identify the order; SureBright reads its lines, skips refunded quantities and items that already carry a plan, checks the post-purchase window, and returns one quote per eligible line.

There are two endpoints, depending on where the order lives.

| Order recorded by | Endpoint |
|-------------------|----------|
| Your e-commerce platform (Shopify, WooCommerce, Shift4Shop, Magento, BigCommerce) | `GET /quote/api/quote/{platform}/order/listQuotes` |
| The SureBright Order API (point-of-sale and custom stores) | `GET /quote/api/order/listQuotes` |

No authentication header is needed for either endpoint. Responses are not cached.

## Platform orders

`GET https://{HOST_NAME}/quote/api/quote/{platform}/order/listQuotes`

<ParamField path="platform" type="string" required>
  One of `shopify`, `woocommerce`, `shift4shop`, `magento`, `bigcommerce` (lower case, in the path).
</ParamField>
<ParamField query="shopName" type="string" required>
  Your store identifier on that platform.
</ParamField>
<ParamField query="leadId" type="string" required>
  The platform's order id. `careLeadId` is accepted as an alias.
</ParamField>
<ParamField query="visitId" type="string" required>
  The visit identifier for this session.
</ParamField>
<ParamField query="storePlatform" type="string">
  Required for every platform except Shopify: `WOOCOMMERCE`, `SHIFT4SHOP`, `MAGENTO` or `BIGCOMMERCE`.
</ParamField>
<ParamField query="quoteSyncMode" type="string">
  `SYNC` to save the quotes before responding. Default `ASYNC`.
</ParamField>
<ParamField query="locale" type="string">
  Shopify only. `fr` returns French coverage text where it exists.
</ParamField>

```bash
curl 'https://{HOST_NAME}/quote/api/quote/shopify/order/listQuotes?shopName=example-store.myshopify.com&leadId=5801234567890&visitId=6a0d0c1e-2b4f-4d8e-9f21-3c5e7a9b1d2f&quoteSyncMode=SYNC'
```

### Response

<ResponseField name="quoteList" type="object[]">
  One standard quote object (see **By Product**) per order line that was looked at. Lines that are fully refunded are left out. Each entry adds:
  <Expandable title="order fields">
    <ResponseField name="statusMessage" type="string">
      `POLICY_FETCHED_SUCCESSFULLY` when plans are offered. `POLICY_ALREADY_PURCHASED` when the line already carries a plan (the entry then has an empty `PolicyData`). `POLICY_PURCHASE_WINDOW_EXPIRED` when the order is older than the store's post-purchase window (30 days from the order date unless SureBright has set another window for the store or the order).
    </ResponseField>
    <ResponseField name="productPurchaseQuantity" type="number">
      Quantity bought, net of refunds. `shopifyProductPurchaseQuantity` carries the same value.
    </ResponseField>
    <ResponseField name="storeProductVariantPrice" type="number">
      The price paid for the line, which the plan is priced on.
    </ResponseField>
    <ResponseField name="storeProductPurchaseDate" type="string">
      Order date.
    </ResponseField>
    <ResponseField name="storeProductFulfillmentDate" type="string">
      Fulfillment date, for stores whose coverage starts at shipment.
    </ResponseField>
    <ResponseField name="PolicyData" type="object[]">
      Plans for the line: `quoteId`, `quoteItemId`, `price`, `monthlyPrice`, `coverageYears`, `deductibleAmount`, `quotePlatform` (`PLATFORM_POST_PURCHASE`).
    </ResponseField>
  </Expandable>
</ResponseField>
<ResponseField name="isError" type="boolean">
  Shopify only. `true` with an empty `quoteList` when the order itself could not be quoted; see `statusMessage`.
</ResponseField>
<ResponseField name="statusMessage" type="string">
  Shopify only, with `isError`: `ORDER_DETAILS_NOT_FOUND`, `STORE_DETAILS_NOT_FOUND`, `INVALID_PROVINCE` (the order ships to a region the store does not cover), `POLICY_PURCHASE_WINDOW_EXPIRED`, or `FULFILLMENT_DATE_NOT_FOUND` (pre-order store, order not yet fulfilled).
</ResponseField>

### Errors

| Code | Body | Meaning |
|------|------|---------|
| `200` | `{"quoteList": []}` | Nothing to offer, or (non-Shopify) the order or store was not found |
| `400` | `{"isError": true, "message": "Insufficient params"}` | `shopName`, `leadId` or `visitId` missing |
| `500` | `{"quoteList": []}` | Unexpected failure |

## Orders recorded through the Order API

`GET https://{HOST_NAME}/quote/api/order/listQuotes?payload={base64}`

For stores that record sales with **Create Contracts for Order** rather than through a platform, this endpoint re-quotes the order's lines by their categories. All inputs go inside the `payload` JSON, Base64-encoded as a query parameter, in the same way as **By Category**.

<ParamField query="payload" type="string" required>
  Base64 (UTF-8) of a JSON object:
  <Expandable title="payload fields">
    <ParamField body="country" type="string" required>
      `US` or `CA`.
    </ParamField>
    <ParamField body="visitId" type="string" required>
      The visit identifier for this session.
    </ParamField>
    <ParamField body="platform" type="string" required>
      The platform the order was recorded under.
    </ParamField>
    <ParamField body="storeId" type="string">
      Your store identifier. Required unless `storeParentId` is sent.
    </ParamField>
    <ParamField body="storeParentId" type="string">
      Your account identifier.
    </ParamField>
    <ParamField body="orderId" type="string">
      Your order id, as sent to the Order API. Required unless `sbOrderId` is sent.
    </ParamField>
    <ParamField body="sbOrderId" type="string">
      SureBright's order id.
    </ParamField>
    <ParamField body="province" type="string">
      State or province, when prices vary by region.
    </ParamField>
  </Expandable>
</ParamField>
<ParamField query="quoteSyncMode" type="string">
  `SYNC` to save the quotes before responding.
</ParamField>

```bash
PAYLOAD=$(printf '%s' '{"country":"US","visitId":"6a0d0c1e-2b4f-4d8e-9f21-3c5e7a9b1d2f","platform":"CUSTOM","storeId":"example-pos-store","orderId":"INV-10492"}' | base64)
curl "https://{HOST_NAME}/quote/api/order/listQuotes?payload=${PAYLOAD}&quoteSyncMode=SYNC"
```

### Response

<ResponseField name="quoteList" type="object[]">
  One category quote (as on **By Category**) per order line that has a SureBright category your store sells into, priced on the line's price.
</ResponseField>
<ResponseField name="orderDetails" type="object">
  The order as SureBright has it, including `orderLineItemList` and `orderPurchaseDate`.
</ResponseField>

### Errors

| Code | Body | Meaning |
|------|------|---------|
| `200` | `{"isError": true, "message": "Order not found."}` | No order matches `orderId` or `sbOrderId` for this store |
| `200` | `{"isError": true, "message": "Store Parent not found."}` or a message that the account has no active categories | The account is not set up for category quotes |
| `400` | `{"isError": true, "message": "Insufficient params"}` | `payload` missing, or `country`, `visitId`, `platform`, a store id or an order id missing inside it |
| `500` | `Internal Server Error` | Unexpected failure |
