Skip to content

Full API integration

This page outlines what a complete Sprii integration looks like end-to-end. It ties together the three things Sprii needs from your shop:

  1. Your product catalog, so the live-show host can pick which products to sell.
  2. A working basket / checkout flow on your site, so customers added to the basket by Sprii can actually buy.
  3. Order attribution, so completed orders are reported back and counted as conversions.

Each section below points at the dedicated page with the full details.

1. Import your products into Sprii

Sprii needs to know about your products before a host can sell them in a live show. Push your catalog into Sprii with POST /products from your backend. The same endpoint is used for the initial import and for any subsequent inserts/updates — re-send a product to update its name, price, inventory, images, status, or variants.

Two product shapes are supported:

  • simple — no variants. Minimum fields: id, sku, name, price, url, type: "simple", status.
  • configurable — has variants. Requires configurableOptions (e.g. Size, Color) and a variants array; Sprii reserves stock at the variant level.
json
{
  "products": [
    {
      "id": "PROD-SIMPLE-001",
      "sku": "SKU-MUG-001",
      "name": "Coffee Mug",
      "price": 14.99,
      "url": "https://shop.example.com/products/coffee-mug",
      "type": "simple",
      "status": "enabled",
      "image": "https://cdn.example.com/images/mug-main.jpg",
      "inventory": 50,
      "manageStock": true
    }
  ]
}

See the full /products schema for the configurable shape, alternative images, and all optional fields.

When to push: on every product create / update in your shop (webhook / outbox / nightly sync — whichever fits your stack), so Sprii's catalog stays in sync with yours.

Alternatives to pushing via POST /products: Sprii can also ingest your catalog from a Google Shopping feed you already publish, or by scraping your product pages directly. These are useful when you don't want to build an outbound integration from your shop. See the Import products page for the full set of options and how to choose between them.

2. Get Sprii's products into the customer's basket

Once the live show is running, Sprii drives the cart on your site through the SDK. To support a complete buying flow you need to implement four actions:

ActionPurpose
SOME_CHECKOUTAdd products to the basket when a customer follows a social-media checkout link to your site.
UPDATE_CART_CONTENTSApply add / change / remove operations to the basket when the customer edits the in-player cart.
GET_CART_CONTENTSReturn the current basket contents so the player can show them inside the cart UI.
OPEN_CARTOpen your cart drawer / modal / page when the customer clicks "Go to basket" in the player.

Two cross-cutting concerns apply to the two actions that write to the basket (SOME_CHECKOUT and UPDATE_CART_CONTENTS):

  • Use the live-show price, not the catalog price. The action payload includes campaignUid and pageUid. Forward them to your backend and look up the campaign-specific price before adding the line. Full flow on the Custom prices page.
  • Persist Sprii's orderNo on the basket. The same payloads also include an orderNo. Save it against the customer's basket / session so that when the order is placed you can send it back to Sprii. Full flow on the Order tracking page.

For boilerplate handler implementations, generate a starting script from the Boilerplate Script Builder.

3. Report completed orders back to Sprii

When the customer finalises the order in your webshop, your backend calls Sprii's POST /processOrders endpoint with the stored orderNo as spriiOrderNumber. This is what closes the attribution loop — without it Sprii sees the checkout starting but never learns it converted.

Full flow, payload examples and matching rules: see Order tracking.