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

# Get loyalty configuration

> Retrieves the shop's loyalty configuration in the shape UpdateLoyaltyConfig accepts: display settings, bonus definitions, reward products with their status, every campaign (season) with its status, and the spend conversion table with the rate derived per currency. Product rewards are returned by SKU. Use it to verify a sync. This method accepts only the versioned x-stash-hmac-signature header, signed over an empty body; the legacy stash-hmac-signature header is rejected with HTTP 401 (UNAUTHENTICATED), because it carries no timestamp and a captured request could be replayed. Errors, by the HTTP status a REST caller receives and its gRPC status: 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, because resending it unchanged does not help. 404 NOT_FOUND for an unknown shop or a shop with no loyalty program; it does not change on a retry. 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 the shop's loyalty configuration; reading is safe to repeat, so retry with backoff.



## OpenAPI

````yaml /ingress-openapi.json get /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:
    get:
      tags:
        - Loyalty
      summary: Get loyalty configuration
      description: >-
        Retrieves the shop's loyalty configuration in the shape
        UpdateLoyaltyConfig accepts: display settings, bonus definitions, reward
        products with their status, every campaign (season) with its status, and
        the spend conversion table with the rate derived per currency. Product
        rewards are returned by SKU. Use it to verify a sync. This method
        accepts only the versioned x-stash-hmac-signature header, signed over an
        empty body; the legacy stash-hmac-signature header is rejected with HTTP
        401 (UNAUTHENTICATED), because it carries no timestamp and a captured
        request could be replayed. Errors, by the HTTP status a REST caller
        receives and its gRPC status: 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, because resending it unchanged
        does not help. 404 NOT_FOUND for an unknown shop or a shop with no
        loyalty program; it does not change on a retry. 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 the shop's loyalty configuration; reading is safe to repeat, so
        retry with backoff.
      operationId: GetLoyaltyConfig
      parameters:
        - name: shopId
          description: Shop identifier from Stash Studio
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/server.ingress.loyalty.v1.GetLoyaltyConfigResponse
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/google.rpc.Status'
      security:
        - hmac: []
components:
  schemas:
    server.ingress.loyalty.v1.GetLoyaltyConfigResponse:
      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, whether created through
            this API or in Studio, with its status; drafts are included. Not
            listed: sellable catalog products, and a Studio reward product that
            has no SKU (external id), which the API cannot address. Resending a
            draft in UpdateLoyaltyConfig publishes it.
        campaigns:
          type: array
          items:
            $ref: '#/components/schemas/server.ingress.loyalty.v1.CampaignConfig'
          description: >-
            Every campaign (season) of the program with its status, ordered by
            start date ascending; seasons without a start date come last.
        spendConversion:
          $ref: '#/components/schemas/server.ingress.loyalty.v1.SpendConversion'
      description: A shop's loyalty configuration in the shape UpdateLoyaltyConfig accepts.
      title: Get 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.