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

# Retrieve a plan

> Returns the details of a plan, including its name and bricks.



## OpenAPI

````yaml https://api.salesbricks.com/api/v2/openapi.yaml get /plans/{plan_id}
openapi: 3.0.3
info:
  title: Salesbricks REST API
  version: 2.0.0
  description: API reference for external integrations
servers:
  - url: https://api.salesbricks.com/api/v2
    description: Production
  - url: https://api.staging.salesbricks.com/api/v2
    description: Staging
security:
  - ApiKeyAuth: []
tags:
  - name: Subscriptions
    description: >-
      Operations related to subscription management, including creation,
      updates, and retrieving subscription details. Subscriptions can be
      upgraded to add / remove add-ons by using the POST
      /subscriptions/{subscription_id}/upgrade endpoint and can be recasted for
      replacing the current agreement using the POST
      /subscriptions/{subscription_id}/recast endpoint
  - name: Subscription Milestones
    description: >-
      Operations for listing and completing milestone bricks — bricks billed
      when the work they cover is delivered rather than on the subscription's
      schedule. Completing one either raises a standalone invoice immediately or
      bills on the subscription's next scheduled invoice.
  - name: Customers
    description: >-
      Operations related to customer management, including creation, updates,
      and managing customer person objects.
  - name: Invoices
    description: Operations related to subscription's invoicing details.
  - name: Plans
    description: >-
      Operations related to listing and getting plan details including bricks in
      the plan.
  - name: Payment Methods
    description: Operations related to subscription's payment method.
paths:
  /plans/{plan_id}:
    get:
      tags:
        - Plans
      summary: Retrieve a plan
      description: Returns the details of a plan, including its name and bricks.
      operationId: retrievePlan
      parameters:
        - in: query
          name: currency
          schema:
            type: string
            enum:
              - AUD
              - CAD
              - EUR
              - GBP
              - INR
              - USD
          description: 'Currency for pricing tiers (default: USD)'
        - in: path
          name: plan_id
          schema:
            type: string
            pattern: ^([a-zA-Z\d\-]+)$
          required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Plan'
          description: ''
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                NotFoundResponse:
                  value:
                    error:
                      code: ERR_NOT_FOUND
                      message: >-
                        Not found — the resource you are looking for does not
                        exist.
                  summary: Not Found Response
          description: ''
