Creates or updates one loyalty campaign (season) together with the shop-level display settings, bonus definitions and reward products it depends on, optionally sets or removes the program-level spend conversion table, and optionally activates the program. The campaign id is the upsert key: an existing id updates that season, a new id creates one. The request describes the whole season it names, so a tier or milestone omitted from it is removed from that season; bonuses and reward products are created or updated by id or SKU and never removed. Draft and scheduled seasons accept every change. An active season accepts names, descriptions, images, milestone rewards, tier earn rates and a new end date; thresholds, adding or removing tiers or milestones, the start date and reset rules are refused with FAILED_PRECONDITION listing the fields. Ended seasons are read-only. This method accepts only the versioned x-stash-hmac-signature header, signed over the request body exactly as sent; the legacy stash-hmac-signature header is rejected with HTTP 401 (UNAUTHENTICATED), because it carries no timestamp and a captured request could be replayed. Applying is idempotent, so resending the same request is safe. Errors, by the HTTP status a REST caller receives and its gRPC status. Two of them share HTTP 400; a REST caller tells them apart by the code in the error body, 3 for INVALID_ARGUMENT and 9 for FAILED_PRECONDITION. 400 INVALID_ARGUMENT (code 3) with per-field violations when validation fails, including a spend conversion price whose rate against the US dollar is more than 3 times above or below the market rate, which the violation on that price names; fix the request, correcting the price, because resending it unchanged does not help. 400 FAILED_PRECONDITION (code 9) when the request cannot apply to the program as it stands, with the reason in the message: for example a locked field of an active season changes (the message lists the fields), the shop has no loyalty program and activate is not set, or the shop’s loyalty program is bound to more than one shop; resend only once that changes, or as is when the message says to re-send the request. 401 UNAUTHENTICATED when the signature is missing, invalid, outside the time window, sent in the legacy header, or names a different shop; fix the signing. 403 PERMISSION_DENIED when the shop is not enabled for configuration writes; it does not change on a retry. 404 NOT_FOUND for an unknown shop; it does not change on a retry. 409 ABORTED when another update for the shop is in progress; resend the same request after a short wait, which is safe because applying is idempotent. 501 UNIMPLEMENTED when the loyalty configuration API is not available; it does not change on a retry. 500 INTERNAL when Stash hits an internal error, for example reading or writing the shop’s loyalty configuration; resend the same request with backoff. 503 UNAVAILABLE when the request has a spend conversion price in a currency other than USD and Stash has no market rates loaded, for example shortly after a restart; nothing is written, and resending the same request with backoff is safe because applying is idempotent.
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.
Show child attributes
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.
Show child attributes
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.
Show child attributes
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.
Show child attributes
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.
Show child attributes
Response
A successful response.
The configuration as stored after the update.
displayConfig
Loyalty Display Config · object
Shop-level names shown to players.
Show child attributes
bonuses
Loyalty Bonus Definition · object[]
Every bonus defined for the shop.
Show child attributes
products
Loyalty Reward Product · object[]
Every reward-only product the shop holds, with its status.
Show child attributes
campaign
Loyalty Campaign Config · object
A loyalty campaign (season): its window, reset rules and tiers with their milestones.
Show child attributes
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.
Show child attributes
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Stash Documentation","description":"Integrate Stash Pay, Stash Webshop, and Stash Launcher. Guides and partner resources for the Stash direct-to-consumer platform.","colors":{"primary":"#1e1e1e","light":"#f7f9f4","dark":"#1e1e1e"},"logo":{"light":"https://mintcdn.com/stash-gg/I_GbdmJR4L85eJZA/logo/light.svg?fit=max\u0026auto=format\u0026n=I_GbdmJR4L85eJZA\u0026q=85\u0026s=c58d1a385fd52c013aef762b9f06da39","dark":"https://mintcdn.com/stash-gg/I_GbdmJR4L85eJZA/logo/dark.svg?fit=max\u0026auto=format\u0026n=I_GbdmJR4L85eJZA\u0026q=85\u0026s=012af7b9b89de597a472667a86a65eef","href":"/guides"},"favicon":"https://mintcdn.com/stash-gg/I_GbdmJR4L85eJZA/favicon.png?fit=max\u0026auto=format\u0026n=I_GbdmJR4L85eJZA\u0026q=85\u0026s=6f4e9b8b8e5068337b7712264275bd28","api":{"playground":{"display":"interactive"}},"appearance":{"default":"system","strict":false},"background":{"color":{"light":"#f7f9f4","dark":"#1e1e1e"}},"navbar":{"primary":{"type":"button","label":"Studio","href":"https://studio.stash.gg"}},"seo":{"metatags":{"og:image":"https://docs.stash.gg/og-image.png"}},"fonts":{"heading":{"family":"Factor A","weight":500,"source":"https://storage.googleapis.com/stash_assets/fonts/FactorA-Medium.woff2","format":"woff2"},"body":{"family":"Factor A","weight":300,"source":"https://storage.googleapis.com/stash_assets/fonts/FactorA-Regular.woff2","format":"woff2"}},"icons":{"library":"lucide"},"styling":{"eyebrows":"breadcrumbs","latex":false},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","mcp","cursor","vscode"],"display":"header"},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"stash-gg","hasAudioNarration":false,"actualSubdomain":"stash-gg","customDomains":[],"gitSource":{"type":"github","owner":"stashgg","repo":"stash-mintlify","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":"","_id":"6afccf82d3f0f72f2b169b4c"},"feedback":{"thumbs":true},"entitlements":{"AI_CHAT":{"status":"DISABLED"},"WEB_MCP":{"status":"DISABLED"},"NARRATION":{"status":"DISABLED"}},"buildId":"6b0e1f15d09a38910d349f35:success","clientVersion":"0.0.4352","searchFilterCounts":[{"language":"default","tag":"Integration Guides","count":66},{"language":"default","tag":"API Reference","count":41},{"language":"default","tag":"Changelog","count":38},{"language":"default","tag":"Ingress","count":34},{"language":"default","tag":"Stash Webshop","count":28},{"language":"default","tag":"Features \u0026 Customizations","count":19},{"language":"default","tag":"Stash Pay","count":18},{"language":"default","tag":"Getting Started","count":11},{"language":"default","tag":"Catalog Management","count":11},{"language":"default","tag":"Partner With Us","count":10}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"privacy":{"consentBanner":{"enabled":true}},"googleFontsInlined":false},"customCss":[{"filePath":"styles.css","content":":root{--sidebar-width: 286px;--stash-menu-surface: #f4f6f1;--stash-menu-glass: rgba(244, 246, 241, 0.8);--stash-menu-border: rgba(153, 153, 153, 0.2)}html.dark{--stash-menu-surface: #1c1c1c;--stash-menu-glass: rgba(28, 28, 28, 0.8);--stash-menu-border: rgba(153, 153, 153, 0.2)}#navbar>div:not(#navbar-transition),div:has(>[data-layout-item=\"sidebar\"]){max-width:none}#navbar-transition,[data-layout-item=\"sidebar\"]{background-color:var(--stash-menu-glass);backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px);border-color:var(--stash-menu-border)}[data-layout-item=\"sidebar\"]{border-inline-end:1px solid var(--stash-menu-border)}#sidebar-content div:has(>#navigation-items)>div:first-child{background-image:linear-gradient(to bottom, var(--stash-menu-surface), transparent)}#mobile-nav,[data-layout-item=\"mobile-nav\"],.nav-dropdown-content,[data-component-part=\"theme-preference-menu-content\"]{background-color:var(--stash-menu-surface);border-color:var(--stash-menu-border)}@media (min-width: 1024px){div:has(>[data-layout-item=\"sidebar\"]){padding-inline:0}#sidebar-content{padding-inline-start:1rem}}@font-face{font-family:\"Factor A\";src:url(\"https://storage.googleapis.com/stash_assets/fonts/FactorA-Bold.woff2\") format(\"woff2\");font-weight:700;font-style:normal;font-display:swap}@font-face{font-family:\"Factor A\";src:url(\"https://storage.googleapis.com/stash_assets/fonts/FactorA-Extrabold35.woff2\") format(\"woff2\");font-weight:900;font-style:normal;font-display:swap}:root{--stash-page-background: #f7f9f4;--stash-header-glass: rgba(244, 246, 241, 0.8);--stash-header-border: rgba(128, 128, 128, 0.2);--stash-muted: #737373;--stash-foreground: #1e1e1e;--stash-control: rgba(235, 235, 235, 0.5);--stash-control-active: #e6e6e6;--stash-header-height: 104px}html.dark{--stash-page-background: #1e1e1e;--stash-header-glass: rgba(28, 28, 28, 0.8);--stash-muted: #999;--stash-foreground: #f7f9f4;--stash-control: rgba(33, 33, 33, 0.5);--stash-control-active: #262626}body{font-feature-settings:\"kern\" 1, \"liga\" 1, \"calt\" 1;-webkit-font-smoothing:antialiased}#page-title,#page-header h1{font-size:28px;line-height:42px;font-weight:500!important;letter-spacing:normal}#content h2,#content h3,#content h4,#content h5,#content h6{font-weight:400!important;letter-spacing:normal}#content strong{font-weight:700!important}#navbar-transition{background-color:var(--stash-header-glass);border-color:var(--stash-header-border)}#navbar .nav-logo{width:96px;height:24px}#navbar .nav-tabs-item{font-weight:500!important;text-shadow:none;color:var(--stash-muted)}#navbar .nav-tabs-item[data-active=\"true\"],#navbar .nav-tabs-item:hover{color:var(--stash-foreground)}#topbar-cta-button a{height:36px;padding:6px 12px;border:1px solid var(--stash-header-border);border-radius:9999px;color:var(--stash-muted);font-weight:300!important}#topbar-cta-button a:hover{background:var(--stash-control-active);color:var(--stash-foreground)}#topbar-cta-button a>span{display:none}#topbar-cta-button a>div{gap:6px}#topbar-cta-button a>div>span{color:inherit}#topbar-cta-button a>div>svg{display:none}#topbar-cta-button a>div::before{content:\"\";width:14px;height:14px;background:currentColor;mask:url(\"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20105%20104%22%3E%3Cpath%20d%3D%22M3.53358%20104L3.73942%2075.4788H64.8398C68.2705%2075.4788%2070.6719%2074.8897%2072.1128%2073.7461C73.5537%2072.6025%2074.2742%2070.9044%2074.2742%2068.6864C74.2742%2064.2159%2071.5296%2061.7901%2066.0406%2061.3742L35.5761%2059.5375C11.8701%2058.1859%200%2048.3439%200%2029.9767C0%2020.5851%203.25914%2013.2383%209.81174%207.93602C16.3643%202.63379%2026.3819%200%2039.8988%200H97.8086L98.0145%2028.5212H39.9331C36.571%2028.5212%2034.2039%2029.0756%2032.7973%2030.15C31.3907%2031.2243%2030.6703%2032.8184%2030.6703%2034.9324C30.6703%2039.1256%2033.4148%2041.4822%2038.9039%2042.0366L70.3632%2043.8734C93.4174%2045.017%20104.944%2054.6858%20104.944%2072.8104C104.944%2082.4099%20101.651%2090.034%2095.0984%2095.6135C88.5458%20101.193%2078.5968%20104%2065.2515%20104H3.53358Z%22%2F%3E%3C%2Fsvg%3E\") center / contain no-repeat;-webkit-mask:url(\"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20105%20104%22%3E%3Cpath%20d%3D%22M3.53358%20104L3.73942%2075.4788H64.8398C68.2705%2075.4788%2070.6719%2074.8897%2072.1128%2073.7461C73.5537%2072.6025%2074.2742%2070.9044%2074.2742%2068.6864C74.2742%2064.2159%2071.5296%2061.7901%2066.0406%2061.3742L35.5761%2059.5375C11.8701%2058.1859%200%2048.3439%200%2029.9767C0%2020.5851%203.25914%2013.2383%209.81174%207.93602C16.3643%202.63379%2026.3819%200%2039.8988%200H97.8086L98.0145%2028.5212H39.9331C36.571%2028.5212%2034.2039%2029.0756%2032.7973%2030.15C31.3907%2031.2243%2030.6703%2032.8184%2030.6703%2034.9324C30.6703%2039.1256%2033.4148%2041.4822%2038.9039%2042.0366L70.3632%2043.8734C93.4174%2045.017%20104.944%2054.6858%20104.944%2072.8104C104.944%2082.4099%20101.651%2090.034%2095.0984%2095.6135C88.5458%20101.193%2078.5968%20104%2065.2515%20104H3.53358Z%22%2F%3E%3C%2Fsvg%3E\") center / contain no-repeat}.stash-theme-controls{display:inline-flex;padding:4px;border:1px solid var(--stash-header-border);border-radius:9999px}.stash-theme-controls button{display:grid;place-items:center;width:26px;height:26px;padding:6px;border-radius:9999px;color:var(--stash-muted);cursor:pointer}.stash-theme-controls button[aria-pressed=\"true\"]{background:var(--stash-control-active);color:var(--stash-foreground)}.stash-theme-controls svg{width:14px;height:14px}.stash-sidebar-toggle{display:grid;place-items:center;width:32px;height:32px;margin-inline-end:-6px;padding:6px;border-radius:9999px;border:1px solid var(--stash-header-border);background:var(--stash-control);color:var(--stash-muted);cursor:pointer}.stash-sidebar-toggle svg{width:18px;height:18px}.stash-theme-controls button:hover,.stash-sidebar-toggle:hover{color:var(--stash-foreground)}.stash-theme-controls button:focus-visible,.stash-sidebar-toggle:focus-visible{outline:2px solid var(--stash-foreground);outline-offset:2px}html[data-stash-setting-theme] [data-component-part=\"theme-preference-menu-content\"]{visibility:hidden}.stash-background{position:fixed;inset:0;z-index:-1;overflow:hidden;pointer-events:none;user-select:none}#content .stash-background img{position:absolute;max-width:none;margin:0!important;object-fit:contain;filter:brightness(0.8);border-radius:0}@media (max-width: 767px){.stash-background{display:none}}@media (min-width: 1024px){#navbar>div:not(#navbar-transition)>div>div:has(>div>div>div>a>.nav-logo)>div:first-child{padding-inline:24px;margin-inline:0;border-bottom:1px solid var(--stash-header-border)}#navbar div:has(>div>a>.nav-logo){border-bottom:0}#navbar div:has(>#search-bar-entry){position:absolute;left:50%;transform:translateX(-50%);width:384px;flex:none}#search-bar-entry{height:36px;padding:6px 6px 6px 10px;border:1px solid var(--stash-header-border);color:var(--stash-muted);box-shadow:none;background:var(--stash-control);filter:none;font-size:14px;line-height:20px}#search-bar-entry [data-search-item=\"trigger-icon\"]{color:inherit;stroke-width:2}#search-bar-entry [data-search-item=\"trigger-hint\"]{display:inline-flex;gap:2px;font-size:14px;font-weight:300!important}#search-bar-entry kbd{border:1px solid var(--stash-header-border);border-radius:6px;padding:0 6px;background:var(--stash-page-background);font:inherit}#navbar div:has(>nav[aria-label=\"Main\"]){gap:8px}#navbar div:has(>nav[aria-label=\"Main\"])>*{margin-inline:0}#navbar div:has(>nav[aria-label=\"Main\"])>.stash-sidebar-toggle{margin-inline-end:-6px}#navbar div:has(>.nav-tabs){height:40px;padding-inline:24px}#navbar .nav-tabs{width:100%;align-items:flex-end;border-bottom:1px solid transparent}#navbar .nav-tabs-item{height:28px;padding-bottom:8px;line-height:20px}#navbar .nav-tabs-item>div{height:2px}#navbar div:has(>#search-bar-entry){left:calc(50% - 192px);transform:none}[data-layout-item=\"sidebar\"]{top:var(--stash-header-height);height:calc(100vh - var(--stash-header-height))}html[data-stash-sidebar-collapsed]{--sidebar-width: 0px}}@media (max-width: 1023px){#navbar>div:not(#navbar-transition)>div>div:has(>div>div>div>a>.nav-logo)>div:first-child{height:56px;border-bottom:1px solid var(--stash-header-border)}#navbar div:has(>div>a>.nav-logo){border-bottom:0}#navbar button:has(>div>span.sr-only){position:absolute;top:10.5px;right:10px;width:34px;height:34px;padding:8px}#navbar button:has(>div>span.sr-only)>div:last-child{display:none}#navbar button:has(>div>span.sr-only)>div:first-child>svg{width:18px;height:18px}#navbar button:has(>div>span.sr-only)::after{content:\"\";position:absolute;inset:8px;background:var(--stash-muted);mask:url(\"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20width%3D%2218%22%20height%3D%2218%22%20x%3D%223%22%20y%3D%223%22%20rx%3D%222%22%2F%3E%3Cpath%20d%3D%22M9%203v18%22%2F%3E%3C%2Fsvg%3E\") center / contain no-repeat;-webkit-mask:url(\"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20width%3D%2218%22%20height%3D%2218%22%20x%3D%223%22%20y%3D%223%22%20rx%3D%222%22%2F%3E%3Cpath%20d%3D%22M9%203v18%22%2F%3E%3C%2Fsvg%3E\") center / contain no-repeat}#navbar button:has(>div>span.sr-only)>div:first-child>svg{visibility:hidden}#search-bar-entry-mobile{position:absolute;right:28px;top:10.5px;width:34px;height:34px}#navbar button[aria-label=\"More actions\"]{display:none}#content-container>div:has(>#content-area){padding-top:96px}#mobile-nav .stash-mobile-studio{flex:none;margin:12px 16px 16px 64px;padding:8px 12px;border:1px solid var(--stash-header-border);border-radius:9999px;text-align:center;font-size:14px;color:var(--stash-muted)}}#assistant-entry,#assistant-entry-mobile{display:none!important}:root{--stash-content-border: rgba(153, 153, 153, 0.2);--stash-text: #262626;--stash-heading: #0a0a0a;--stash-card: #fff;--stash-active-nav: rgba(10, 10, 10, 0.1);--stash-ease: cubic-bezier(0.4, 0, 0.2, 1);--content-width: 900px}html.dark{--stash-text: #e5e5e5;--stash-heading: #fafafa;--stash-card: #262626;--stash-active-nav: rgba(250, 250, 250, 0.1)}#header>div:first-child,#header>div:first-child>div{margin-top:0}#header nav[aria-label=\"Breadcrumb\"]{display:none}#page-title{color:var(--stash-heading)}#header>.prose{margin-top:16px;color:var(--stash-muted);line-height:28px}#header>.prose>p{margin:0;color:inherit}#header::after{content:\"\";display:block;margin-top:24px;border-bottom:1px solid var(--stash-content-border)}#content{margin-top:24px;margin-bottom:16px;color:var(--stash-text)}#content h2,#content h3,#content h4{color:var(--stash-heading)}#content h2{font-size:24px;line-height:32px;margin-top:48px;margin-bottom:24px}#content h3{font-size:20px;line-height:28px}#content>:first-child:not(.stash-background){margin-top:0}#content .card{border-radius:12px;background:var(--stash-card);border-color:var(--stash-content-border);box-shadow:none}#content [data-component-part=\"card-content-container\"]{padding:16px}#content [data-component-part=\"card-title\"]{font-size:14px;line-height:20px;font-weight:500!important;color:var(--stash-heading);margin-top:0;margin-bottom:0}#content [data-component-part=\"card-content\"]{font-size:14px;line-height:21px;margin-top:4px;color:var(--stash-muted)}#content [data-component-part=\"card-icon\"]:has(>img){width:78px;height:78px;padding:7px;margin-bottom:8px;border:1px solid var(--stash-content-border);border-radius:8px;background:#f5f5f5;box-shadow:0 2px 3px rgb(0 0 0 / 0.1)}html.dark #content [data-component-part=\"card-icon\"]:has(>img){background:#303030}#content [data-component-part=\"card-icon\"]>img{width:64px;height:64px}#content .card{margin-block:0}#content div:has(>.card){gap:12px}#content .card:hover{background:var(--stash-menu-surface);border-color:var(--stash-content-border)}#content .callout{position:relative;border-radius:12px;border-color:var(--stash-content-border);background:var(--stash-card);box-shadow:0 2px 4px rgb(0 0 0 / 0.1)}#content [data-component-part=\"callout-content\"]{color:var(--stash-muted)}#content .callout::before{content:\"\";position:absolute;inset:10px auto 10px 5px;width:2px;background:currentColor;border-radius:2px}.feedback-toolbar{margin-top:16px;margin-bottom:16px;padding:12px 0;border-block:1px solid var(--stash-content-border);color:var(--stash-heading)}#feedback-thumbs-up,#feedback-thumbs-down{border:1px solid var(--stash-content-border);border-radius:9999px;padding:8px 12px;gap:8px;color:var(--stash-muted);background:transparent}#feedback-thumbs-up>small,#feedback-thumbs-down>small{line-height:20px}.feedback-toolbar>div:first-child{justify-content:flex-start;gap:8px}.feedback-toolbar>div:first-child>p{font-weight:500;color:var(--stash-heading);margin-right:8px}.feedback-toolbar>div:first-child>div{flex-grow:0;justify-content:flex-start;gap:8px}.feedback-toolbar>div:first-child>div>div{gap:8px}.stash-verification-badge{display:inline-flex;align-items:center;gap:6px;flex:0 0 auto;margin-inline-start:auto;padding:4px 10px;border:1px solid var(--stash-content-border);border-radius:9999px;color:var(--stash-muted);background:var(--stash-menu-glass);font-size:12px;font-weight:500;line-height:18px;white-space:nowrap}.stash-verification-badge svg{width:16px;height:16px;flex-shrink:0}.stash-verification-badge[data-status=\"verified\"]{color:var(--stash-heading);background:transparent}.stash-verification-badge[data-status=\"verified\"] svg{color:#4d7c0f;fill:#b6ff00}.stash-verification-badge[data-status=\"outdated\"] svg{color:#a16207}html.dark .stash-verification-badge[data-status=\"outdated\"] svg{color:#facc15}.stash-verification-row{display:flex;align-items:center;justify-content:flex-end;min-height:64px;margin-block:16px;padding-block:12px;border-block:1px solid var(--stash-content-border)}#pagination{gap:16px;margin-top:16px;padding:0}#pagination>a{flex:1 1 0%;min-height:70px;padding:16px;gap:8px;border:1px solid var(--stash-content-border);border-radius:8px;background:var(--stash-menu-glass);backdrop-filter:blur(4px);color:var(--stash-heading);font-weight:500}#pagination>a[rel=\"next\"]{justify-content:flex-end}#pagination>a:hover{background:var(--stash-control-active)}#footer{margin-top:24px;border-color:var(--stash-content-border);padding-top:24px}[data-assistant-bar]{display:block;margin-top:24px}#sidebar-content{padding-inline:15px 0}#sidebar-content>[data-component-part=\"scroll-area-viewport\"]{padding-right:16px}#sidebar-content div:has(>#navigation-items)>div:first-child{height:40px}#sidebar-content .sidebar-group-header,#mobile-nav .sidebar-group-header{padding-left:8px;font-weight:300;color:var(--stash-heading)}#sidebar-content .sidebar-title,#mobile-nav .sidebar-title{font-weight:300!important}#navigation-items>div+div{margin-top:24px}.sidebar-group-header{margin-bottom:6px;line-height:20px}.sidebar-group>li,.sidebar-group ul>li{margin-top:0;margin-bottom:0}.sidebar-group>li>a,.sidebar-group>li>button{border-radius:8px;gap:8px;color:var(--stash-muted);text-shadow:none;padding-block:8px;line-height:20px;font-size:14px}#navigation-items>div>.sidebar-group>li>a,#navigation-items>div>.sidebar-group>li>button{padding-left:8px!important;padding-right:8px}.sidebar-group>li[data-active]>a{background:var(--stash-active-nav);color:var(--stash-heading)}.sidebar-group>li>a:hover,.sidebar-group>li>button:hover{color:var(--stash-heading);background:var(--stash-control-active)}.sidebar-group>li>button[aria-expanded]>div:last-child{margin-left:auto}.sidebar-group>li>button[aria-expanded]>div:last-child>svg{width:14px;height:14px}.sidebar-group a>div:has(>.method-nav-pill){order:2}.method-nav-pill{width:auto}.method-nav-pill>span{font-family:ui-monospace, monospace;font-size:12px;font-weight:400;padding:0;background:transparent!important}.sidebar-group a>div:has(>.method-nav-pill){align-self:center}.method-nav-pill[data-stash-method=\"get\"]>span{color:#00bc3a}.method-nav-pill[data-stash-method=\"post\"]>span{color:#2b7fff}.method-nav-pill[data-stash-method=\"put\"]>span{color:#d08700}.stash-api-switch{display:grid;grid-template-columns:1fr 1fr;gap:4px;padding:4px;margin-bottom:32px;border:1px solid var(--stash-content-border);border-radius:8px}.stash-api-switch>a{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;padding:8px;border:1px solid transparent;border-radius:6px;color:var(--stash-muted);font-size:14px;font-weight:500;line-height:20px}.stash-api-switch svg{width:16px;height:16px}.stash-api-switch>a:hover{color:var(--stash-heading);background:var(--stash-control-active)}.stash-api-switch>a[aria-current=\"true\"]{color:var(--stash-heading);background:rgb(255 255 255 / 0.85);border-color:rgb(255 255 255 / 0.6);box-shadow:0 1px 2px rgb(0 0 0 / 0.05);backdrop-filter:blur(4px)}html.dark .stash-api-switch>a[aria-current=\"true\"]{background:rgb(255 255 255 / 0.15);border-color:rgb(255 255 255 / 0.2)}.stash-api-switch>a:focus-visible{outline:2px solid var(--stash-heading);outline-offset:2px}.nav-dropdown-trigger[data-stash-api-switch]{display:none}.stash-api-overview>.sidebar-group-header{display:none}#navigation-items>.stash-api-overview{margin-top:0}html[data-current-path^=\"/api/\"] #sidebar-content div:has(>#navigation-items)>div:first-child{height:16px}@media (min-width: 1024px){#content-container>div:has(>#content-area){gap:24px;padding:32px 0 0 24px;max-width:1200px;margin-inline:auto}#content-area{padding:0;margin:0;min-width:0;width:0;max-width:none;flex:1 1 0%}#content-side-layout{width:286px;flex-shrink:0;top:152px;height:calc(100dvh - 152px)}#table-of-contents-layout{padding-left:0;padding-right:16px;width:286px}#content-container>div:has(>#content-side-layout[data-api-example]){display:grid;grid-template-columns:minmax(0, 1fr) 400px;row-gap:0;padding-right:24px;max-width:1200px}#content-side-layout[data-api-example]{grid-column:2;grid-row:2;width:400px;top:136px;height:calc(100dvh - 160px)}#content-side-layout[data-api-example]>div{width:400px}#content-side-layout[data-api-example]+#content-area{display:contents}#content-side-layout[data-api-example]+#content-area>*{grid-column:1 / -1}#content-side-layout[data-api-example]+#content-area>#header{margin-bottom:16px}#content-side-layout[data-api-example]+#content-area>#api-playground-2-operation-page{grid-column:1;grid-row:2}#content-side-layout[data-api-example]+#content-area>[data-assistant-bar]{grid-column:1}#content-side-layout[data-api-example]+#content-area>#header::after{display:none}@media (max-width: 1279px){#content-container>div:has(>#content-area){padding-right:24px}#content-container>div:has(>#content-side-layout[data-api-example]){display:flex}#content-side-layout[data-api-example]+#content-area{display:block}}[data-layout-item=\"sidebar\"]{overflow:clip}#sidebar-content{width:285px}html[data-stash-sidebar-collapsed] [data-layout-item=\"sidebar\"]{border-right-width:0}html[data-stash-sidebar-collapsed] #sidebar-content{transform:translateX(-100%);visibility:hidden;pointer-events:none}}#api-playground-2-operation-page>div:first-child{margin-top:0}#content-area:has(>#api-playground-2-operation-page)>#header::after{display:none}.api-section-heading-title{color:var(--stash-heading);font-weight:400!important;font-size:20px;line-height:28px}html:is([data-current-path=\"/api/ingress\"],[data-current-path=\"/api/egress\"]) #content-side-layout{display:none}html:is([data-current-path=\"/api/ingress\"],[data-current-path=\"/api/egress\"]) #content-container>div:has(>#content-area){max-width:1200px}html:is([data-current-path=\"/api/ingress\"],[data-current-path=\"/api/egress\"]) #header::after{margin-top:32px}@media (min-width: 1024px){html:is([data-current-path=\"/api/ingress\"],[data-current-path=\"/api/egress\"]) #content-container>div:has(>#content-area){padding-right:24px}}@media (max-width: 1023px){#content-container>div:has(>#content-area){padding-top:88px}#content-area{padding-inline:0}#search-bar-entry-mobile{right:48px}#header>#page-context-menu{margin-top:16px}#header::after{margin-top:24px}#pagination{gap:12px}#pagination>a{padding:12px}.stash-api-switch{margin:8px 0 24px}}#stash-mobile-contents{display:none}@media (max-width: 1023px){#stash-mobile-contents{display:block;position:fixed;inset:56px 0 auto;z-index:35;color:var(--stash-muted);background:var(--stash-header-glass);border-bottom:1px solid var(--stash-content-border);backdrop-filter:blur(4px);font-size:14px;line-height:20px}#stash-mobile-contents>summary{display:flex;align-items:center;gap:8px;height:40px;padding:0 16px;cursor:pointer;list-style:none}#stash-mobile-contents>summary::-webkit-details-marker{display:none}#stash-mobile-contents>summary>span{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}#stash-mobile-contents svg{width:20px;height:20px;flex:none}#stash-mobile-contents svg:first-child{opacity:0.3}#stash-mobile-contents svg:last-child{width:16px;height:16px;margin-left:auto}#stash-mobile-contents[open] svg:last-child{transform:rotate(180deg)}#stash-mobile-contents nav{max-height:min(60dvh, 320px);overflow:auto;padding:8px 16px 12px;border-top:1px solid var(--stash-content-border);background:var(--stash-menu-surface)}#stash-mobile-contents nav a{display:block;padding:6px 12px;border-radius:6px}#stash-mobile-contents nav a:hover{background:var(--stash-control-active);color:var(--stash-heading)}#stash-mobile-contents :focus-visible{outline:2px solid var(--stash-heading);outline-offset:-2px}html[data-stash-mobile-contents] #content-container>div:has(>#content-area){padding-top:128px}#content :is(h2,h3,h4)[id]{scroll-margin-top:112px}}@media (max-width: 767px){#content-container>div:has(>#content-area){padding-top:80px}html[data-stash-mobile-contents] #content-container>div:has(>#content-area){padding-top:120px}}html:is([data-current-path=\"/changelog\"],[data-current-path^=\"/changelog/\"]){--sidebar-width: 0px}html:is([data-current-path=\"/changelog\"],[data-current-path^=\"/changelog/\"]) :is(#sidebar,#content-side-layout,.stash-sidebar-toggle){display:none}html:is([data-current-path=\"/changelog\"],[data-current-path^=\"/changelog/\"]) #content-container>div:has(>#content-area){max-width:768px;padding-inline:24px}html[data-current-path=\"/changelog\"] [data-component-part=\"update-tag-list\"]{gap:6px;padding-inline:0}html[data-current-path=\"/changelog\"] [data-component-part=\"update-tag\"],.stash-changelog-tag{display:inline-flex;align-items:center;padding:2px 8px;border:1px solid var(--stash-content-border);border-radius:6px;background:var(--stash-control);color:var(--stash-foreground);font-size:12px;font-weight:500;line-height:16px;white-space:nowrap}.stash-changelog-tag{margin:0 6px 6px 0}html[data-current-path=\"/changelog\"] #content h2 a{color:inherit;border-bottom:0;text-decoration:none}html[data-current-path=\"/changelog\"] #content h2 a:hover{text-decoration:underline}@property --sidebar-width{syntax:\"\u003clength>\";inherits:true;initial-value:286px}@media (prefers-reduced-motion: no-preference){:root{transition:--sidebar-width 200ms var(--stash-ease)}#sidebar-content{transition:transform 200ms var(--stash-ease), visibility 200ms}#navbar .nav-tabs-item,#topbar-cta-button a,.stash-theme-controls button,.stash-sidebar-toggle,.sidebar-group>li>a,.sidebar-group>li>button,.stash-api-switch>a,#pagination>a,#content .card,.feedback-toolbar button{transition:color 150ms var(--stash-ease), background-color 150ms var(--stash-ease), border-color 150ms var(--stash-ease), box-shadow 150ms var(--stash-ease)}.sidebar-group button[aria-expanded] svg{transition:transform 200ms var(--stash-ease)}#stash-mobile-contents svg{transition:transform 200ms var(--stash-ease)}#navbar-transition,#content-side-layout{transition:top 200ms var(--stash-ease), height 150ms var(--stash-ease)}}@media (prefers-reduced-motion: reduce){:root,#sidebar-content,.sidebar-group *,.stash-api-switch *,#mobile-nav,#content .card,#navbar *,#pagination *,.feedback-toolbar *,[data-assistant-bar] *,#stash-mobile-contents *{transition-duration:0s!important;animation-duration:0s!important}}"}]}
{"page":{"pagePath":"api/ingress/loyalty/updateloyaltyconfig","slug":"/api/ingress/loyalty/updateloyaltyconfig","pageMetadata":{"title":"Configure a loyalty season","description":"Creates or updates one loyalty campaign (season) together with the shop-level display settings, bonus definitions and reward products it depends on, optionally sets or removes the program-level spend conversion table, and optionally activates the program. The campaign id is the upsert key: an existing id updates that season, a new id creates one. The request describes the whole season it names, so a tier or milestone omitted from it is removed from that season; bonuses and reward products are created or updated by id or SKU and never removed. Draft and scheduled seasons accept every change. An active season accepts names, descriptions, images, milestone rewards, tier earn rates and a new end date; thresholds, adding or removing tiers or milestones, the start date and reset rules are refused with FAILED_PRECONDITION listing the fields. Ended seasons are read-only. This method accepts only the versioned x-stash-hmac-signature header, signed over the request body exactly as sent; the legacy stash-hmac-signature header is rejected with HTTP 401 (UNAUTHENTICATED), because it carries no timestamp and a captured request could be replayed. Applying is idempotent, so resending the same request is safe. Errors, by the HTTP status a REST caller receives and its gRPC status. Two of them share HTTP 400; a REST caller tells them apart by the code in the error body, 3 for INVALID_ARGUMENT and 9 for FAILED_PRECONDITION. 400 INVALID_ARGUMENT (code 3) with per-field violations when validation fails, including a spend conversion price whose rate against the US dollar is more than 3 times above or below the market rate, which the violation on that price names; fix the request, correcting the price, because resending it unchanged does not help. 400 FAILED_PRECONDITION (code 9) when the request cannot apply to the program as it stands, with the reason in the message: for example a locked field of an active season changes (the message lists the fields), the shop has no loyalty program and activate is not set, or the shop's loyalty program is bound to more than one shop; resend only once that changes, or as is when the message says to re-send the request. 401 UNAUTHENTICATED when the signature is missing, invalid, outside the time window, sent in the legacy header, or names a different shop; fix the signing. 403 PERMISSION_DENIED when the shop is not enabled for configuration writes; it does not change on a retry. 404 NOT_FOUND for an unknown shop; it does not change on a retry. 409 ABORTED when another update for the shop is in progress; resend the same request after a short wait, which is safe because applying is idempotent. 501 UNIMPLEMENTED when the loyalty configuration API is not available; it does not change on a retry. 500 INTERNAL when Stash hits an internal error, for example reading or writing the shop's loyalty configuration; resend the same request with backoff. 503 UNAVAILABLE when the request has a spend conversion price in a currency other than USD and Stash has no market rates loaded, for example shortly after a restart; nothing is written, and resending the same request with backoff is safe because applying is idempotent.","deprecated":null,"version":null,"sidebarTitle":"Configure a loyalty season","openapi":"/ingress-openapi.json put /sdk/studio/{shopId}/loyalty/config","href":"/api/ingress/loyalty/updateloyaltyconfig","autogeneratedByOpenApi":true},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Creates or updates one loyalty campaign (season) together with the shop-level display settings, bonus definitions and reward products it depends on, optionally sets or removes the program-level spend conversion table, and optionally activates the program. The campaign id is the upsert key: an existing id updates that season, a new id creates one. The request describes the whole season it names, so a tier or milestone omitted from it is removed from that season; bonuses and reward products are created or updated by id or SKU and never removed. Draft and scheduled seasons accept every change. An active season accepts names, descriptions, images, milestone rewards, tier earn rates and a new end date; thresholds, adding or removing tiers or milestones, the start date and reset rules are refused with FAILED_PRECONDITION listing the fields. Ended seasons are read-only. This method accepts only the versioned x-stash-hmac-signature header, signed over the request body exactly as sent; the legacy stash-hmac-signature header is rejected with HTTP 401 (UNAUTHENTICATED), because it carries no timestamp and a captured request could be replayed. Applying is idempotent, so resending the same request is safe. Errors, by the HTTP status a REST caller receives and its gRPC status. Two of them share HTTP 400; a REST caller tells them apart by the code in the error body, 3 for INVALID_ARGUMENT and 9 for FAILED_PRECONDITION. 400 INVALID_ARGUMENT (code 3) with per-field violations when validation fails, including a spend conversion price whose rate against the US dollar is more than 3 times above or below the market rate, which the violation on that price names; fix the request, correcting the price, because resending it unchanged does not help. 400 FAILED_PRECONDITION (code 9) when the request cannot apply to the program as it stands, with the reason in the message: for example a locked field of an active season changes (the message lists the fields), the shop has no loyalty program and activate is not set, or the shop’s loyalty program is bound to more than one shop; resend only once that changes, or as is when the message says to re-send the request. 401 UNAUTHENTICATED when the signature is missing, invalid, outside the time window, sent in the legacy header, or names a different shop; fix the signing. 403 PERMISSION_DENIED when the shop is not enabled for configuration writes; it does not change on a retry. 404 NOT_FOUND for an unknown shop; it does not change on a retry. 409 ABORTED when another update for the shop is in progress; resend the same request after a short wait, which is safe because applying is idempotent. 501 UNIMPLEMENTED when the loyalty configuration API is not available; it does not change on a retry. 500 INTERNAL when Stash hits an internal error, for example reading or writing the shop’s loyalty configuration; resend the same request with backoff. 503 UNAVAILABLE when the request has a spend conversion price in a currency other than USD and Stash has no market rates loaded, for example shortly after a restart; nothing is written, and resending the same request with backoff is safe because applying is idempotent.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){return _jsx(_Fragment,{})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Configure a loyalty season","description":"Creates or updates one loyalty campaign (season) together with the shop-level display settings, bonus definitions and reward products it depends on, optionally sets or removes the program-level spend conversion table, and optionally activates the program. The campaign id is the upsert key: an existing id updates that season, a new id creates one. The request describes the whole season it names, so a tier or milestone omitted from it is removed from that season; bonuses and reward products are created or updated by id or SKU and never removed. Draft and scheduled seasons accept every change. An active season accepts names, descriptions, images, milestone rewards, tier earn rates and a new end date; thresholds, adding or removing tiers or milestones, the start date and reset rules are refused with FAILED_PRECONDITION listing the fields. Ended seasons are read-only. This method accepts only the versioned x-stash-hmac-signature header, signed over the request body exactly as sent; the legacy stash-hmac-signature header is rejected with HTTP 401 (UNAUTHENTICATED), because it carries no timestamp and a captured request could be replayed. Applying is idempotent, so resending the same request is safe. Errors, by the HTTP status a REST caller receives and its gRPC status. Two of them share HTTP 400; a REST caller tells them apart by the code in the error body, 3 for INVALID_ARGUMENT and 9 for FAILED_PRECONDITION. 400 INVALID_ARGUMENT (code 3) with per-field violations when validation fails, including a spend conversion price whose rate against the US dollar is more than 3 times above or below the market rate, which the violation on that price names; fix the request, correcting the price, because resending it unchanged does not help. 400 FAILED_PRECONDITION (code 9) when the request cannot apply to the program as it stands, with the reason in the message: for example a locked field of an active season changes (the message lists the fields), the shop has no loyalty program and activate is not set, or the shop's loyalty program is bound to more than one shop; resend only once that changes, or as is when the message says to re-send the request. 401 UNAUTHENTICATED when the signature is missing, invalid, outside the time window, sent in the legacy header, or names a different shop; fix the signing. 403 PERMISSION_DENIED when the shop is not enabled for configuration writes; it does not change on a retry. 404 NOT_FOUND for an unknown shop; it does not change on a retry. 409 ABORTED when another update for the shop is in progress; resend the same request after a short wait, which is safe because applying is idempotent. 501 UNIMPLEMENTED when the loyalty configuration API is not available; it does not change on a retry. 500 INTERNAL when Stash hits an internal error, for example reading or writing the shop's loyalty configuration; resend the same request with backoff. 503 UNAVAILABLE when the request has a spend conversion price in a currency other than USD and Stash has no market rates loaded, for example shortly after a restart; nothing is written, and resending the same request with backoff is safe because applying is idempotent.","deprecated":null,"version":null,"sidebarTitle":"Configure a loyalty season","openapi":"/ingress-openapi.json put /sdk/studio/{shopId}/loyalty/config","href":"/api/ingress/loyalty/updateloyaltyconfig","autogeneratedByOpenApi":true}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":["/_mintlify/custom/stash-gg/7a02d7154563de2a/stash-header.js"],"openApiReferenceData":{"operation":{"summary":"Configure a loyalty season","description":"Creates or updates one loyalty campaign (season) together with the shop-level display settings, bonus definitions and reward products it depends on, optionally sets or removes the program-level spend conversion table, and optionally activates the program. The campaign id is the upsert key: an existing id updates that season, a new id creates one. The request describes the whole season it names, so a tier or milestone omitted from it is removed from that season; bonuses and reward products are created or updated by id or SKU and never removed. Draft and scheduled seasons accept every change. An active season accepts names, descriptions, images, milestone rewards, tier earn rates and a new end date; thresholds, adding or removing tiers or milestones, the start date and reset rules are refused with FAILED_PRECONDITION listing the fields. Ended seasons are read-only. This method accepts only the versioned x-stash-hmac-signature header, signed over the request body exactly as sent; the legacy stash-hmac-signature header is rejected with HTTP 401 (UNAUTHENTICATED), because it carries no timestamp and a captured request could be replayed. Applying is idempotent, so resending the same request is safe. Errors, by the HTTP status a REST caller receives and its gRPC status. Two of them share HTTP 400; a REST caller tells them apart by the code in the error body, 3 for INVALID_ARGUMENT and 9 for FAILED_PRECONDITION. 400 INVALID_ARGUMENT (code 3) with per-field violations when validation fails, including a spend conversion price whose rate against the US dollar is more than 3 times above or below the market rate, which the violation on that price names; fix the request, correcting the price, because resending it unchanged does not help. 400 FAILED_PRECONDITION (code 9) when the request cannot apply to the program as it stands, with the reason in the message: for example a locked field of an active season changes (the message lists the fields), the shop has no loyalty program and activate is not set, or the shop's loyalty program is bound to more than one shop; resend only once that changes, or as is when the message says to re-send the request. 401 UNAUTHENTICATED when the signature is missing, invalid, outside the time window, sent in the legacy header, or names a different shop; fix the signing. 403 PERMISSION_DENIED when the shop is not enabled for configuration writes; it does not change on a retry. 404 NOT_FOUND for an unknown shop; it does not change on a retry. 409 ABORTED when another update for the shop is in progress; resend the same request after a short wait, which is safe because applying is idempotent. 501 UNIMPLEMENTED when the loyalty configuration API is not available; it does not change on a retry. 500 INTERNAL when Stash hits an internal error, for example reading or writing the shop's loyalty configuration; resend the same request with backoff. 503 UNAVAILABLE when the request has a spend conversion price in a currency other than USD and Stash has no market rates loaded, for example shortly after a restart; nothing is written, and resending the same request with backoff is safe because applying is idempotent.","operationId":"UpdateLoyaltyConfig","responses":{"200":"de1218de-59b9-42a3-afe4-06ee0e1bbfb5","default":"101ccd97-c8f0-493b-bbdc-f55fd9474b1a"},"parameters":["58825707-63c9-4522-bbd9-9f0e97f25ae5"],"requestBody":"b9e89040-872d-4fb9-818c-8080a41be179","tags":["Loyalty"],"security":["f79e3196-e626-4819-8fb6-82ecc2d2c616"],"x-mint":{"href":"/api/ingress/loyalty/updateloyaltyconfig","metadata":{"title":"Configure a loyalty season","sidebarTitle":"Configure a loyalty season"}},"method":"put","type":"path","servers":["cb086fb0-6f91-4f3d-b06f-9c2f914c9293"],"path":"/sdk/studio/{shopId}/loyalty/config","baseUrlOptions":["https://test-api.stash.gg"],"title":"Configure a loyalty season","codeSamples":[],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{"58825707-63c9-4522-bbd9-9f0e97f25ae5":{"name":"shopId","description":"Shop identifier from Stash Studio","in":"path","required":true,"schema":{"type":"string","isRequired":true,"description":"Shop identifier from Stash Studio","uniqueKey":"","typeLabel":"string"}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"campaign":{"type":"object","properties":{"id":{"type":"string","description":"Partner-chosen campaign identifier: letters, digits, dot, underscore and hyphen, up to 36 characters, not \".\" or \"..\". An existing id updates that season; a new id creates one. A new id is a season boundary for every player: milestone claims are keyed by campaign.","isRequired":true,"uniqueKey":"campaign.id","typeLabel":"string"},"name":{"type":"string","description":"Display name of the season. Up to 1024 characters.","isRequired":true,"uniqueKey":"campaign.name","typeLabel":"string"},"startAt":{"type":"string","format":"date-time","description":"When the season starts (RFC 3339). Omit on a draft. A future value schedules the season; on activation, omit to start now. Locked once the season is active.","uniqueKey":"campaign.startAt","typeLabel":"string\u003cdate-time>"},"endAt":{"type":"string","format":"date-time","description":"When the season ends (RFC 3339). Must be in the future when set and must not overlap another season. Omit for an open-ended season. May be changed on an active season.","uniqueKey":"campaign.endAt","typeLabel":"string\u003cdate-time>"},"reset":{"type":"object","properties":{"points":{"type":"string","enum":["POINTS_UNSPECIFIED","POINTS_CARRY","POINTS_RESET_TO_TIER_START"],"default":"POINTS_UNSPECIFIED","description":" - POINTS_CARRY: The points balance carries over unchanged.\n - POINTS_RESET_TO_TIER_START: The points balance drops to the start of the player's current tier.","isRequired":true,"uniqueKey":"campaign.reset.points","typeLabel":"enum\u003cstring>"},"milestoneClaims":{"type":"string","enum":["MILESTONE_CLAIMS_UNSPECIFIED","MILESTONE_CLAIMS_RESET","MILESTONE_CLAIMS_CARRY"],"default":"MILESTONE_CLAIMS_UNSPECIFIED","description":" - MILESTONE_CLAIMS_RESET: Earlier claims are cleared; every milestone of the season is claimable.\n - MILESTONE_CLAIMS_CARRY: Earlier claims are kept as history rather than cleared.","isRequired":true,"uniqueKey":"campaign.reset.milestoneClaims","typeLabel":"enum\u003cstring>"},"currency":{"type":"string","enum":["CURRENCY_UNSPECIFIED","CURRENCY_CARRY","CURRENCY_RESET"],"default":"CURRENCY_UNSPECIFIED","description":" - CURRENCY_CARRY: Loyalty currency balances carry over unchanged.\n - CURRENCY_RESET: Loyalty currency balances are cleared.","isRequired":true,"uniqueKey":"campaign.reset.currency","typeLabel":"enum\u003cstring>"}},"description":"How a player's state transitions into a season, applied when the player first arrives in it.","title":"Loyalty Reset Rules","required":["points","milestoneClaims","currency"],"uniqueKey":"campaign.reset","typeLabel":"Loyalty Reset Rules · object"},"tiers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Partner-chosen tier identifier: letters, digits, dot, underscore and hyphen, up to 256 characters, not \".\" or \"..\". Unique within the season. Reported as tierId by the loyalty read API and on webhooks.","isRequired":true,"uniqueKey":"campaign.tiers.items.[INDEX].id","typeLabel":"string"},"name":{"type":"string","description":"Display name of the tier. Up to 1024 characters.","isRequired":true,"uniqueKey":"campaign.tiers.items.[INDEX].name","typeLabel":"string"},"startPoints":{"type":"integer","format":"int64","description":"Points balance at which the tier begins. Unique within the season. Locked once the season is active.","isRequired":true,"uniqueKey":"campaign.tiers.items.[INDEX].startPoints","typeLabel":"integer\u003cint64>"},"iconUrl":{"type":"string","description":"Tier icon URL, up to 1024 characters. Partner-hosted https URL; the hostname must be on the shop's image allowlist.","uniqueKey":"campaign.tiers.items.[INDEX].iconUrl","typeLabel":"string"},"backgroundImageUrl":{"type":"string","description":"Tier background image URL, same rules as iconUrl.","uniqueKey":"campaign.tiers.items.[INDEX].backgroundImageUrl","typeLabel":"string"},"color":{"type":"string","description":"Accent colour as a six-digit CSS hex value, for example #c65d00.","uniqueKey":"campaign.tiers.items.[INDEX].color","typeLabel":"string"},"benefits":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string","description":"Benefit text as shown to players.","isRequired":true,"uniqueKey":"campaign.tiers.items.[INDEX].benefits.items.[INDEX].text","typeLabel":"string"}},"description":"One perk listed on a tier.","title":"Loyalty Tier Benefit","required":["text"],"uniqueKey":"campaign.tiers.items.[INDEX].benefits.items.[INDEX]","typeLabel":"Loyalty Tier Benefit · object"},"description":"Perks listed on the tier, shown to players in order.","uniqueKey":"campaign.tiers.items.[INDEX].benefits","typeLabel":"Loyalty Tier Benefit · object[]"},"earnRates":{"type":"array","items":{"type":"object","properties":{"bonusId":{"type":"string","description":"The bonus this rate applies to. Must be defined in bonuses or already exist for the shop.","isRequired":true,"uniqueKey":"campaign.tiers.items.[INDEX].earnRates.items.[INDEX].bonusId","typeLabel":"string"},"rewardPerDollar":{"type":"integer","format":"int64","description":"Amount of the bonus earned per US dollar of spend while in this tier. For the loyalty points bonus this is the tier's points per dollar.","isRequired":true,"uniqueKey":"campaign.tiers.items.[INDEX].earnRates.items.[INDEX].rewardPerDollar","typeLabel":"integer\u003cint64>"}},"description":"How much of one bonus a tier earns per US dollar spent.","title":"Loyalty Earn Rate","required":["bonusId","rewardPerDollar"],"uniqueKey":"campaign.tiers.items.[INDEX].earnRates.items.[INDEX]","typeLabel":"Loyalty Earn Rate · object"},"description":"How much of each bonus a player in this tier earns per US dollar spent. One entry per bonus id. Editable on an active season.","uniqueKey":"campaign.tiers.items.[INDEX].earnRates","typeLabel":"Loyalty Earn Rate · object[]"},"milestones":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Partner-chosen milestone identifier: letters, digits, dot, underscore and hyphen, up to 36 characters, not \".\" or \"..\". Unique within the season, and the API also refuses an id already used by another season of the program. Key milestones by campaign id plus milestoneId rather than by milestoneId alone. Reported as milestoneId on the milestone claimed event and by the loyalty read API.","isRequired":true,"uniqueKey":"campaign.tiers.items.[INDEX].milestones.items.[INDEX].id","typeLabel":"string"},"name":{"type":"string","description":"Display name of the milestone. Up to 1024 characters.","isRequired":true,"uniqueKey":"campaign.tiers.items.[INDEX].milestones.items.[INDEX].name","typeLabel":"string"},"pointsNeeded":{"type":"integer","format":"int64","description":"Points balance at which the milestone is reached, at least 1. Unique within the season. Locked once the season is active.","isRequired":true,"uniqueKey":"campaign.tiers.items.[INDEX].milestones.items.[INDEX].pointsNeeded","typeLabel":"integer\u003cint64>"},"description":{"type":"string","description":"Description shown on the milestone. Up to 1024 characters.","uniqueKey":"campaign.tiers.items.[INDEX].milestones.items.[INDEX].description","typeLabel":"string"},"rewardName":{"type":"string","description":"Name of the reward as shown on the milestone. Up to 1024 characters.","uniqueKey":"campaign.tiers.items.[INDEX].milestones.items.[INDEX].rewardName","typeLabel":"string"},"rewardImageUrl":{"type":"string","description":"Reward image URL, up to 1024 characters. Partner-hosted https URL; the hostname must be on the shop's image allowlist.","uniqueKey":"campaign.tiers.items.[INDEX].milestones.items.[INDEX].rewardImageUrl","typeLabel":"string"},"backgroundImageUrl":{"type":"string","description":"Milestone background image URL, same rules as rewardImageUrl.","uniqueKey":"campaign.tiers.items.[INDEX].milestones.items.[INDEX].backgroundImageUrl","typeLabel":"string"},"bonusRewards":{"type":"array","items":{"type":"object","properties":{"bonusId":{"type":"string","description":"The bonus granted. Must be defined in bonuses or already exist for the shop.","isRequired":true,"uniqueKey":"campaign.tiers.items.[INDEX].milestones.items.[INDEX].bonusRewards.items.[INDEX].bonusId","typeLabel":"string"},"amount":{"type":"integer","format":"int64","description":"Amount of the bonus granted.","isRequired":true,"uniqueKey":"campaign.tiers.items.[INDEX].milestones.items.[INDEX].bonusRewards.items.[INDEX].amount","typeLabel":"integer\u003cint64>"}},"description":"An amount of one bonus granted at a milestone.","title":"Loyalty Bonus Reward","required":["bonusId","amount"],"uniqueKey":"campaign.tiers.items.[INDEX].milestones.items.[INDEX].bonusRewards.items.[INDEX]","typeLabel":"Loyalty Bonus Reward · object"},"description":"Bonus amounts granted when the milestone is claimed. Editable on an active season; a milestone already claimed keeps the reward it was granted.","uniqueKey":"campaign.tiers.items.[INDEX].milestones.items.[INDEX].bonusRewards","typeLabel":"Loyalty Bonus Reward · object[]"},"productRewards":{"type":"array","items":{"type":"object","properties":{"sku":{"type":"string","description":"SKU of the product granted, exactly as the product is identified in the shop: any non-empty string, the same rule as the catalog's productId. Must be a published product: a reward-only product from products in the same request or from Studio's Loyalty Products page, or a sellable product from the shop's catalog.","isRequired":true,"uniqueKey":"campaign.tiers.items.[INDEX].milestones.items.[INDEX].productRewards.items.[INDEX].sku","typeLabel":"string"},"quantity":{"type":"integer","format":"int64","description":"Quantity of the product granted.","isRequired":true,"uniqueKey":"campaign.tiers.items.[INDEX].milestones.items.[INDEX].productRewards.items.[INDEX].quantity","typeLabel":"integer\u003cint64>"}},"description":"A quantity of one product granted at a milestone.","title":"Loyalty Product Reward","required":["sku","quantity"],"uniqueKey":"campaign.tiers.items.[INDEX].milestones.items.[INDEX].productRewards.items.[INDEX]","typeLabel":"Loyalty Product Reward · object"},"description":"Products granted when the milestone is claimed, by SKU. Same edit rule as bonusRewards.","uniqueKey":"campaign.tiers.items.[INDEX].milestones.items.[INDEX].productRewards","typeLabel":"Loyalty Product Reward · object[]"}},"description":"A points threshold within a tier that grants rewards when claimed.","title":"Loyalty Milestone Config","required":["id","name","pointsNeeded"],"uniqueKey":"campaign.tiers.items.[INDEX].milestones.items.[INDEX]","typeLabel":"Loyalty Milestone Config · object"},"description":"The tier's milestones.","uniqueKey":"campaign.tiers.items.[INDEX].milestones","typeLabel":"Loyalty Milestone Config · object[]"}},"description":"One tier of a season with its earn rates and milestones.","title":"Loyalty Tier Config","required":["id","name","startPoints"],"uniqueKey":"campaign.tiers.items.[INDEX]","typeLabel":"Loyalty Tier Config · object"},"description":"The season's tiers with their milestones. Start points must be unique within the season.","uniqueKey":"campaign.tiers","typeLabel":"Loyalty Tier Config · object[]"},"status":{"type":"string","enum":["CAMPAIGN_STATUS_UNSPECIFIED","CAMPAIGN_STATUS_DRAFT","CAMPAIGN_STATUS_SCHEDULED","CAMPAIGN_STATUS_ACTIVE","CAMPAIGN_STATUS_ENDED"],"default":"CAMPAIGN_STATUS_UNSPECIFIED","description":"Lifecycle status of a loyalty campaign (season), derived from the program\nstate and the campaign window.\n\n - CAMPAIGN_STATUS_DRAFT: Not visible to players: the season has no start date, or the program is not live.\n - CAMPAIGN_STATUS_SCHEDULED: The program is live and the season's start date is in the future.\n - CAMPAIGN_STATUS_ACTIVE: The program is live and the season's window contains the current time.\n - CAMPAIGN_STATUS_ENDED: The season's end date has passed. Read-only.","uniqueKey":"campaign.status","typeLabel":"enum\u003cstring>"}},"description":"A loyalty campaign (season): its window, reset rules and tiers with their milestones.","title":"Loyalty Campaign Config","required":["id","name"],"isRequired":true,"uniqueKey":"campaign","typeLabel":"Loyalty Campaign Config · object"},"activate":{"type":"boolean","description":"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.","uniqueKey":"activate","typeLabel":"boolean"},"displayConfig":{"type":"object","properties":{"programName":{"type":"string","description":"Name of the loyalty program as shown to players. Up to 1024 characters.","isRequired":true,"uniqueKey":"displayConfig.programName","typeLabel":"string"},"vipStoreName":{"type":"string","description":"Name of the VIP store as shown to players, up to 1024 characters. Omitted on reads when not configured; leaving it out of an update clears it.","uniqueKey":"displayConfig.vipStoreName","typeLabel":"string"}},"description":"Shop-level names shown to players.","title":"Loyalty Display Config","required":["programName"],"uniqueKey":"displayConfig","typeLabel":"Loyalty Display Config · object"},"bonuses":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Partner-chosen bonus identifier: letters, digits, dot, underscore and hyphen, up to 256 characters, not \".\" or \"..\". Referenced by earn rates and bonus rewards.","isRequired":true,"uniqueKey":"bonuses.items.[INDEX].id","typeLabel":"string"},"type":{"type":"string","enum":["BONUS_TYPE_UNSPECIFIED","BONUS_TYPE_LOYALTY_POINTS","BONUS_TYPE_IN_GAME_CURRENCY","BONUS_TYPE_LOYALTY_CURRENCY"],"default":"BONUS_TYPE_UNSPECIFIED","description":"The kind of value a shop bonus represents. A shop holds at most one bonus of\neach kind.\n\n - BONUS_TYPE_LOYALTY_POINTS: Loyalty points (XP): the balance that drives tier progression and milestones. Held by Stash.\n - BONUS_TYPE_IN_GAME_CURRENCY: An in-game currency such as gems, delivered as bonus items on the purchase webhook. Stash holds no balance.\n - BONUS_TYPE_LOYALTY_CURRENCY: A loyalty currency held by Stash in the player's wallet.","isRequired":true,"uniqueKey":"bonuses.items.[INDEX].type","typeLabel":"enum\u003cstring>"},"name":{"type":"string","description":"Singular display name, for example Gem. Up to 1024 characters.","isRequired":true,"uniqueKey":"bonuses.items.[INDEX].name","typeLabel":"string"},"pluralName":{"type":"string","description":"Plural display name, for example Gems. Up to 1024 characters.","uniqueKey":"bonuses.items.[INDEX].pluralName","typeLabel":"string"},"abbreviatedName":{"type":"string","description":"Short display name, for example LP. Up to 1024 characters.","uniqueKey":"bonuses.items.[INDEX].abbreviatedName","typeLabel":"string"},"iconImageUrl":{"type":"string","description":"Icon image URL, up to 1024 characters. Partner-hosted https URL; the hostname must be on the shop's image allowlist.","uniqueKey":"bonuses.items.[INDEX].iconImageUrl","typeLabel":"string"}},"description":"A shop bonus: the loyalty points balance, an in-game currency delivered through webhooks, or a loyalty currency.","title":"Loyalty Bonus Definition","required":["id","type","name"],"uniqueKey":"bonuses.items.[INDEX]","typeLabel":"Loyalty Bonus Definition · object"},"description":"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.","uniqueKey":"bonuses","typeLabel":"Loyalty Bonus Definition · object[]"},"products":{"type":"array","items":{"type":"object","properties":{"sku":{"type":"string","description":"Partner-chosen product identifier (SKU) for a reward product: any non-empty string up to 1024 characters, the same rule as the catalog's productId. The upsert key. A SKU that belongs to a sellable catalog product is refused here; reference such a product from a milestone's productRewards instead.","isRequired":true,"uniqueKey":"products.items.[INDEX].sku","typeLabel":"string"},"name":{"type":"string","description":"Name shown on the reward. Up to 1024 characters.","isRequired":true,"uniqueKey":"products.items.[INDEX].name","typeLabel":"string"},"imageUrl":{"type":"string","description":"Reward image URL, up to 1024 characters. Partner-hosted https URL; the hostname must be on the shop's image allowlist.","isRequired":true,"uniqueKey":"products.items.[INDEX].imageUrl","typeLabel":"string"},"description":{"type":"string","description":"Description shown on the reward. Up to 1024 characters.","uniqueKey":"products.items.[INDEX].description","typeLabel":"string"},"backgroundImageUrl":{"type":"string","description":"Background image URL, same rules as imageUrl.","uniqueKey":"products.items.[INDEX].backgroundImageUrl","typeLabel":"string"},"status":{"type":"string","enum":["REWARD_PRODUCT_STATUS_UNSPECIFIED","REWARD_PRODUCT_STATUS_DRAFT","REWARD_PRODUCT_STATUS_PUBLISHED"],"default":"REWARD_PRODUCT_STATUS_UNSPECIFIED","description":"Status of a reward-only product in Stash Studio.\n\n - REWARD_PRODUCT_STATUS_DRAFT: Saved but not yet published; a milestone cannot grant it.\n - REWARD_PRODUCT_STATUS_PUBLISHED: Published; a milestone can grant it.","uniqueKey":"products.items.[INDEX].status","typeLabel":"enum\u003cstring>"}},"description":"A reward-only product that a milestone can grant by SKU.","title":"Loyalty Reward Product","required":["sku","name","imageUrl"],"uniqueKey":"products.items.[INDEX]","typeLabel":"Loyalty Reward Product · object"},"description":"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.","uniqueKey":"products","typeLabel":"Loyalty Reward Product · object[]"},"spendConversion":{"type":"object","properties":{"tiers":{"type":"array","items":{"type":"object","properties":{"prices":{"type":"object","additionalProperties":{"type":"string","uniqueKey":"spendConversion.tiers.items.[INDEX].prices.additionalProperties","typeLabel":"string"},"description":"The price point's amount per currency, keyed by upper-case ISO 4217 code recognized by Stash, for example {\"USD\": \"9.99\", \"EUR\": \"9.49\", \"GBP\": \"7.99\", \"JPY\": \"1500\"}. Must include USD. Each amount is a positive decimal string whose digits past the currency's minor unit are zero, under the minor-unit standard configured for your shop (see `cents` in GetCatalog): JPY \"1500\" or \"1500.00\", not \"1500.5\". Under the default, Unicode CLDR release 32, IDR, COP, PKR and TZS accept only zeros after the point; a shop configured for CLDR release 47 or ISO 4217 may give them two places, for example IDR \"1000.50\". At most 200 currencies.","uniqueKey":"spendConversion.tiers.items.[INDEX].prices","typeLabel":"object"}},"description":"One price point expressed in several currencies.","title":"Loyalty Spend Conversion Tier","uniqueKey":"spendConversion.tiers.items.[INDEX]","typeLabel":"Loyalty Spend Conversion Tier · object"},"description":"The price rows. Exactly one row in this version; the list shape is kept for later. The row must include USD. An empty list removes the stored table. Reads return the rows as stored, with the amounts exactly as sent.","uniqueKey":"spendConversion.tiers","typeLabel":"Loyalty Spend Conversion Tier · object[]"}},"description":"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.","title":"Loyalty Spend Conversion","uniqueKey":"spendConversion","typeLabel":"Loyalty Spend Conversion · object"}},"description":"One season plus the shop-level items it depends on, and optionally the program-level spend conversion table. Signed over the request body.","title":"Update Loyalty Config Request","required":["campaign"],"uniqueKey":"","typeLabel":"Update Loyalty Config Request · object"},"examples":{"Example":{"title":"Example","value":{"campaign":{"id":"\u003cstring>","name":"\u003cstring>","startAt":"2023-11-07T05:31:56Z","endAt":"2023-11-07T05:31:56Z","tiers":[{"id":"\u003cstring>","name":"\u003cstring>","startPoints":123,"iconUrl":"\u003cstring>","backgroundImageUrl":"\u003cstring>","color":"\u003cstring>","benefits":[{"text":"\u003cstring>"}],"earnRates":[{"bonusId":"\u003cstring>","rewardPerDollar":123}],"milestones":[{"id":"\u003cstring>","name":"\u003cstring>","pointsNeeded":123,"description":"\u003cstring>","rewardName":"\u003cstring>","rewardImageUrl":"\u003cstring>","backgroundImageUrl":"\u003cstring>","bonusRewards":[{"bonusId":"\u003cstring>","amount":123}],"productRewards":[{"sku":"\u003cstring>","quantity":123}]}]}],"status":"CAMPAIGN_STATUS_UNSPECIFIED"},"activate":true,"bonuses":[{"id":"\u003cstring>","type":"BONUS_TYPE_UNSPECIFIED","name":"\u003cstring>","pluralName":"\u003cstring>","abbreviatedName":"\u003cstring>","iconImageUrl":"\u003cstring>"}],"products":[{"sku":"\u003cstring>","name":"\u003cstring>","imageUrl":"\u003cstring>","description":"\u003cstring>","backgroundImageUrl":"\u003cstring>","status":"REWARD_PRODUCT_STATUS_UNSPECIFIED"}],"spendConversion":{"tiers":[{"prices":{}}]}}}},"exampleType":"generated"}},"required":true,"exampleType":"generated"},"responses":{"de1218de-59b9-42a3-afe4-06ee0e1bbfb5":{"description":"A successful response.","content":{"application/json":{"schema":{"type":"object","properties":{"displayConfig":{"type":"object","properties":{"programName":{"type":"string","description":"Name of the loyalty program as shown to players. Up to 1024 characters.","isRequired":true,"uniqueKey":"displayConfig.programName","typeLabel":"string"},"vipStoreName":{"type":"string","description":"Name of the VIP store as shown to players, up to 1024 characters. Omitted on reads when not configured; leaving it out of an update clears it.","uniqueKey":"displayConfig.vipStoreName","typeLabel":"string"}},"description":"Shop-level names shown to players.","title":"Loyalty Display Config","required":["programName"],"uniqueKey":"displayConfig","typeLabel":"Loyalty Display Config · object"},"bonuses":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Partner-chosen bonus identifier: letters, digits, dot, underscore and hyphen, up to 256 characters, not \".\" or \"..\". Referenced by earn rates and bonus rewards.","isRequired":true,"uniqueKey":"bonuses.items.[INDEX].id","typeLabel":"string"},"type":{"type":"string","enum":["BONUS_TYPE_UNSPECIFIED","BONUS_TYPE_LOYALTY_POINTS","BONUS_TYPE_IN_GAME_CURRENCY","BONUS_TYPE_LOYALTY_CURRENCY"],"default":"BONUS_TYPE_UNSPECIFIED","description":"The kind of value a shop bonus represents. A shop holds at most one bonus of\neach kind.\n\n - BONUS_TYPE_LOYALTY_POINTS: Loyalty points (XP): the balance that drives tier progression and milestones. Held by Stash.\n - BONUS_TYPE_IN_GAME_CURRENCY: An in-game currency such as gems, delivered as bonus items on the purchase webhook. Stash holds no balance.\n - BONUS_TYPE_LOYALTY_CURRENCY: A loyalty currency held by Stash in the player's wallet.","isRequired":true,"uniqueKey":"bonuses.items.[INDEX].type","typeLabel":"enum\u003cstring>"},"name":{"type":"string","description":"Singular display name, for example Gem. Up to 1024 characters.","isRequired":true,"uniqueKey":"bonuses.items.[INDEX].name","typeLabel":"string"},"pluralName":{"type":"string","description":"Plural display name, for example Gems. Up to 1024 characters.","uniqueKey":"bonuses.items.[INDEX].pluralName","typeLabel":"string"},"abbreviatedName":{"type":"string","description":"Short display name, for example LP. Up to 1024 characters.","uniqueKey":"bonuses.items.[INDEX].abbreviatedName","typeLabel":"string"},"iconImageUrl":{"type":"string","description":"Icon image URL, up to 1024 characters. Partner-hosted https URL; the hostname must be on the shop's image allowlist.","uniqueKey":"bonuses.items.[INDEX].iconImageUrl","typeLabel":"string"}},"description":"A shop bonus: the loyalty points balance, an in-game currency delivered through webhooks, or a loyalty currency.","title":"Loyalty Bonus Definition","required":["id","type","name"],"uniqueKey":"bonuses.items.[INDEX]","typeLabel":"Loyalty Bonus Definition · object"},"description":"Every bonus defined for the shop.","uniqueKey":"bonuses","typeLabel":"Loyalty Bonus Definition · object[]"},"products":{"type":"array","items":{"type":"object","properties":{"sku":{"type":"string","description":"Partner-chosen product identifier (SKU) for a reward product: any non-empty string up to 1024 characters, the same rule as the catalog's productId. The upsert key. A SKU that belongs to a sellable catalog product is refused here; reference such a product from a milestone's productRewards instead.","isRequired":true,"uniqueKey":"products.items.[INDEX].sku","typeLabel":"string"},"name":{"type":"string","description":"Name shown on the reward. Up to 1024 characters.","isRequired":true,"uniqueKey":"products.items.[INDEX].name","typeLabel":"string"},"imageUrl":{"type":"string","description":"Reward image URL, up to 1024 characters. Partner-hosted https URL; the hostname must be on the shop's image allowlist.","isRequired":true,"uniqueKey":"products.items.[INDEX].imageUrl","typeLabel":"string"},"description":{"type":"string","description":"Description shown on the reward. Up to 1024 characters.","uniqueKey":"products.items.[INDEX].description","typeLabel":"string"},"backgroundImageUrl":{"type":"string","description":"Background image URL, same rules as imageUrl.","uniqueKey":"products.items.[INDEX].backgroundImageUrl","typeLabel":"string"},"status":{"type":"string","enum":["REWARD_PRODUCT_STATUS_UNSPECIFIED","REWARD_PRODUCT_STATUS_DRAFT","REWARD_PRODUCT_STATUS_PUBLISHED"],"default":"REWARD_PRODUCT_STATUS_UNSPECIFIED","description":"Status of a reward-only product in Stash Studio.\n\n - REWARD_PRODUCT_STATUS_DRAFT: Saved but not yet published; a milestone cannot grant it.\n - REWARD_PRODUCT_STATUS_PUBLISHED: Published; a milestone can grant it.","uniqueKey":"products.items.[INDEX].status","typeLabel":"enum\u003cstring>"}},"description":"A reward-only product that a milestone can grant by SKU.","title":"Loyalty Reward Product","required":["sku","name","imageUrl"],"uniqueKey":"products.items.[INDEX]","typeLabel":"Loyalty Reward Product · object"},"description":"Every reward-only product the shop holds, with its status.","uniqueKey":"products","typeLabel":"Loyalty Reward Product · object[]"},"campaign":{"type":"object","properties":{"id":{"type":"string","description":"Partner-chosen campaign identifier: letters, digits, dot, underscore and hyphen, up to 36 characters, not \".\" or \"..\". An existing id updates that season; a new id creates one. A new id is a season boundary for every player: milestone claims are keyed by campaign.","isRequired":true,"uniqueKey":"campaign.id","typeLabel":"string"},"name":{"type":"string","description":"Display name of the season. Up to 1024 characters.","isRequired":true,"uniqueKey":"campaign.name","typeLabel":"string"},"startAt":{"type":"string","format":"date-time","description":"When the season starts (RFC 3339). Omit on a draft. A future value schedules the season; on activation, omit to start now. Locked once the season is active.","uniqueKey":"campaign.startAt","typeLabel":"string\u003cdate-time>"},"endAt":{"type":"string","format":"date-time","description":"When the season ends (RFC 3339). Must be in the future when set and must not overlap another season. Omit for an open-ended season. May be changed on an active season.","uniqueKey":"campaign.endAt","typeLabel":"string\u003cdate-time>"},"reset":{"type":"object","properties":{"points":{"type":"string","enum":["POINTS_UNSPECIFIED","POINTS_CARRY","POINTS_RESET_TO_TIER_START"],"default":"POINTS_UNSPECIFIED","description":" - POINTS_CARRY: The points balance carries over unchanged.\n - POINTS_RESET_TO_TIER_START: The points balance drops to the start of the player's current tier.","isRequired":true,"uniqueKey":"campaign.reset.points","typeLabel":"enum\u003cstring>"},"milestoneClaims":{"type":"string","enum":["MILESTONE_CLAIMS_UNSPECIFIED","MILESTONE_CLAIMS_RESET","MILESTONE_CLAIMS_CARRY"],"default":"MILESTONE_CLAIMS_UNSPECIFIED","description":" - MILESTONE_CLAIMS_RESET: Earlier claims are cleared; every milestone of the season is claimable.\n - MILESTONE_CLAIMS_CARRY: Earlier claims are kept as history rather than cleared.","isRequired":true,"uniqueKey":"campaign.reset.milestoneClaims","typeLabel":"enum\u003cstring>"},"currency":{"type":"string","enum":["CURRENCY_UNSPECIFIED","CURRENCY_CARRY","CURRENCY_RESET"],"default":"CURRENCY_UNSPECIFIED","description":" - CURRENCY_CARRY: Loyalty currency balances carry over unchanged.\n - CURRENCY_RESET: Loyalty currency balances are cleared.","isRequired":true,"uniqueKey":"campaign.reset.currency","typeLabel":"enum\u003cstring>"}},"description":"How a player's state transitions into a season, applied when the player first arrives in it.","title":"Loyalty Reset Rules","required":["points","milestoneClaims","currency"],"uniqueKey":"campaign.reset","typeLabel":"Loyalty Reset Rules · object"},"tiers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Partner-chosen tier identifier: letters, digits, dot, underscore and hyphen, up to 256 characters, not \".\" or \"..\". Unique within the season. Reported as tierId by the loyalty read API and on webhooks.","isRequired":true,"uniqueKey":"campaign.tiers.items.[INDEX].id","typeLabel":"string"},"name":{"type":"string","description":"Display name of the tier. Up to 1024 characters.","isRequired":true,"uniqueKey":"campaign.tiers.items.[INDEX].name","typeLabel":"string"},"startPoints":{"type":"integer","format":"int64","description":"Points balance at which the tier begins. Unique within the season. Locked once the season is active.","isRequired":true,"uniqueKey":"campaign.tiers.items.[INDEX].startPoints","typeLabel":"integer\u003cint64>"},"iconUrl":{"type":"string","description":"Tier icon URL, up to 1024 characters. Partner-hosted https URL; the hostname must be on the shop's image allowlist.","uniqueKey":"campaign.tiers.items.[INDEX].iconUrl","typeLabel":"string"},"backgroundImageUrl":{"type":"string","description":"Tier background image URL, same rules as iconUrl.","uniqueKey":"campaign.tiers.items.[INDEX].backgroundImageUrl","typeLabel":"string"},"color":{"type":"string","description":"Accent colour as a six-digit CSS hex value, for example #c65d00.","uniqueKey":"campaign.tiers.items.[INDEX].color","typeLabel":"string"},"benefits":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string","description":"Benefit text as shown to players.","isRequired":true,"uniqueKey":"campaign.tiers.items.[INDEX].benefits.items.[INDEX].text","typeLabel":"string"}},"description":"One perk listed on a tier.","title":"Loyalty Tier Benefit","required":["text"],"uniqueKey":"campaign.tiers.items.[INDEX].benefits.items.[INDEX]","typeLabel":"Loyalty Tier Benefit · object"},"description":"Perks listed on the tier, shown to players in order.","uniqueKey":"campaign.tiers.items.[INDEX].benefits","typeLabel":"Loyalty Tier Benefit · object[]"},"earnRates":{"type":"array","items":{"type":"object","properties":{"bonusId":{"type":"string","description":"The bonus this rate applies to. Must be defined in bonuses or already exist for the shop.","isRequired":true,"uniqueKey":"campaign.tiers.items.[INDEX].earnRates.items.[INDEX].bonusId","typeLabel":"string"},"rewardPerDollar":{"type":"integer","format":"int64","description":"Amount of the bonus earned per US dollar of spend while in this tier. For the loyalty points bonus this is the tier's points per dollar.","isRequired":true,"uniqueKey":"campaign.tiers.items.[INDEX].earnRates.items.[INDEX].rewardPerDollar","typeLabel":"integer\u003cint64>"}},"description":"How much of one bonus a tier earns per US dollar spent.","title":"Loyalty Earn Rate","required":["bonusId","rewardPerDollar"],"uniqueKey":"campaign.tiers.items.[INDEX].earnRates.items.[INDEX]","typeLabel":"Loyalty Earn Rate · object"},"description":"How much of each bonus a player in this tier earns per US dollar spent. One entry per bonus id. Editable on an active season.","uniqueKey":"campaign.tiers.items.[INDEX].earnRates","typeLabel":"Loyalty Earn Rate · object[]"},"milestones":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Partner-chosen milestone identifier: letters, digits, dot, underscore and hyphen, up to 36 characters, not \".\" or \"..\". Unique within the season, and the API also refuses an id already used by another season of the program. Key milestones by campaign id plus milestoneId rather than by milestoneId alone. Reported as milestoneId on the milestone claimed event and by the loyalty read API.","isRequired":true,"uniqueKey":"campaign.tiers.items.[INDEX].milestones.items.[INDEX].id","typeLabel":"string"},"name":{"type":"string","description":"Display name of the milestone. Up to 1024 characters.","isRequired":true,"uniqueKey":"campaign.tiers.items.[INDEX].milestones.items.[INDEX].name","typeLabel":"string"},"pointsNeeded":{"type":"integer","format":"int64","description":"Points balance at which the milestone is reached, at least 1. Unique within the season. Locked once the season is active.","isRequired":true,"uniqueKey":"campaign.tiers.items.[INDEX].milestones.items.[INDEX].pointsNeeded","typeLabel":"integer\u003cint64>"},"description":{"type":"string","description":"Description shown on the milestone. Up to 1024 characters.","uniqueKey":"campaign.tiers.items.[INDEX].milestones.items.[INDEX].description","typeLabel":"string"},"rewardName":{"type":"string","description":"Name of the reward as shown on the milestone. Up to 1024 characters.","uniqueKey":"campaign.tiers.items.[INDEX].milestones.items.[INDEX].rewardName","typeLabel":"string"},"rewardImageUrl":{"type":"string","description":"Reward image URL, up to 1024 characters. Partner-hosted https URL; the hostname must be on the shop's image allowlist.","uniqueKey":"campaign.tiers.items.[INDEX].milestones.items.[INDEX].rewardImageUrl","typeLabel":"string"},"backgroundImageUrl":{"type":"string","description":"Milestone background image URL, same rules as rewardImageUrl.","uniqueKey":"campaign.tiers.items.[INDEX].milestones.items.[INDEX].backgroundImageUrl","typeLabel":"string"},"bonusRewards":{"type":"array","items":{"type":"object","properties":{"bonusId":{"type":"string","description":"The bonus granted. Must be defined in bonuses or already exist for the shop.","isRequired":true,"uniqueKey":"campaign.tiers.items.[INDEX].milestones.items.[INDEX].bonusRewards.items.[INDEX].bonusId","typeLabel":"string"},"amount":{"type":"integer","format":"int64","description":"Amount of the bonus granted.","isRequired":true,"uniqueKey":"campaign.tiers.items.[INDEX].milestones.items.[INDEX].bonusRewards.items.[INDEX].amount","typeLabel":"integer\u003cint64>"}},"description":"An amount of one bonus granted at a milestone.","title":"Loyalty Bonus Reward","required":["bonusId","amount"],"uniqueKey":"campaign.tiers.items.[INDEX].milestones.items.[INDEX].bonusRewards.items.[INDEX]","typeLabel":"Loyalty Bonus Reward · object"},"description":"Bonus amounts granted when the milestone is claimed. Editable on an active season; a milestone already claimed keeps the reward it was granted.","uniqueKey":"campaign.tiers.items.[INDEX].milestones.items.[INDEX].bonusRewards","typeLabel":"Loyalty Bonus Reward · object[]"},"productRewards":{"type":"array","items":{"type":"object","properties":{"sku":{"type":"string","description":"SKU of the product granted, exactly as the product is identified in the shop: any non-empty string, the same rule as the catalog's productId. Must be a published product: a reward-only product from products in the same request or from Studio's Loyalty Products page, or a sellable product from the shop's catalog.","isRequired":true,"uniqueKey":"campaign.tiers.items.[INDEX].milestones.items.[INDEX].productRewards.items.[INDEX].sku","typeLabel":"string"},"quantity":{"type":"integer","format":"int64","description":"Quantity of the product granted.","isRequired":true,"uniqueKey":"campaign.tiers.items.[INDEX].milestones.items.[INDEX].productRewards.items.[INDEX].quantity","typeLabel":"integer\u003cint64>"}},"description":"A quantity of one product granted at a milestone.","title":"Loyalty Product Reward","required":["sku","quantity"],"uniqueKey":"campaign.tiers.items.[INDEX].milestones.items.[INDEX].productRewards.items.[INDEX]","typeLabel":"Loyalty Product Reward · object"},"description":"Products granted when the milestone is claimed, by SKU. Same edit rule as bonusRewards.","uniqueKey":"campaign.tiers.items.[INDEX].milestones.items.[INDEX].productRewards","typeLabel":"Loyalty Product Reward · object[]"}},"description":"A points threshold within a tier that grants rewards when claimed.","title":"Loyalty Milestone Config","required":["id","name","pointsNeeded"],"uniqueKey":"campaign.tiers.items.[INDEX].milestones.items.[INDEX]","typeLabel":"Loyalty Milestone Config · object"},"description":"The tier's milestones.","uniqueKey":"campaign.tiers.items.[INDEX].milestones","typeLabel":"Loyalty Milestone Config · object[]"}},"description":"One tier of a season with its earn rates and milestones.","title":"Loyalty Tier Config","required":["id","name","startPoints"],"uniqueKey":"campaign.tiers.items.[INDEX]","typeLabel":"Loyalty Tier Config · object"},"description":"The season's tiers with their milestones. Start points must be unique within the season.","uniqueKey":"campaign.tiers","typeLabel":"Loyalty Tier Config · object[]"},"status":{"type":"string","enum":["CAMPAIGN_STATUS_UNSPECIFIED","CAMPAIGN_STATUS_DRAFT","CAMPAIGN_STATUS_SCHEDULED","CAMPAIGN_STATUS_ACTIVE","CAMPAIGN_STATUS_ENDED"],"default":"CAMPAIGN_STATUS_UNSPECIFIED","description":"Lifecycle status of a loyalty campaign (season), derived from the program\nstate and the campaign window.\n\n - CAMPAIGN_STATUS_DRAFT: Not visible to players: the season has no start date, or the program is not live.\n - CAMPAIGN_STATUS_SCHEDULED: The program is live and the season's start date is in the future.\n - CAMPAIGN_STATUS_ACTIVE: The program is live and the season's window contains the current time.\n - CAMPAIGN_STATUS_ENDED: The season's end date has passed. Read-only.","uniqueKey":"campaign.status","typeLabel":"enum\u003cstring>"}},"description":"A loyalty campaign (season): its window, reset rules and tiers with their milestones.","title":"Loyalty Campaign Config","required":["id","name"],"uniqueKey":"campaign","typeLabel":"Loyalty Campaign Config · object"},"warnings":{"type":"array","items":{"type":"string","uniqueKey":"warnings.items.[INDEX]","typeLabel":"string"},"description":"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.","uniqueKey":"warnings","typeLabel":"string[]"},"spendConversion":{"type":"object","properties":{"tiers":{"type":"array","items":{"type":"object","properties":{"prices":{"type":"object","additionalProperties":{"type":"string","uniqueKey":"spendConversion.tiers.items.[INDEX].prices.additionalProperties","typeLabel":"string"},"description":"The price point's amount per currency, keyed by upper-case ISO 4217 code recognized by Stash, for example {\"USD\": \"9.99\", \"EUR\": \"9.49\", \"GBP\": \"7.99\", \"JPY\": \"1500\"}. Must include USD. Each amount is a positive decimal string whose digits past the currency's minor unit are zero, under the minor-unit standard configured for your shop (see `cents` in GetCatalog): JPY \"1500\" or \"1500.00\", not \"1500.5\". Under the default, Unicode CLDR release 32, IDR, COP, PKR and TZS accept only zeros after the point; a shop configured for CLDR release 47 or ISO 4217 may give them two places, for example IDR \"1000.50\". At most 200 currencies.","uniqueKey":"spendConversion.tiers.items.[INDEX].prices","typeLabel":"object"}},"description":"One price point expressed in several currencies.","title":"Loyalty Spend Conversion Tier","uniqueKey":"spendConversion.tiers.items.[INDEX]","typeLabel":"Loyalty Spend Conversion Tier · object"},"description":"The price rows. Exactly one row in this version; the list shape is kept for later. The row must include USD. An empty list removes the stored table. Reads return the rows as stored, with the amounts exactly as sent.","uniqueKey":"spendConversion.tiers","typeLabel":"Loyalty Spend Conversion Tier · object[]"},"ratesPerUsd":{"type":"object","additionalProperties":{"type":"string","uniqueKey":"spendConversion.ratesPerUsd.additionalProperties","typeLabel":"string"},"description":"For each non-USD currency in the row, the units of that currency per one US dollar, as a decimal string with exactly four decimal places, for example \"1.0000\" or \"150.1502\". Derived and for display only: Stash converts with the exact amounts of the row, never with a rounded rate. Ignored on input.","readOnly":true,"uniqueKey":"spendConversion.ratesPerUsd","typeLabel":"object"},"updatedAt":{"type":"string","format":"date-time","description":"When the stored table last changed (RFC 3339). Ignored on input.","readOnly":true,"uniqueKey":"spendConversion.updatedAt","typeLabel":"string\u003cdate-time>"}},"description":"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.","title":"Loyalty Spend Conversion","uniqueKey":"spendConversion","typeLabel":"Loyalty Spend Conversion · object"}},"description":"The configuration as stored after the update.","title":"Update Loyalty Config Response","uniqueKey":"","typeLabel":"Update Loyalty Config Response · object"},"examples":{"Example":{"title":"Example","value":{"displayConfig":{"programName":"\u003cstring>","vipStoreName":"\u003cstring>"},"bonuses":[{"id":"\u003cstring>","type":"BONUS_TYPE_UNSPECIFIED","name":"\u003cstring>","pluralName":"\u003cstring>","abbreviatedName":"\u003cstring>","iconImageUrl":"\u003cstring>"}],"products":[{"sku":"\u003cstring>","name":"\u003cstring>","imageUrl":"\u003cstring>","description":"\u003cstring>","backgroundImageUrl":"\u003cstring>","status":"REWARD_PRODUCT_STATUS_UNSPECIFIED"}],"campaign":{"id":"\u003cstring>","name":"\u003cstring>","startAt":"2023-11-07T05:31:56Z","endAt":"2023-11-07T05:31:56Z","reset":{"points":"POINTS_UNSPECIFIED","milestoneClaims":"MILESTONE_CLAIMS_UNSPECIFIED","currency":"CURRENCY_UNSPECIFIED"},"tiers":[{"id":"\u003cstring>","name":"\u003cstring>","startPoints":123,"iconUrl":"\u003cstring>","backgroundImageUrl":"\u003cstring>","color":"\u003cstring>","benefits":[{"text":"\u003cstring>"}],"earnRates":[{"bonusId":"\u003cstring>","rewardPerDollar":123}],"milestones":[{"id":"\u003cstring>","name":"\u003cstring>","pointsNeeded":123,"description":"\u003cstring>","rewardName":"\u003cstring>","rewardImageUrl":"\u003cstring>","backgroundImageUrl":"\u003cstring>","bonusRewards":[{"bonusId":"\u003cstring>","amount":123}],"productRewards":[{"sku":"\u003cstring>","quantity":123}]}]}],"status":"CAMPAIGN_STATUS_UNSPECIFIED"},"warnings":["\u003cstring>"],"spendConversion":{"tiers":[{"prices":{}}],"ratesPerUsd":{},"updatedAt":"2023-11-07T05:31:56Z"}}}},"exampleType":"generated"}},"exampleType":"generated"},"101ccd97-c8f0-493b-bbdc-f55fd9474b1a":{"description":"An unexpected error response.","content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"integer","format":"int32","uniqueKey":"code","typeLabel":"integer\u003cint32>"},"message":{"type":"string","uniqueKey":"message","typeLabel":"string"},"details":{"type":"array","items":{"type":"object","properties":{"@type":{"type":"string","uniqueKey":"details.items.[INDEX].@type","typeLabel":"string"}},"additionalProperties":{"oneOf":[{}],"uniqueKey":"details.items.[INDEX].additionalProperties","typeLabel":"any"},"uniqueKey":"details.items.[INDEX]","typeLabel":"object"},"uniqueKey":"details","typeLabel":"object[]"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"code":123,"message":"\u003cstring>","details":[{"@type":"\u003cstring>"}]}}},"exampleType":"generated"}},"exampleType":"generated"}},"security":{"f79e3196-e626-4819-8fb6-82ecc2d2c616":{"hmac":{"type":"apiKey","description":"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.","name":"x-stash-hmac-signature","in":"header","scopes":[],"schemeName":"hmac"}}},"servers":{"cb086fb0-6f91-4f3d-b06f-9c2f914c9293":{"url":"https://test-api.stash.gg"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"apiKey","description":"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.","name":"x-stash-hmac-signature","in":"header","scopes":[],"schemeName":"hmac"},"schema":{"title":"x-stash-hmac-signature","type":"string","description":"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.","isRequired":true,"typeLabel":"string","deprecated":false},"schemeName":"hmac","name":"x-stash-hmac-signature"}],"title":"hmac"}]},"originalFileLocation":"ingress-openapi.json"},"subdomain":"stash-gg","siteName":"Stash Documentation","title":"Configure a loyalty season - Stash Documentation","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-23T22:02:48.520Z","originalFileLocation":"api/ingress/loyalty/updateloyaltyconfig.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Creates or updates one loyalty campaign (season) together with the shop-level display settings, bonus definitions and reward products it depends on, optionally sets or removes the program-level spend conversion table, and optionally activates the program. The campaign id is the upsert key: an existing id updates that season, a new id creates one. The request describes the whole season it names, so a tier or milestone omitted from it is removed from that season; bonuses and reward products are created or updated by id or SKU and never removed. Draft and scheduled seasons accept every change. An active season accepts names, descriptions, images, milestone rewards, tier earn rates and a new end date; thresholds, adding or removing tiers or milestones, the start date and reset rules are refused with FAILED_PRECONDITION listing the fields. Ended seasons are read-only. This method accepts only the versioned x-stash-hmac-signature header, signed over the request body exactly as sent; the legacy stash-hmac-signature header is rejected with HTTP 401 (UNAUTHENTICATED), because it carries no timestamp and a captured request could be replayed. Applying is idempotent, so resending the same request is safe. Errors, by the HTTP status a REST caller receives and its gRPC status. Two of them share HTTP 400; a REST caller tells them apart by the code in the error body, 3 for INVALID_ARGUMENT and 9 for FAILED_PRECONDITION. 400 INVALID_ARGUMENT (code 3) with per-field violations when validation fails, including a spend conversion price whose rate against the US dollar is more than 3 times above or below the market rate, which the violation on that price names; fix the request, correcting the price, because resending it unchanged does not help. 400 FAILED_PRECONDITION (code 9) when the request cannot apply to the program as it stands, with the reason in the message: for example a locked field of an active season changes (the message lists the fields), the shop has no loyalty program and activate is not set, or the shop\u0026#x27;s loyalty program is bound to more than one shop; resend only once that changes, or as is when the message says to re-send the request. 401 UNAUTHENTICATED when the signature is missing, invalid, outside the time window, sent in the legacy header, or names a different shop; fix the signing. 403 PERMISSION_DENIED when the shop is not enabled for configuration writes; it does not change on a retry. 404 NOT_FOUND for an unknown shop; it does not change on a retry. 409 ABORTED when another update for the shop is in progress; resend the same request after a short wait, which is safe because applying is idempotent. 501 UNIMPLEMENTED when the loyalty configuration API is not available; it does not change on a retry. 500 INTERNAL when Stash hits an internal error, for example reading or writing the shop\u0026#x27;s loyalty configuration; resend the same request with backoff. 503 UNAVAILABLE when the request has a spend conversion price in a currency other than USD and Stash has no market rates loaded, for example shortly after a restart; nothing is written, and resending the same request with backoff is safe because applying is idempotent.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Stash Documentation\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/stash-gg/FPsFuW1MRa_lLsAE/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/stash-gg/FPsFuW1MRa_lLsAE/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/stash-gg/FPsFuW1MRa_lLsAE/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/stash-gg/FPsFuW1MRa_lLsAE/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/stash-gg/FPsFuW1MRa_lLsAE/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/stash-gg/FPsFuW1MRa_lLsAE/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/stash-gg/FPsFuW1MRa_lLsAE/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/stash-gg/FPsFuW1MRa_lLsAE/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/stash-gg/FPsFuW1MRa_lLsAE/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Configure a loyalty season - Stash Documentation\">\u003cmeta data-mint-head property=\"og:description\" content=\"Creates or updates one loyalty campaign (season) together with the shop-level display settings, bonus definitions and reward products it depends on, optionally sets or removes the program-level spend conversion table, and optionally activates the program. The campaign id is the upsert key: an existing id updates that season, a new id creates one. The request describes the whole season it names, so a tier or milestone omitted from it is removed from that season; bonuses and reward products are created or updated by id or SKU and never removed. Draft and scheduled seasons accept every change. An active season accepts names, descriptions, images, milestone rewards, tier earn rates and a new end date; thresholds, adding or removing tiers or milestones, the start date and reset rules are refused with FAILED_PRECONDITION listing the fields. Ended seasons are read-only. This method accepts only the versioned x-stash-hmac-signature header, signed over the request body exactly as sent; the legacy stash-hmac-signature header is rejected with HTTP 401 (UNAUTHENTICATED), because it carries no timestamp and a captured request could be replayed. Applying is idempotent, so resending the same request is safe. Errors, by the HTTP status a REST caller receives and its gRPC status. Two of them share HTTP 400; a REST caller tells them apart by the code in the error body, 3 for INVALID_ARGUMENT and 9 for FAILED_PRECONDITION. 400 INVALID_ARGUMENT (code 3) with per-field violations when validation fails, including a spend conversion price whose rate against the US dollar is more than 3 times above or below the market rate, which the violation on that price names; fix the request, correcting the price, because resending it unchanged does not help. 400 FAILED_PRECONDITION (code 9) when the request cannot apply to the program as it stands, with the reason in the message: for example a locked field of an active season changes (the message lists the fields), the shop has no loyalty program and activate is not set, or the shop\u0026#x27;s loyalty program is bound to more than one shop; resend only once that changes, or as is when the message says to re-send the request. 401 UNAUTHENTICATED when the signature is missing, invalid, outside the time window, sent in the legacy header, or names a different shop; fix the signing. 403 PERMISSION_DENIED when the shop is not enabled for configuration writes; it does not change on a retry. 404 NOT_FOUND for an unknown shop; it does not change on a retry. 409 ABORTED when another update for the shop is in progress; resend the same request after a short wait, which is safe because applying is idempotent. 501 UNIMPLEMENTED when the loyalty configuration API is not available; it does not change on a retry. 500 INTERNAL when Stash hits an internal error, for example reading or writing the shop\u0026#x27;s loyalty configuration; resend the same request with backoff. 503 UNAVAILABLE when the request has a spend conversion price in a currency other than USD and Stash has no market rates loaded, for example shortly after a restart; nothing is written, and resending the same request with backoff is safe because applying is idempotent.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Stash Documentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://stash-gg.mintlify.app/api/ingress/loyalty/updateloyaltyconfig\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://docs.stash.gg/og-image.png\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Configure a loyalty season - Stash Documentation\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Creates or updates one loyalty campaign (season) together with the shop-level display settings, bonus definitions and reward products it depends on, optionally sets or removes the program-level spend conversion table, and optionally activates the program. The campaign id is the upsert key: an existing id updates that season, a new id creates one. The request describes the whole season it names, so a tier or milestone omitted from it is removed from that season; bonuses and reward products are created or updated by id or SKU and never removed. Draft and scheduled seasons accept every change. An active season accepts names, descriptions, images, milestone rewards, tier earn rates and a new end date; thresholds, adding or removing tiers or milestones, the start date and reset rules are refused with FAILED_PRECONDITION listing the fields. Ended seasons are read-only. This method accepts only the versioned x-stash-hmac-signature header, signed over the request body exactly as sent; the legacy stash-hmac-signature header is rejected with HTTP 401 (UNAUTHENTICATED), because it carries no timestamp and a captured request could be replayed. Applying is idempotent, so resending the same request is safe. Errors, by the HTTP status a REST caller receives and its gRPC status. Two of them share HTTP 400; a REST caller tells them apart by the code in the error body, 3 for INVALID_ARGUMENT and 9 for FAILED_PRECONDITION. 400 INVALID_ARGUMENT (code 3) with per-field violations when validation fails, including a spend conversion price whose rate against the US dollar is more than 3 times above or below the market rate, which the violation on that price names; fix the request, correcting the price, because resending it unchanged does not help. 400 FAILED_PRECONDITION (code 9) when the request cannot apply to the program as it stands, with the reason in the message: for example a locked field of an active season changes (the message lists the fields), the shop has no loyalty program and activate is not set, or the shop\u0026#x27;s loyalty program is bound to more than one shop; resend only once that changes, or as is when the message says to re-send the request. 401 UNAUTHENTICATED when the signature is missing, invalid, outside the time window, sent in the legacy header, or names a different shop; fix the signing. 403 PERMISSION_DENIED when the shop is not enabled for configuration writes; it does not change on a retry. 404 NOT_FOUND for an unknown shop; it does not change on a retry. 409 ABORTED when another update for the shop is in progress; resend the same request after a short wait, which is safe because applying is idempotent. 501 UNIMPLEMENTED when the loyalty configuration API is not available; it does not change on a retry. 500 INTERNAL when Stash hits an internal error, for example reading or writing the shop\u0026#x27;s loyalty configuration; resend the same request with backoff. 503 UNAVAILABLE when the request has a spend conversion price in a currency other than USD and Stash has no market rates loaded, for example shortly after a restart; nothing is written, and resending the same request with backoff is safe because applying is idempotent.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://docs.stash.gg/og-image.png\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/stash-gg/FPsFuW1MRa_lLsAE/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Stash Documentation\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#1e1e1e\">\u003clink data-mint-head rel=\"canonical\" href=\"https://stash-gg.mintlify.app/api/ingress/loyalty/updateloyaltyconfig\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api/ingress/loyalty/updateloyaltyconfig.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://stash-gg.mintlify.app/#organization\",\"name\":\"Stash Documentation\",\"url\":\"https://stash-gg.mintlify.app\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/stash-gg/I_GbdmJR4L85eJZA/logo/light.svg?fit=max\u0026auto=format\u0026n=I_GbdmJR4L85eJZA\u0026q=85\u0026s=c58d1a385fd52c013aef762b9f06da39\"}},{\"@type\":\"WebSite\",\"@id\":\"https://stash-gg.mintlify.app#website\",\"name\":\"Stash Documentation\",\"url\":\"https://stash-gg.mintlify.app\",\"publisher\":{\"@id\":\"https://stash-gg.mintlify.app/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://stash-gg.mintlify.app/api/ingress/loyalty/updateloyaltyconfig#webpage\",\"url\":\"https://stash-gg.mintlify.app/api/ingress/loyalty/updateloyaltyconfig\",\"name\":\"Configure a loyalty season\",\"description\":\"Creates or updates one loyalty campaign (season) together with the shop-level display settings, bonus definitions and reward products it depends on, optionally sets or removes the program-level spend conversion table, and optionally activates the program. The campaign id is the upsert key: an existing id updates that season, a new id creates one. The request describes the whole season it names, so a tier or milestone omitted from it is removed from that season; bonuses and reward products are created or updated by id or SKU and never removed. Draft and scheduled seasons accept every change. An active season accepts names, descriptions, images, milestone rewards, tier earn rates and a new end date; thresholds, adding or removing tiers or milestones, the start date and reset rules are refused with FAILED_PRECONDITION listing the fields. Ended seasons are read-only. This method accepts only the versioned x-stash-hmac-signature header, signed over the request body exactly as sent; the legacy stash-hmac-signature header is rejected with HTTP 401 (UNAUTHENTICATED), because it carries no timestamp and a captured request could be replayed. Applying is idempotent, so resending the same request is safe. Errors, by the HTTP status a REST caller receives and its gRPC status. Two of them share HTTP 400; a REST caller tells them apart by the code in the error body, 3 for INVALID_ARGUMENT and 9 for FAILED_PRECONDITION. 400 INVALID_ARGUMENT (code 3) with per-field violations when validation fails, including a spend conversion price whose rate against the US dollar is more than 3 times above or below the market rate, which the violation on that price names; fix the request, correcting the price, because resending it unchanged does not help. 400 FAILED_PRECONDITION (code 9) when the request cannot apply to the program as it stands, with the reason in the message: for example a locked field of an active season changes (the message lists the fields), the shop has no loyalty program and activate is not set, or the shop's loyalty program is bound to more than one shop; resend only once that changes, or as is when the message says to re-send the request. 401 UNAUTHENTICATED when the signature is missing, invalid, outside the time window, sent in the legacy header, or names a different shop; fix the signing. 403 PERMISSION_DENIED when the shop is not enabled for configuration writes; it does not change on a retry. 404 NOT_FOUND for an unknown shop; it does not change on a retry. 409 ABORTED when another update for the shop is in progress; resend the same request after a short wait, which is safe because applying is idempotent. 501 UNIMPLEMENTED when the loyalty configuration API is not available; it does not change on a retry. 500 INTERNAL when Stash hits an internal error, for example reading or writing the shop's loyalty configuration; resend the same request with backoff. 503 UNAVAILABLE when the request has a spend conversion price in a currency other than USD and Stash has no market rates loaded, for example shortly after a restart; nothing is written, and resending the same request with backoff is safe because applying is idempotent.\",\"dateModified\":\"2026-11-23T22:02:48.520Z\",\"isPartOf\":{\"@id\":\"https://stash-gg.mintlify.app#website\"},\"breadcrumb\":{\"@id\":\"https://stash-gg.mintlify.app/api/ingress/loyalty/updateloyaltyconfig#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://stash-gg.mintlify.app/api/ingress/loyalty/updateloyaltyconfig#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Loyalty\",\"item\":\"https://stash-gg.mintlify.app/api/ingress/loyalty/getloyalty\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Configure a loyalty season\",\"item\":\"https://stash-gg.mintlify.app/api/ingress/loyalty/updateloyaltyconfig\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://stash-gg.mintlify.app/api/ingress/loyalty/updateloyaltyconfig#apireference\",\"headline\":\"Configure a loyalty season\",\"name\":\"Configure a loyalty season\",\"description\":\"Creates or updates one loyalty campaign (season) together with the shop-level display settings, bonus definitions and reward products it depends on, optionally sets or removes the program-level spend conversion table, and optionally activates the program. The campaign id is the upsert key: an existing id updates that season, a new id creates one. The request describes the whole season it names, so a tier or milestone omitted from it is removed from that season; bonuses and reward products are created or updated by id or SKU and never removed. Draft and scheduled seasons accept every change. An active season accepts names, descriptions, images, milestone rewards, tier earn rates and a new end date; thresholds, adding or removing tiers or milestones, the start date and reset rules are refused with FAILED_PRECONDITION listing the fields. Ended seasons are read-only. This method accepts only the versioned x-stash-hmac-signature header, signed over the request body exactly as sent; the legacy stash-hmac-signature header is rejected with HTTP 401 (UNAUTHENTICATED), because it carries no timestamp and a captured request could be replayed. Applying is idempotent, so resending the same request is safe. Errors, by the HTTP status a REST caller receives and its gRPC status. Two of them share HTTP 400; a REST caller tells them apart by the code in the error body, 3 for INVALID_ARGUMENT and 9 for FAILED_PRECONDITION. 400 INVALID_ARGUMENT (code 3) with per-field violations when validation fails, including a spend conversion price whose rate against the US dollar is more than 3 times above or below the market rate, which the violation on that price names; fix the request, correcting the price, because resending it unchanged does not help. 400 FAILED_PRECONDITION (code 9) when the request cannot apply to the program as it stands, with the reason in the message: for example a locked field of an active season changes (the message lists the fields), the shop has no loyalty program and activate is not set, or the shop's loyalty program is bound to more than one shop; resend only once that changes, or as is when the message says to re-send the request. 401 UNAUTHENTICATED when the signature is missing, invalid, outside the time window, sent in the legacy header, or names a different shop; fix the signing. 403 PERMISSION_DENIED when the shop is not enabled for configuration writes; it does not change on a retry. 404 NOT_FOUND for an unknown shop; it does not change on a retry. 409 ABORTED when another update for the shop is in progress; resend the same request after a short wait, which is safe because applying is idempotent. 501 UNIMPLEMENTED when the loyalty configuration API is not available; it does not change on a retry. 500 INTERNAL when Stash hits an internal error, for example reading or writing the shop's loyalty configuration; resend the same request with backoff. 503 UNAVAILABLE when the request has a spend conversion price in a currency other than USD and Stash has no market rates loaded, for example shortly after a restart; nothing is written, and resending the same request with backoff is safe because applying is idempotent.\",\"url\":\"https://stash-gg.mintlify.app/api/ingress/loyalty/updateloyaltyconfig\",\"mainEntityOfPage\":{\"@id\":\"https://stash-gg.mintlify.app/api/ingress/loyalty/updateloyaltyconfig#webpage\"},\"image\":\"https://docs.stash.gg/og-image.png\",\"dateModified\":\"2026-11-23T22:02:48.520Z\",\"publisher\":{\"@id\":\"https://stash-gg.mintlify.app/#organization\"},\"isPartOf\":{\"@id\":\"https://stash-gg.mintlify.app#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Stash Documentation\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Stash Documentation\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/api/ingress/loyalty/updateloyaltyconfig.md","siteName":"Stash Documentation","nav":{"global":null,"tabs":[{"tab":"Integration Guides","pages":[{"title":"Integration Guides","href":"/guides"}]},{"tab":"API Reference","dropdowns":[{"dropdown":"Ingress","groups":[{"group":"Overview","pages":[{"title":"Getting Started","href":"/api/ingress"}]},{"group":"Catalog","pages":[{"title":"Abort offers","deprecated":null,"version":null,"sidebarTitle":"Abort offers","openapi":"/ingress-openapi.json post /sdk/server/catalog/offer-aborts/abort","href":"/api/ingress/catalog/abortoffers"},{"title":"Force refresh catalog","deprecated":null,"version":null,"sidebarTitle":"Force refresh catalog","openapi":"/ingress-openapi.json post /sdk/server/catalog/force-refresh","href":"/api/ingress/catalog/forcerefreshcatalog"},{"title":"List offer aborts","deprecated":null,"version":null,"sidebarTitle":"List offer aborts","openapi":"/ingress-openapi.json post /sdk/server/catalog/offer-aborts/list","href":"/api/ingress/catalog/listofferaborts"},{"title":"Un-abort offers","deprecated":null,"version":null,"sidebarTitle":"Un-abort offers","openapi":"/ingress-openapi.json post /sdk/server/catalog/offer-aborts/unabort","href":"/api/ingress/catalog/unabortoffers"}]},{"group":"Localization","pages":[{"title":"Refresh localizations","deprecated":null,"version":null,"sidebarTitle":"Refresh localizations","openapi":"/ingress-openapi.json post /sdk/studio/{shopId}/localizations/refresh","href":"/api/ingress/localization/refreshlocalizations"}]},{"group":"Loyalty","pages":[{"title":"Get loyalty program configuration","deprecated":null,"version":null,"sidebarTitle":"Get loyalty program configuration","openapi":"/ingress-openapi.json get /sdk/studio/{shopId}/loyalty","href":"/api/ingress/loyalty/getloyalty"},{"title":"Get loyalty configuration","deprecated":null,"version":null,"sidebarTitle":"Get loyalty configuration","openapi":"/ingress-openapi.json get /sdk/studio/{shopId}/loyalty/config","href":"/api/ingress/loyalty/getloyaltyconfig"},{"title":"Get a player's loyalty standing","description":"Retrieves a single player's loyalty standing (points balance, current tier, distance to the next tier and milestone, and effective points multiplier) for the shop's active loyalty campaign. Returns NOT_FOUND when the shop has no active loyalty campaign.","deprecated":null,"version":null,"sidebarTitle":"Get a player's loyalty standing","openapi":"/ingress-openapi.json get /sdk/studio/{shopId}/loyalty/players/{playerId}","href":"/api/ingress/loyalty/getplayerloyalty"},{"title":"Configure a loyalty season","deprecated":null,"version":null,"sidebarTitle":"Configure a loyalty season","openapi":"/ingress-openapi.json put /sdk/studio/{shopId}/loyalty/config","href":"/api/ingress/loyalty/updateloyaltyconfig"}]},{"group":"Payments","pages":[{"title":"Get payment event by ID","description":"Retrieves payment details by ID. Returns information about items, pricing, and payment status. This is a server-side endpoint and should not be called from the client.","deprecated":null,"version":null,"sidebarTitle":"Get payment event by ID","openapi":"/ingress-openapi.json get /sdk/server/payment/{id}","href":"/api/ingress/payments/getpaymentevent"}]},{"group":"Pricing","pages":[{"title":"Convert prices","deprecated":null,"version":null,"sidebarTitle":"Convert prices","openapi":"/ingress-openapi.json post /sdk/server/prices/convert","href":"/api/ingress/pricing/convertprices"},{"title":"Get prices","deprecated":null,"version":null,"sidebarTitle":"Get prices","openapi":"/ingress-openapi.json get /sdk/server/prices","href":"/api/ingress/pricing/getprices"}]},{"group":"Reports","pages":[{"title":"List report files","deprecated":null,"version":null,"sidebarTitle":"List report files","openapi":"/ingress-openapi.json post /sdk/studio/{shopId}/reports/files","href":"/api/ingress/reports/listreportfiles"}]},{"group":"Server URLs","pages":[{"title":"Generate authenticated URL","deprecated":null,"version":null,"sidebarTitle":"Generate authenticated URL","openapi":"/ingress-openapi.json post /sdk/server/generate_url","href":"/api/ingress/server-urls/generateauthenticatedurl"}]},{"group":"Stash Pay","pages":[{"title":"Generate Checkout","deprecated":null,"version":null,"sidebarTitle":"Generate Checkout","openapi":"/ingress-openapi.json post /sdk/server/checkout_links/generate_quick_pay_url","href":"/api/ingress/stash-pay/generatequickpayurl"}]},{"group":"Subscription Checkout Links","pages":[{"title":"Create a subscription change checkout link","deprecated":null,"version":null,"sidebarTitle":"Create a subscription change checkout link","openapi":"/ingress-openapi.json post /sdk/subscriptions/{subscriptionId}/change-checkout-links","href":"/api/ingress/subscription-checkout-links/createsubscriptionchangecheckoutlink"},{"title":"Create a subscription checkout link","deprecated":null,"version":null,"sidebarTitle":"Create a subscription checkout link","openapi":"/ingress-openapi.json post /sdk/subscriptions/checkout-links","href":"/api/ingress/subscription-checkout-links/createsubscriptioncheckoutlink"}]},{"group":"Subscription Plans","pages":[{"title":"Get plan by ID","deprecated":null,"version":null,"sidebarTitle":"Get plan by ID","openapi":"/ingress-openapi.json get /sdk/plans/{planId}","href":"/api/ingress/subscription-plans/getplan"},{"title":"Get plan by code","deprecated":null,"version":null,"sidebarTitle":"Get plan by code","openapi":"/ingress-openapi.json get /sdk/plans/code/{code}","href":"/api/ingress/subscription-plans/getplanbycode"},{"title":"List plans","deprecated":null,"version":null,"sidebarTitle":"List plans","openapi":"/ingress-openapi.json get /sdk/plans","href":"/api/ingress/subscription-plans/listplans"}]},{"group":"Subscriptions","pages":[{"title":"Cancel subscription","deprecated":null,"version":null,"sidebarTitle":"Cancel subscription","openapi":"/ingress-openapi.json post /sdk/subscriptions/{id}/cancel","href":"/api/ingress/subscriptions/cancelsubscription"},{"title":"Get payments by subscription ID","deprecated":null,"version":null,"sidebarTitle":"Get payments by subscription ID","openapi":"/ingress-openapi.json get /sdk/subscriptions/{id}/payments","href":"/api/ingress/subscriptions/getpaymentsbysubscriptionid"},{"title":"Get subscription by ID","deprecated":null,"version":null,"sidebarTitle":"Get subscription by ID","openapi":"/ingress-openapi.json get /sdk/subscriptions/{id}","href":"/api/ingress/subscriptions/getsubscription"},{"title":"List subscriptions","deprecated":null,"version":null,"sidebarTitle":"List subscriptions","openapi":"/ingress-openapi.json get /sdk/subscriptions","href":"/api/ingress/subscriptions/listsubscriptions"},{"title":"Reactivate subscription","deprecated":null,"version":null,"sidebarTitle":"Reactivate subscription","openapi":"/ingress-openapi.json post /sdk/subscriptions/{id}/reactivate","href":"/api/ingress/subscriptions/reactivatesubscription"},{"title":"Update subscription","deprecated":null,"version":null,"sidebarTitle":"Update subscription","openapi":"/ingress-openapi.json post /sdk/subscriptions/{id}","href":"/api/ingress/subscriptions/updatesubscription"}]},{"group":"User Preferences","pages":[{"title":"Get user preferences","deprecated":null,"version":null,"sidebarTitle":"Get user preferences","openapi":"/ingress-openapi.json get /sdk/server/user_preferences/{userId}","href":"/api/ingress/user-preferences/getuserpreferences"},{"title":"Set user preferences","deprecated":null,"version":null,"sidebarTitle":"Set user preferences","openapi":"/ingress-openapi.json post /sdk/server/user_preferences/{userId}","href":"/api/ingress/user-preferences/setuserpreferences"}]},{"group":"Web Shop","pages":[{"title":"Get maintenance mode","deprecated":null,"version":null,"sidebarTitle":"Get maintenance mode","openapi":"/ingress-openapi.json get /sdk/server/shop/maintenance","href":"/api/ingress/web-shop/getmaintenancemode"},{"title":"Set maintenance mode","deprecated":null,"version":null,"sidebarTitle":"Set maintenance mode","openapi":"/ingress-openapi.json post /sdk/server/shop/maintenance","href":"/api/ingress/web-shop/setmaintenancemode"}]},{"group":"Webshop Account Linking","pages":[{"title":"Approve custom login","deprecated":null,"version":null,"sidebarTitle":"Approve custom login","openapi":"/ingress-openapi.json post /sdk/custom_login/approve","href":"/api/ingress/webshop-account-linking/approvecustomlogin"},{"title":"Decline custom login","deprecated":null,"version":null,"sidebarTitle":"Decline custom login","openapi":"/ingress-openapi.json post /sdk/custom_login/decline","href":"/api/ingress/webshop-account-linking/declinecustomlogin"},{"title":"Force Logout user","deprecated":null,"version":null,"sidebarTitle":"Force Logout user","openapi":"/ingress-openapi.json post /sdk/server/custom_login/logout","href":"/api/ingress/webshop-account-linking/logoutuser"}]}]},{"dropdown":"Egress","groups":[{"group":"Overview","pages":[{"title":"Getting Started","href":"/api/egress"}]},{"group":"Catalog","pages":[{"title":"Get product catalog","deprecated":null,"version":null,"sidebarTitle":"Get product catalog","playground":"simple","openapi":"/egress-openapi.json get /api/v1/catalog","href":"/api/egress/catalog/getcatalog"},{"title":"Get offer details","deprecated":null,"version":null,"sidebarTitle":"Get offer details","playground":"simple","openapi":"/egress-openapi.json get /api/v1/catalog/offer","href":"/api/egress/catalog/getofferdetails"}]},{"group":"Players","pages":[{"title":"Get player by ID","deprecated":null,"version":null,"sidebarTitle":"Get player by ID","playground":"simple","openapi":"/egress-openapi.json get /api/v1/player","href":"/api/egress/players/getplayer"}]},{"group":"Purchase","pages":[{"title":"Cancel pending payment","deprecated":null,"version":null,"sidebarTitle":"Cancel pending payment","playground":"simple","openapi":"/egress-openapi.json post /api/v1/purchase/cancel","href":"/api/egress/purchase/cancelpayment"},{"title":"Confirm payment completion","deprecated":null,"version":null,"sidebarTitle":"Confirm payment completion","playground":"simple","openapi":"/egress-openapi.json post /api/v1/purchase/confirm","href":"/api/egress/purchase/confirmpayment"},{"title":"Register payment intent","deprecated":null,"version":null,"sidebarTitle":"Register payment intent","playground":"simple","openapi":"/egress-openapi.json post /api/v1/purchase/register","href":"/api/egress/purchase/registerpayment"}]}]}]},{"tab":"Partner With Us","pages":[{"title":"Partner With Us","href":"/partners"}]},{"tab":"Changelog","pages":[{"title":"Changelog","href":"/changelog"}]}]},"basePath":"","title":"Configure a loyalty season - Stash Documentation","deploymentId":"dpl_5nNsUVHqbVdUHouroPPzwztSbjmH","buildId":"dpl_5nNsUVHqbVdUHouroPPzwztSbjmH","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-B564ZPEC.js","snippetPresets-L1o8HcxD.js","utils-CztB6GTn.js","style-to-object-BY3JEAdk.js","utils-CvVTgJWk.js","v4-DIgz8zy6.js","addTypeLabelsToSchema-DYi6_847.js","conditional-requirements-CFM0id0Q.js","cloneDeep-DthbVJn_.js","_Uint8Array-G4MDMcnE.js","isObject-FP1Yky1u.js","ApiExamples-BnQo4SxZ.js","usePlaygroundInputsStore-Dsmj0Yg6.js","shallow-Bp_wEvgz.js","isEqual-BwXlkqOR.js","CodeSnippets-D6Fi8DmN.js","CodeSnippet-DANVAYTI.js","use-playground-group-access-DaUWE1Sg.js","Page-Cwg6gQ2F.js","api-description-markdown-DFvICuUq.js","DynamicMarkdown-DHV3eOcf.js","SectionHeading-DLRZDaDn.js","MethodPill-CgqQYk5N.js","getPastedJson-k_txzq3J.js","Check2Icon-CO8ho5Tt.js","axios-CsQoIw0U.js","Markdown-C8ZpmBko.js","AssistantPageLink-AWAGfbYY.js","dist-CAcI43Vk.js","lib-DMeTj1gb.js","lib-B8HbPgcC.js","katex-Dbtb6Wk7.js","html-void-elements-mCSPHezU.js","marked.esm-CZWythHk.js"]}