> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stash.gg/llms.txt
> Use this file to discover all available pages before exploring further.

# Configure a loyalty season

> 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.



## OpenAPI

````yaml /ingress-openapi.json put /sdk/studio/{shopId}/loyalty/config
openapi: 3.0.0
info:
  title: Stash API
  description: >-
    Set of APIs for integrating Stash functionality into games. API set includes
    authentication, payment processing, checkout links, user management, and
    various platform-specific integrations. The API supports both client-side
    and server-side implementations with appropriate security measures for each
    context.
  version: '1.0'
servers:
  - url: https://test-api.stash.gg
security: []
tags:
  - name: Catalog
    description: >-
      Server-side catalog endpoints for shops with a real-time catalog
      integration.
  - name: Launcher Payment
    description: Payment processing endpoints for Stash Launcher.
  - name: Subscription Checkout Links
    description: Checkout link generation for subscription purchases
  - name: Webshop Account Linking
    description: >-
      Authentication endpoints for integrating third-party login providers or
      custom login with Stash Webshops.
  - name: Payments
    description: Payment history and transaction management endpoints
  - name: Pricing
    description: Server-side pricing endpoints for fetching uploaded price sheet data
  - name: Stash Pay
    description: Server-side quick payment endpoints for internal use
  - name: Web Shop
    description: Server-side endpoints that control your web shop.
  - name: Subscription Plans
    description: Retrieve subscription plan details and pricing
  - name: Subscriptions
    description: Manage player subscriptions - retrieve, cancel, and reactivate
  - name: Server URLs
    description: Server-side URL generation endpoints for authenticated URLs
  - name: User Preferences
    description: User preferences management endpoints for payment channel preferences
  - name: Loyalty
    description: >-
      Endpoints for reading a shop's loyalty program and, for enabled shops,
      configuring it
  - name: Localization
    description: >-
      Endpoints for refreshing a shop's localizations from its localization
      source
  - name: Reports
    description: >-
      Endpoints for listing a shop's daily transaction files and downloading
      them through signed links
paths:
  /sdk/studio/{shopId}/loyalty/config:
    put:
      tags:
        - Loyalty
      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
      parameters:
        - name: shopId
          description: Shop identifier from Stash Studio
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/server.ingress.loyalty.v1.LoyaltyService.UpdateLoyaltyConfigBody
        required: true
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/server.ingress.loyalty.v1.UpdateLoyaltyConfigResponse
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/google.rpc.Status'
      security:
        - hmac: []
