Skip to main content
PUT
Configure a loyalty season

Authorizations

x-stash-hmac-signature
string
header
required

Versioned HMAC-SHA256 signature authenticating server-to-server SDK requests (your backend calling Stash), as opposed to client-side SDK operations. Recommended over the deprecated X-Stash-Api-Key for the best security. Header format: v1;{appId};{unixMillisTimestamp};{base64Signature} (semicolon-delimited). {base64Signature} is the base64-encoded HMAC-SHA256 of the string {unixMillisTimestamp}.{requestBody} using your app ingress secret (the ingress secret is shown base64-encoded in Studio; base64-decode it to the raw bytes used as the HMAC key), where {requestBody} is the request body exactly as you send it for POST and PUT requests (the compact canonical request JSON is also accepted) and empty for GET requests. A signature over the exact bytes verifies for bodies of up to 18 KiB (18,432 bytes); a larger body may be refused with 401 even when correctly signed. The timestamp must be within 5 minutes of Stash server time. Your appId is your immutable app identifier, shown in Stash Studio under Project Settings > App details; your ingress secret is under Project Settings > API Secrets.

Path Parameters

shopId
string
required

Shop identifier from Stash Studio

Body

application/json

One season plus the shop-level items it depends on, and optionally the program-level spend conversion table. Signed over the request body.

campaign
Loyalty Campaign Config · object
required

A loyalty campaign (season): its window, reset rules and tiers with their milestones.

activate
boolean

Turn the program on once the request has been applied and passes publish validation. Honoured only on a program that has never been published; ignored otherwise and reported in warnings. A program unpublished in Studio stays off until it is re-enabled in Studio, so a sync cannot undo a deliberate stop. Creates the program for the shop if it has none.

displayConfig
Loyalty Display Config · object

Shop-level names shown to players.

bonuses
Loyalty Bonus Definition · object[]

Bonus definitions, created or updated by id. A bonus missing from the list is left in place; the API never deletes bonuses because wallet balances depend on them.

products
Loyalty Reward Product · object[]

Reward products, created or updated by SKU. Every product listed is published on write, including one saved as a draft in Studio; leave a product out of the list to keep its Studio draft unpublished. A product missing from the list is left in place; the API never deletes products because claimed milestones and ended seasons still refer to them. Applied before the campaign, so a milestone may reference a SKU defined in the same request.

spendConversion
Loyalty Spend Conversion · object

A shop's optional spend conversion table: one price row listing the same price point in every currency the partner sells in. Loyalty points are earned per US dollar; the table lets Stash convert a purchase in another currency to its US dollar equivalent at the ratio the row declares (the USD amount divided by the amount in that currency). Example: a 9.99 USD price point with the equivalents EUR 9.49, GBP 7.99 and JPY 1500.

Response

A successful response.

The configuration as stored after the update.

displayConfig
Loyalty Display Config · object

Shop-level names shown to players.

bonuses
Loyalty Bonus Definition · object[]

Every bonus defined for the shop.

products
Loyalty Reward Product · object[]

Every reward-only product the shop holds, with its status.

campaign
Loyalty Campaign Config · object

A loyalty campaign (season): its window, reset rules and tiers with their milestones.

warnings
string[]

Notes on the update, of two kinds. A part of the request that was accepted but had no effect, for example activate on a program that is already live. A currency in the spend conversion table that was stored without a market-rate check because the ECB publishes no rate for it; the note names the currency by its ISO code, and the currency is still stored and used for earning. Empty when there is nothing to report.

spendConversion
Loyalty Spend Conversion · object

A shop's optional spend conversion table: one price row listing the same price point in every currency the partner sells in. Loyalty points are earned per US dollar; the table lets Stash convert a purchase in another currency to its US dollar equivalent at the ratio the row declares (the USD amount divided by the amount in that currency). Example: a 9.99 USD price point with the equivalents EUR 9.49, GBP 7.99 and JPY 1500.