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

# List subscriptions

> Query subscriptions by player and optionally filter by status. Returns all matching subscriptions for the specified external_account_id.



## OpenAPI

````yaml /ingress-openapi.json get /sdk/subscriptions
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/subscriptions:
    get:
      tags:
        - Subscriptions
      summary: List subscriptions
      description: >-
        Query subscriptions by player and optionally filter by status. Returns
        all matching subscriptions for the specified external_account_id.
      operationId: ListSubscriptions
      parameters:
        - name: externalAccountId
          in: query
          required: false
          schema:
            type: string
        - name: status
          description: 'Filter by status: "active", "past_due", "canceled", "expired"'
          in: query
          required: false
          schema:
            type: string
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/pie.sdk.subscription.ListSubscriptionsResponse
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/google.rpc.Status'
      security:
        - bearerAuth: []
        - hmac: []
        - deprecatedApiKey: []
components:
  schemas:
    pie.sdk.subscription.ListSubscriptionsResponse:
      type: object
      properties:
        subscriptions:
          type: array
          items:
            $ref: '#/components/schemas/pie.sdk.subscription.Subscription'
      title: ListSubscriptions 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'
    pie.sdk.subscription.Subscription:
      type: object
      properties:
        id:
          type: string
          title: Unique identifier for the subscription
        externalAccountId:
          type: string
          title: >-
            External account identifier for the player/user associated with the
            subscription
        planId:
          type: string
          title: Plan identifier associated with this subscription
        status:
          type: string
          title: 'Subscription status: active, past_due, canceled, expired'
        period:
          $ref: '#/components/schemas/pie.sdk.subscription.BillingPeriod'
        trialEnd:
          type: string
          format: date-time
          title: When the trial period ends, if applicable
        accessEndDate:
          type: string
          format: date-time
          title: When access to the product expires
        currentPeriodEnd:
          type: string
          format: date-time
          title: End date of the current billing period
        nextBillingDate:
          type: string
          format: date-time
          title: When next billing attempt will occur
        cancelAtPeriodEnd:
          type: boolean
          title: Whether cancellation occurs at period end
        canceledAt:
          type: string
          format: date-time
          title: When the subscription was canceled, if applicable
        createdAt:
          type: string
          format: date-time
          title: When the subscription was created
        checkoutLinkMetadata:
          type: object
          additionalProperties:
            type: string
          title: >-
            Custom metadata from checkout link (customer-provided key-value
            pairs)
        freePeriod:
          $ref: '#/components/schemas/pie.sdk.subscription.FreePeriod'
      title: Main subscription message
      required:
        - id
        - externalAccountId
        - planId
        - status
        - period
        - accessEndDate
        - currentPeriodEnd
        - nextBillingDate
        - createdAt
    google.protobuf.Any:
      type: object
      properties:
        '@type':
          type: string
      additionalProperties: {}
    pie.sdk.subscription.BillingPeriod:
      type: object
      properties:
        value:
          type: integer
          format: int32
          title: e.g., 1, 7, 30
        unit:
          type: string
      title: Billing period for a subscription
      required:
        - value
        - unit
    pie.sdk.subscription.FreePeriod:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/pie.sdk.subscription.FreePeriodType'
        startsAt:
          type: string
          format: date-time
        endsAt:
          type: string
          format: date-time
          description: Billing resumes at the plan's normal price at this time.
      description: >-
        A free stretch of full access with no charge, after which billing
        resumes.
      required:
        - type
        - startsAt
        - endsAt
    pie.sdk.subscription.FreePeriodType:
      type: string
      enum:
        - FREE_PERIOD_TYPE_UNSPECIFIED
        - FREE_PERIOD_TYPE_TRIAL
        - FREE_PERIOD_TYPE_DEFERRAL
      default: FREE_PERIOD_TYPE_UNSPECIFIED
      description: |-
        The kind of free period.

         - FREE_PERIOD_TYPE_UNSPECIFIED: Never returned; present only as the protobuf default.
         - FREE_PERIOD_TYPE_TRIAL: Reserved for signup trials. Not returned yet.
         - FREE_PERIOD_TYPE_DEFERRAL: Free periods granted with UpdateSubscription.
  securitySchemes:
    bearerAuth:
      type: apiKey
      description: >-
        Bearer token authentication for client-side SDK operations. Format:
        'Authorization: Bearer <token>'
      name: Authorization
      in: header
    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
    deprecatedApiKey:
      type: apiKey
      description: >-
        DEPRECATED: API key authentication (X-Stash-Api-Key) is not supported
        for shops or API keys created on or after 2026-08-15; those must use
        HMAC authentication via the x-stash-hmac-signature header. Shops and
        keys created before the cutoff may continue using their X-Stash-Api-Key
        for server-to-server operations, but are encouraged to migrate to HMAC
        as soon as possible for the best security.
      name: X-Stash-Api-Key
      in: header

````

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