components:
  schemas:
    server.ingress.loyalty.v1.LoyaltyService.UpdateLoyaltyConfigBody:
      type: object
      properties:
        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.
        displayConfig:
          $ref: '#/components/schemas/server.ingress.loyalty.v1.DisplayConfig'
        bonuses:
          type: array
          items:
            $ref: '#/components/schemas/server.ingress.loyalty.v1.BonusDefinition'
          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.
        products:
          type: array
          items:
            $ref: '#/components/schemas/server.ingress.loyalty.v1.RewardProduct'
          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.
        campaign:
          $ref: '#/components/schemas/server.ingress.loyalty.v1.CampaignConfig'
        spendConversion:
          $ref: '#/components/schemas/server.ingress.loyalty.v1.SpendConversion'
      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
    server.ingress.loyalty.v1.UpdateLoyaltyConfigResponse:
      type: object
      properties:
        displayConfig:
          $ref: '#/components/schemas/server.ingress.loyalty.v1.DisplayConfig'
        bonuses:
          type: array
          items:
            $ref: '#/components/schemas/server.ingress.loyalty.v1.BonusDefinition'
          description: Every bonus defined for the shop.
        products:
          type: array
          items:
            $ref: '#/components/schemas/server.ingress.loyalty.v1.RewardProduct'
          description: Every reward-only product the shop holds, with its status.
        campaign:
          $ref: '#/components/schemas/server.ingress.loyalty.v1.CampaignConfig'
        warnings:
          type: array
          items:
            type: 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.
        spendConversion:
          $ref: '#/components/schemas/server.ingress.loyalty.v1.SpendConversion'
      description: The configuration as stored after the update.
      title: Update Loyalty Config Response
    google.rpc.Status:
      type: object
      properties:
        code:
          type: integer
          format: int32
        message:
          type: string
        details:
          type: array
          items:
            $ref: '#/components/schemas/google.protobuf.Any'
    server.ingress.loyalty.v1.DisplayConfig:
      type: object
      properties:
        programName:
          type: string
          description: >-
            Name of the loyalty program as shown to players. Up to 1024
            characters.
        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.
      description: Shop-level names shown to players.
      title: Loyalty Display Config
      required:
        - programName
    server.ingress.loyalty.v1.BonusDefinition:
      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.
        type:
          $ref: '#/components/schemas/server.ingress.loyalty.v1.BonusType'
        name:
          type: string
          description: Singular display name, for example Gem. Up to 1024 characters.
        pluralName:
          type: string
          description: Plural display name, for example Gems. Up to 1024 characters.
        abbreviatedName:
          type: string
          description: Short display name, for example LP. Up to 1024 characters.
        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.
      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
    server.ingress.loyalty.v1.RewardProduct:
      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.
        name:
          type: string
          description: Name shown on the reward. Up to 1024 characters.
        description:
          type: string
          description: Description shown on the reward. Up to 1024 characters.
        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.
        backgroundImageUrl:
          type: string
          description: Background image URL, same rules as imageUrl.
        status:
          $ref: '#/components/schemas/server.ingress.loyalty.v1.RewardProductStatus'
      description: A reward-only product that a milestone can grant by SKU.
      title: Loyalty Reward Product
      required:
        - sku
        - name
        - imageUrl
    server.ingress.loyalty.v1.CampaignConfig:
      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.
        name:
          type: string
          description: Display name of the season. Up to 1024 characters.
        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.
        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.
        reset:
          $ref: '#/components/schemas/server.ingress.loyalty.v1.ResetRules'
        tiers:
          type: array
          items:
            $ref: '#/components/schemas/server.ingress.loyalty.v1.TierConfig'
          description: >-
            The season's tiers with their milestones. Start points must be
            unique within the season.
        status:
          $ref: '#/components/schemas/server.ingress.loyalty.v1.CampaignStatus'
      description: >-
        A loyalty campaign (season): its window, reset rules and tiers with
        their milestones.
      title: Loyalty Campaign Config
      required:
        - id
        - name
    server.ingress.loyalty.v1.SpendConversion:
      type: object
      properties:
        tiers:
          type: array
          items:
            $ref: '#/components/schemas/server.ingress.loyalty.v1.SpendConversionTier'
          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.
        ratesPerUsd:
          type: object
          additionalProperties:
            type: 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
        updatedAt:
          type: string
          format: date-time
          description: When the stored table last changed (RFC 3339). Ignored on input.
          readOnly: true
      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
    google.protobuf.Any:
      type: object
      properties:
        '@type':
          type: string
      additionalProperties: {}
    server.ingress.loyalty.v1.BonusType:
      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

        each kind.

         - BONUS_TYPE_LOYALTY_POINTS: Loyalty points (XP): the balance that drives tier progression and milestones. Held by Stash.
         - BONUS_TYPE_IN_GAME_CURRENCY: An in-game currency such as gems, delivered as bonus items on the purchase webhook. Stash holds no balance.
         - BONUS_TYPE_LOYALTY_CURRENCY: A loyalty currency held by Stash in the player's wallet.
    server.ingress.loyalty.v1.RewardProductStatus:
      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.

         - REWARD_PRODUCT_STATUS_DRAFT: Saved but not yet published; a milestone cannot grant it.
         - REWARD_PRODUCT_STATUS_PUBLISHED: Published; a milestone can grant it.
    server.ingress.loyalty.v1.ResetRules:
      type: object
      properties:
        points:
          $ref: '#/components/schemas/server.ingress.loyalty.v1.ResetRules.Points'
        milestoneClaims:
          $ref: >-
            #/components/schemas/server.ingress.loyalty.v1.ResetRules.MilestoneClaims
        currency:
          $ref: '#/components/schemas/server.ingress.loyalty.v1.ResetRules.Currency'
      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
    server.ingress.loyalty.v1.TierConfig:
      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.
        name:
          type: string
          description: Display name of the tier. Up to 1024 characters.
        startPoints:
          type: integer
          format: int64
          description: >-
            Points balance at which the tier begins. Unique within the season.
            Locked once the season is active.
        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.
        backgroundImageUrl:
          type: string
          description: Tier background image URL, same rules as iconUrl.
        color:
          type: string
          description: 'Accent colour as a six-digit CSS hex value, for example #c65d00.'
        benefits:
          type: array
          items:
            $ref: '#/components/schemas/server.ingress.loyalty.v1.TierBenefit'
          description: Perks listed on the tier, shown to players in order.
        earnRates:
          type: array
          items:
            $ref: '#/components/schemas/server.ingress.loyalty.v1.EarnRate'
          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.
        milestones:
          type: array
          items:
            $ref: '#/components/schemas/server.ingress.loyalty.v1.MilestoneConfig'
          description: The tier's milestones.
      description: One tier of a season with its earn rates and milestones.
      title: Loyalty Tier Config
      required:
        - id
        - name
        - startPoints
    server.ingress.loyalty.v1.CampaignStatus:
      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

        state and the campaign window.

         - CAMPAIGN_STATUS_DRAFT: Not visible to players: the season has no start date, or the program is not live.
         - CAMPAIGN_STATUS_SCHEDULED: The program is live and the season's start date is in the future.
         - CAMPAIGN_STATUS_ACTIVE: The program is live and the season's window contains the current time.
         - CAMPAIGN_STATUS_ENDED: The season's end date has passed. Read-only.
    server.ingress.loyalty.v1.SpendConversionTier:
      type: object
      properties:
        prices:
          type: object
          additionalProperties:
            type: 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.
      description: One price point expressed in several currencies.
      title: Loyalty Spend Conversion Tier
    server.ingress.loyalty.v1.ResetRules.Points:
      type: string
      enum:
        - POINTS_UNSPECIFIED
        - POINTS_CARRY
        - POINTS_RESET_TO_TIER_START
      default: POINTS_UNSPECIFIED
      description: |2-
         - POINTS_CARRY: The points balance carries over unchanged.
         - POINTS_RESET_TO_TIER_START: The points balance drops to the start of the player's current tier.
    server.ingress.loyalty.v1.ResetRules.MilestoneClaims:
      type: string
      enum:
        - MILESTONE_CLAIMS_UNSPECIFIED
        - MILESTONE_CLAIMS_RESET
        - MILESTONE_CLAIMS_CARRY
      default: MILESTONE_CLAIMS_UNSPECIFIED
      description: |2-
         - MILESTONE_CLAIMS_RESET: Earlier claims are cleared; every milestone of the season is claimable.
         - MILESTONE_CLAIMS_CARRY: Earlier claims are kept as history rather than cleared.
    server.ingress.loyalty.v1.ResetRules.Currency:
      type: string
      enum:
        - CURRENCY_UNSPECIFIED
        - CURRENCY_CARRY
        - CURRENCY_RESET
      default: CURRENCY_UNSPECIFIED
      description: |2-
         - CURRENCY_CARRY: Loyalty currency balances carry over unchanged.
         - CURRENCY_RESET: Loyalty currency balances are cleared.
    server.ingress.loyalty.v1.TierBenefit:
      type: object
      properties:
        text:
          type: string
          description: Benefit text as shown to players.
      description: One perk listed on a tier.
      title: Loyalty Tier Benefit
      required:
        - text
    server.ingress.loyalty.v1.EarnRate:
      type: object
      properties:
        bonusId:
          type: string
          description: >-
            The bonus this rate applies to. Must be defined in bonuses or
            already exist for the shop.
        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.
      description: How much of one bonus a tier earns per US dollar spent.
      title: Loyalty Earn Rate
      required:
        - bonusId
        - rewardPerDollar
    server.ingress.loyalty.v1.MilestoneConfig:
      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.
        name:
          type: string
          description: Display name of the milestone. Up to 1024 characters.
        description:
          type: string
          description: Description shown on the milestone. Up to 1024 characters.
        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.
        rewardName:
          type: string
          description: Name of the reward as shown on the milestone. Up to 1024 characters.
        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.
        backgroundImageUrl:
          type: string
          description: Milestone background image URL, same rules as rewardImageUrl.
        bonusRewards:
          type: array
          items:
            $ref: '#/components/schemas/server.ingress.loyalty.v1.BonusReward'
          description: >-
            Bonus amounts granted when the milestone is claimed. Editable on an
            active season; a milestone already claimed keeps the reward it was
            granted.
        productRewards:
          type: array
          items:
            $ref: '#/components/schemas/server.ingress.loyalty.v1.ProductReward'
          description: >-
            Products granted when the milestone is claimed, by SKU. Same edit
            rule as bonusRewards.
      description: A points threshold within a tier that grants rewards when claimed.
      title: Loyalty Milestone Config
      required:
        - id
        - name
        - pointsNeeded
    server.ingress.loyalty.v1.BonusReward:
      type: object
      properties:
        bonusId:
          type: string
          description: >-
            The bonus granted. Must be defined in bonuses or already exist for
            the shop.
        amount:
          type: integer
          format: int64
          description: Amount of the bonus granted.
      description: An amount of one bonus granted at a milestone.
      title: Loyalty Bonus Reward
      required:
        - bonusId
        - amount
    server.ingress.loyalty.v1.ProductReward:
      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.
        quantity:
          type: integer
          format: int64
          description: Quantity of the product granted.
      description: A quantity of one product granted at a milestone.
      title: Loyalty Product Reward
      required:
        - sku
        - quantity
  securitySchemes:
    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

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.