Skip to content

Custom prices

Sprii campaigns (live shows) can override the regular catalog price of a product for the duration of the show — for example a live-show discount that differs from the default. To make those campaign prices actually apply when a customer buys, your backend has to look them up and use them instead of the regular catalog price when adding the items to the basket.

When is this relevant?

Whenever your shop adds or updates items in the cart on Sprii's behalf — i.e. inside the handlers for:

  • SOME_CHECKOUT — items being added to the basket from a social-media checkout link.
  • UPDATE_CART_CONTENTS — items being added, changed or removed from inside the in-player cart.

If you skip this step, customers will be charged your default catalog price even when the live show has a different price configured in Sprii.

What the player sends you

Both action payloads include two identifiers you need to forward to your backend:

  • campaignUid — the Sprii campaign / live show the action originated from.
  • pageUid — the Sprii account uid the campaign belongs to. (Despite the name, pageUid is an account identifier, not a per-page id.)

Together they are enough for Sprii to resolve the campaign-specific price for any product in that show.

How to fetch the campaign price

From your backend, call Sprii's POST /getCampaignProductPrice/{campaignUid} endpoint with the product id (and variant id, if applicable). The response gives you the campaign price, discount and VAT info to use when adding the line to the basket.

Request:

http
POST /getCampaignProductPrice/{campaignUid}
Content-Type: application/json

{
  "productId": "PROD-12345",
  "variantId": "VAR-001"
}

Use the returned price as the unit price on the cart line you create, instead of looking the price up from your own catalog. Everything else (stock, fulfilment, taxes) continues to go through your normal shop logic — only the price is overridden.

End-to-end flow

  1. SOME_CHECKOUT or UPDATE_CART_CONTENTS fires with campaignUid, pageUid and the affected products.
  2. Your action handler calls your backend with those identifiers plus the product ids.
  3. Your backend calls POST /getCampaignProductPrice/{campaignUid} for each product and receives the live-show price.
  4. Your backend adds / updates the basket line at that price.
  5. When the customer checks out, the discounted price is what they pay — and Sprii sees the correct revenue attributed to the campaign via order tracking.