> ## 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 plan by code

> Retrieves a subscription plan by its code (e.g., 'monthly_premium'). Plan codes are unique within a segment.



## OpenAPI

````yaml /ingress-openapi.json get /sdk/plans/code/{code}
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/plans/code/{code}:
    get:
      tags:
        - Subscription Plans
      summary: Get plan by code
      description: >-
        Retrieves a subscription plan by its code (e.g., 'monthly_premium').
        Plan codes are unique within a segment.
      operationId: GetPlanByCode
      parameters:
        - name: code
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/pie.sdk.subscription.Plan'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/google.rpc.Status'
components:
  schemas:
    pie.sdk.subscription.Plan:
      type: object
      properties:
        id:
          type: string
        segmentId:
          type: string
        code:
          type: string
          description: e.g., "monthly_premium", "weekly_boost"
          title: Plan identity
        name:
          type: string
          title: e.g., "Monthly Premium", "Weekly Boost"
        description:
          type: string
        billingPeriodValue:
          type: string
          format: int64
          description: 1, 3, 7, 30, etc.
          title: Billing configuration
        billingPeriodUnit:
          type: string
        prices:
          type: array
          items:
            $ref: '#/components/schemas/pie.sdk.subscription.PlanPrice'
          title: Pricing (multi-currency support)
        trialPeriodValue:
          type: string
          format: int64
          title: Trial configuration (optional)
        trialPeriodUnit:
          type: string
          title: Empty string if no trial
        benefitsJson:
          type: string
          description: 'e.g., {"speed_multiplier": 2.5, "xp_boost": 1.25}'
          title: Features & benefits (JSON encoded)
        status:
          type: string
          title: Plan lifecycle
        availableFrom:
          type: string
          format: date-time
        availableUntil:
          type: string
          format: date-time
        createdAt:
          type: string
          format: date-time
          title: Metadata
        updatedAt:
          type: string
          format: date-time
      title: Plan message
      required:
        - id
        - segmentId
        - code
        - name
        - billingPeriodValue
        - billingPeriodUnit
        - prices
        - status
        - createdAt
        - updatedAt
    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.PlanPrice:
      type: object
      properties:
        currency:
          type: string
          title: ISO-4217 currency code
        amountCents:
          type: string
          format: int64
          title: Price in smallest currency unit
      title: Plan pricing for a specific currency
      required:
        - currency
        - amountCents
    google.protobuf.Any:
      type: object
      properties:
        '@type':
          type: string
      additionalProperties: {}

````

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