---
title: "Custom platform integration"
description: "Offer SureBright protection on a custom-built or unsupported store platform: create the plan products from your SKUs, add the SureBright SDK to your storefront, and send your orders to SureBright."
---

Use this page when your store runs on a platform SureBright has no app or plugin for, such as a custom-built site, an in-house commerce stack or a platform not on [Supported platforms](/platforms/overview). The integration has three parts:

1. **Plan products in your store.** SureBright shares your plan SKUs, and you create one product for each in your catalogue.
2. **The SureBright SDK on your storefront.** It shows the protection offer on product and cart pages, and tells your code which plan the shopper picked.
3. **Your orders sent to SureBright.** Each order that includes a plan is sent to SureBright's order webhook, and SureBright creates the contracts and emails your customer.

## Who does what

| Step | Who | What happens |
|---|---|---|
| Set up your store in SureBright | SureBright | Your catalogue is categorised, plan prices are set, and you get your store ID and API key. |
| Share the plan SKUs | SureBright | You get the SKU list as a CSV. You can also [download it from the Merchant Portal](/erp/download-plan-skus). |
| Create the plan products | You | One product per plan SKU in your store catalogue. |
| Design the offer | SureBright, with you | The look and placement of the offer, set in the Merchant Portal's widget designer. |
| Add the SDK and handle plan selection | Your developers | One script tag, plus a few lines of code that add the plan product to the cart. |
| Send orders | Your developers | A call to SureBright's order webhook when an order is paid, and again when it is cancelled or refunded. |
| Create contracts and email customers | SureBright | One contract per plan unit sold, emailed to the customer. |

## Step 1: create the plan products

SureBright shares a CSV with one row per plan SKU: the SKU, a description and the price. Each SKU stands for a plan length, region, coverage type and price band, for example `SBW-1U-CEAD-49999`. See [Download your plan SKUs](/erp/download-plan-skus) for every column.

Create one product in your store for each row:

| Setting | Set it to | Why |
|---|---|---|
| **SKU** | The `InventoryID` value, exactly | SureBright matches the plan line on your orders by this SKU. |
| **Title** | The `Description` value, or your own wording | Shown on the cart, the checkout and the order confirmation. |
| **Price** | The `BasePrice` value | The price the shopper pays for the plan. |
| **Shipping** | Not shipped, no weight | There is nothing to pick, pack or deliver. |
| **Tax** | Your setting for service or warranty items | Agree it with your accountant. |
| **Visibility** | Hidden from search, collections and product listings | Shoppers add a plan through the SureBright offer, never from a product page. |
| **Discounts** | Excluded from store-wide discounts and coupons | A discounted plan still costs you the full plan price. |

If your platform has product variants, you can also create one plan product with one variant per SKU. What matters is that each SKU exists exactly once.

When SureBright adds new price bands later, it tells you. Download the SKUs again and create the new rows.

## Step 2: add the SureBright SDK to your storefront

Add the SDK script to every page of your storefront, with your store ID and the `CUSTOM` platform:

```html
<script id="sbsimxsdk" async
        src="https://cdn.surebright.com/sbsimxsdk.js"
        data-sb-store-id="YOUR_STORE_ID"
        data-sb-platform="CUSTOM"></script>
```

On product and cart pages the SDK shows the offer where SureBright has placed it for your store. It needs to know which product the shopper is looking at, and it tells your code when a plan is chosen. Your developers wire both, following [Headless and custom storefronts](/frontend-widget-integration/frontend-widget-kit/headless-and-custom-storefronts).

### Add the plan to the cart

When the shopper picks a plan, the SDK calls your handler with the plan and the product it covers:

```javascript
window.SureBright.onSelectionChange(function (change) {
  if (change.action === "selected" && change.quote) {
    // Add the plan product whose SKU matches the selected plan,
    // linked to the cart line of the product it covers.
    addPlanToCart(change.quote, change.product);
  } else if (change.action === "deselected") {
    removePlanFromCart(change.product);
  }
});
```

Keep the plan's quote details with the plan line (at least `quoteId`, `quoteItemId` and the covered product's ID), and carry them through to the order. SureBright needs them to know which product the plan covers. The full payload is in the [JavaScript API reference](/frontend-widget-integration/frontend-widget-kit/javascript-injection).

<Warning>
A plan line that reaches the order without its quote details cannot be matched to the product it covers, so no contract is created for it. Test that your cart, checkout and any app that edits orders keep them.
</Warning>

## Step 3: send your orders to SureBright

When an order that includes a plan is paid, your system sends it to SureBright's order webhook with your API key. SureBright creates one contract per plan unit and emails the customer their cover.

| When | Send | Reference |
|---|---|---|
| The order is paid | The order, its customer and line items, and for each covered line the plan bought | [Create contracts](/api-reference/endpoint/order/create-contract) |
| A plan is cancelled, refunded or its quantity changes | The order ID and the plan lines that changed | [Update or cancel contracts](/api-reference/endpoint/order/update-contract) |
| The covered product ships, on stores where cover starts at fulfilment | The fulfilment date, once SureBright turns this on for your store | [Set fulfilment dates](/api-reference/endpoint/order/fulfillment) |

What every order needs:

- the order ID, date and currency;
- the customer's name, email and address, so the customer can be sent their plan and can claim;
- each covered product line, with its product ID, title, price and quantity;
- each plan line, with its SKU, price, quantity and the quote details from Step 2.

Send each order once when it is paid. Sending the same order again does not create duplicate contracts. After a server error, look the order up with [Get contracts](/api-reference/endpoint/order/get-contracts) before you send it again. If your system cannot call a webhook yet, you can start with a [spreadsheet of orders](/erp/spreadsheet-order-intake) and switch later.

## Step 4: test before you launch

<Steps>
  <Step title="Check the offer">
    On a product page that should show protection, the offer appears where SureBright placed it. Pick a plan and check the plan product is added to the cart with the right SKU and price.
  </Step>
  <Step title="Place a test order">
    Complete an order with one product and one plan. Check that your system sent it to SureBright and got a success response.
  </Step>
  <Step title="Find the contract">
    The plan shows in [Sales](/merchant-portal/sales) in the Merchant Portal, and the test customer receives the plan email.
  </Step>
  <Step title="Cancel it">
    Cancel or refund the test order and check the contract is cancelled.
  </Step>
</Steps>

Tell your SureBright contact when the test passes. SureBright checks the contract details with you before your store goes live.

## Related

- [If your platform is not listed](/platforms/other-platforms): the smaller ways to start, and other checkouts, apps and native mobile apps.
- [Request a platform](/platforms/request-a-platform): ask SureBright to build an app for your platform.
- [Headless and custom storefronts](/frontend-widget-integration/frontend-widget-kit/headless-and-custom-storefronts): the developer guide for the SDK.