components:
  schemas:
    Plan:
      type: object
      properties:
        plan_id:
          type: string
          format: uuid
          description: Unique identifier for the plan
        plan_name:
          type: string
          description: Name of the plan
        description:
          type: string
          nullable: true
          description: Description of the plan
        code:
          type: string
          nullable: true
          description: Code for the plan
        product_id:
          type: string
          format: uuid
          description: Unique identifier for the product the plan belongs to
        product_name:
          type: string
          description: Name of the product the plan belongs to
        is_product_active:
          type: boolean
          description: >-
            Whether the product is active. Plans on an inactive product are
            still listed here but cannot be used to build new orders.
        is_private:
          type: boolean
          description: >-
            Private plans are not selectable by a buyer during self-serve,
            though your team can still build orders on them.
        bricks:
          type: array
          items:
            $ref: '#/components/schemas/Brick'
          readOnly: true
          description: Bricks for the plan
      required:
        - bricks
        - code
        - description
        - is_private
        - is_product_active
        - plan_id
        - plan_name
        - product_id
        - product_name
    ErrorResponse:
      type: object
      description: >-
        Standardizes API error responses with a consistent structure containing
        error code and message.
      properties:
        error:
          $ref: '#/components/schemas/Error'
      required:
        - error
    Brick:
      type: object
      properties:
        brick_id:
          type: string
          format: uuid
          description: Unique identifier for the brick
        brick_name:
          type: string
          description: Name of the brick
        brick_code:
          type: string
          nullable: true
          description: >-
            The internal SKU code you set on the brick. Unlike `brick_id` it
            stays the same across environments and when a brick is recreated, so
            use it to map bricks to your own features. Null when the brick has
            no code.
        brick_type:
          enum:
            - SUBSCRIPTION
            - ONE_TIME
            - MILESTONE
            - USAGE
          type: string
          x-spec-enum-id: c660eeda64fa22f1
          description: |-
            Type of the brick

            * `SUBSCRIPTION` - Subscription
            * `ONE_TIME` - One-timePurchase
            * `MILESTONE` - Milestone
            * `USAGE` - Usage
        included_units:
          type: integer
          description: Number of included units in pricing
        min_units:
          type: integer
          description: Minimum units required
        tiers:
          type: array
          items:
            $ref: '#/components/schemas/TierBound'
          description: Tier breakpoints for tiered/volume discount pricing
        blocks:
          type: array
          items:
            $ref: '#/components/schemas/BlockBound'
          description: Block ranges for block pricing
        pool:
          allOf:
            - $ref: '#/components/schemas/Pool'
          description: >-
            Pool configuration. Only present on a usage pool brick, whose units
            are drawn down by the bricks in `pooled_bricks`.
      required:
        - brick_code
        - brick_id
        - brick_name
        - brick_type
    Error:
      type: object
      description: >-
        Represents individual error details with a standardized code and
        descriptive message.
      properties:
        code:
          enum:
            - ERR_NOT_FOUND
            - ERR_BAD_REQUEST
            - ERR_SERVER_ERROR
          type: string
          x-spec-enum-id: dc5a5d6feae1b697
          description: >-
            Error code indicating the type of error: NOT_FOUND for missing
            resources, BAD_REQUEST for invalid input, SERVER_ERROR for internal
            server issues


            * `ERR_NOT_FOUND` - ERR_NOT_FOUND

            * `ERR_BAD_REQUEST` - ERR_BAD_REQUEST

            * `ERR_SERVER_ERROR` - ERR_SERVER_ERROR
        message:
          type: string
        error_id:
          type: string
          format: uuid
          description: >-
            Correlation handle for SERVER_ERROR responses — quote this when
            contacting support; it joins to the structured server log line for
            the failure. Not present on 4xx responses.
      required:
        - code
        - message
    TierBound:
      type: object
      properties:
        from:
          type: integer
          description: Start of the tier range
      required:
        - from
    BlockBound:
      type: object
      properties:
        from:
          type: integer
          description: Start of the block range
        to:
          type: integer
          description: End of the block range
      required:
        - from
        - to
    Pool:
      type: object
      properties:
        billing_mode:
          enum:
            - PRE_COMMITMENT
            - PAY_AS_YOU_GO
          type: string
          description: >-
            PRE_COMMITMENT: pool units are bought up front at the pool rate.
            PAY_AS_YOU_GO: pool units are billed at the pool rate as they are
            used.
          x-spec-enum-id: 63eb0617a6aeb15e
          readOnly: true
        rate_model:
          enum:
            - FLAT_RATE
            - TIERED
            - VOLUME_DISCOUNT
            - BLOCK
          type: string
          x-spec-enum-id: e005ba660b8dcddf
          description: >-
            How the tiers apply. FLAT_RATE has a single tier. TIERED charges
            each unit at the rate of the tier it falls in. VOLUME_DISCOUNT
            charges every unit at the rate of the tier the total quantity
            reaches.


            * `FLAT_RATE` - Flat-rate

            * `TIERED` - Tiered

            * `VOLUME_DISCOUNT` - Volume Discount

            * `BLOCK` - Block
        tiers:
          type: array
          items:
            $ref: '#/components/schemas/PoolTier'
          nullable: true
          readOnly: true
          description: >-
            The pool rate in the requested currency. Empty when the pool has no
            price in that currency. Null when the pool's pricing can't be
            expressed as tiers, such as BLOCK pricing or included units.
        default_pre_commitment:
          type: integer
          nullable: true
          description: Pool units committed by default on a new order. Null if unset.
        default_pre_commitment_schedule:
          enum:
            - ALL_UPFRONT
            - MONTHLY
            - QUARTERLY
            - SEMI_ANNUALLY
            - ANNUALLY
          type: string
          x-spec-enum-id: 3291f1569df314cc
          nullable: true
          description: >-
            How often the default commitment is billed and resets. Null if
            unset.


            * `ALL_UPFRONT` - All upfront

            * `MONTHLY` - Monthly

            * `QUARTERLY` - Quarterly

            * `SEMI_ANNUALLY` - Semi-annually

            * `ANNUALLY` - Annually
        pooled_bricks:
          type: array
          items:
            $ref: '#/components/schemas/PooledBrick'
          readOnly: true
          description: The bricks whose usage draws down this pool.
      required:
        - billing_mode
        - default_pre_commitment
        - default_pre_commitment_schedule
        - pooled_bricks
        - rate_model
        - tiers
    PoolTier:
      type: object
      properties:
        up_to:
          type: integer
          nullable: true
          description: >-
            Last unit (inclusive) this tier covers. The next tier starts at the
            unit after it. Null for the top tier, which has no upper limit.
        rate:
          type: string
          format: decimal
          pattern: ^-?\d{0,14}(?:\.\d{0,6})?$
          description: >-
            Price of one pool unit, in cents of the requested currency (e.g.
            "150.000000" = $1.50). Fractions of a cent are allowed.
      required:
        - rate
        - up_to
    PooledBrick:
      type: object
      properties:
        brick_id:
          type: string
          format: uuid
          description: Unique identifier for the brick
        brick_name:
          type: string
          description: Name of the brick
        brick_code:
          type: string
          nullable: true
          description: >-
            The internal SKU code you set on the brick. Unlike `brick_id` it
            stays the same across environments and when a brick is recreated, so
            use it to map bricks to your own features. Null when the brick has
            no code.
        rate_model:
          enum:
            - FLAT_RATE
            - TIERED
            - VOLUME_DISCOUNT
            - BLOCK
          type: string
          x-spec-enum-id: e005ba660b8dcddf
          description: >-
            How the tiers apply. FLAT_RATE has a single tier. TIERED charges
            each unit at the rate of the tier it falls in. VOLUME_DISCOUNT
            charges every unit at the rate of the tier the total quantity
            reaches.


            * `FLAT_RATE` - Flat-rate

            * `TIERED` - Tiered

            * `VOLUME_DISCOUNT` - Volume Discount

            * `BLOCK` - Block
        tiers:
          type: array
          items:
            $ref: '#/components/schemas/PooledBrickTier'
          description: This brick's pool rates. Currently always a single tier.
      required:
        - brick_code
        - brick_id
        - brick_name
        - rate_model
        - tiers
    PooledBrickTier:
      type: object
      properties:
        up_to:
          type: integer
          nullable: true
          description: >-
            Last unit (inclusive) this tier covers. The next tier starts at the
            unit after it. Null for the top tier, which has no upper limit.
        pool_unit_rate:
          type: string
          format: decimal
          pattern: ^-?\d{0,14}(?:\.\d{0,6})?$
          description: >-
            Pool units drawn for each unit of usage on this brick. A rate of
            "2.5" means 10 units of usage draw 25 pool units.
        overage_unit_rate:
          type: string
          format: decimal
          pattern: ^-?\d{0,14}(?:\.\d{0,6})?$
          description: >-
            Multiplier on the pool's rate for each unit of usage on this brick
            once the pool's commitment is used up. Overage price per unit =
            overage_unit_rate x pool rate. Not used by PAY_AS_YOU_GO pools,
            which bill all usage at pool_unit_rate x pool rate.
      required:
        - overage_unit_rate
        - pool_unit_rate
        - up_to
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-SALESBRICKS-KEY
      description: API key for authentication

````

## Related topics

- [Retrieve a subscription](/api-reference/subscriptions/retrieve-a-subscription.md)
- [Retrieve a customer](/api-reference/customers/retrieve-a-customer.md)
- [Retrieve an invoice](/api-reference/invoices/retrieve-an-invoice.md)


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