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

# Fetch plan instance

> This endpoint allows fetching a plan instance by id.



## OpenAPI

````yaml /api-reference/openapi.yaml get /v1/plan-instances/{id}
openapi: 3.1.0
info:
  title: API Reference
  version: '1.0'
  description: Aira API Reference
  x-logo:
    url: https://static.useaira.com/images/airalogo.svg
    backgroundColor: '#FFFFFF'
    altText: Aira Logo
servers:
  - url: https://api.useaira.com
    description: API base URL
security:
  - ApiKey: []
paths:
  /v1/plan-instances/{id}:
    get:
      tags:
        - Plan Instances
      summary: Fetch plan instance
      description: This endpoint allows fetching a plan instance by id.
      parameters:
        - schema:
            type: string
            format: uuid
          in: path
          name: id
          required: true
      responses:
        '200':
          description: Schema representing a plan instance.
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                  contractId:
                    type: string
                    format: uuid
                  planId:
                    type: string
                    format: uuid
                  activePlanInstanceVersionId:
                    type: string
                    format: uuid
                  activePlanVersionId:
                    type: string
                    format: uuid
                  activePlanInstanceVersionReason:
                    type: string
                    enum:
                      - created_from_plan_version
                      - duplicated_from_contract
                      - manual_override
                      - readjustment
                      - rollback
                  status:
                    type: string
                    enum:
                      - active
                      - canceled
                      - completed
                  plan:
                    type: object
                    description: Plan core schema defining plan base properties.
                    properties:
                      id:
                        type: string
                        format: uuid
                        description: The unique identifier for this plan.
                      name:
                        type: string
                        minLength: 1
                        description: The name of the plan.
                      description:
                        type: string
                        nullable: true
                        description: Optional description of the plan.
                      productId:
                        type: string
                        format: uuid
                        description: The ID of the product this plan is associated with.
                    required:
                      - id
                      - name
                      - description
                      - productId
                    additionalProperties: false
                  activePlanInstanceVersion:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                      planInstanceId:
                        type: string
                        format: uuid
                      planVersionId:
                        type: string
                        format: uuid
                      planSettingsId:
                        type: string
                        format: uuid
                      versionNumber:
                        type: number
                        minimum: 1
                      isActive:
                        type: boolean
                      planInstanceVersionReason:
                        type: string
                        enum:
                          - created_from_plan_version
                          - duplicated_from_contract
                          - manual_override
                          - readjustment
                          - rollback
                      metadata:
                        anyOf:
                          - type: object
                            properties:
                              reason:
                                type: string
                                enum:
                                  - created_from_plan_version
                              sourcePlanVersionId:
                                type: string
                                format: uuid
                            required:
                              - reason
                              - sourcePlanVersionId
                            additionalProperties: false
                          - type: object
                            properties:
                              reason:
                                type: string
                                enum:
                                  - duplicated_from_contract
                              sourceContractId:
                                type: string
                                format: uuid
                              sourcePlanInstanceId:
                                type: string
                                format: uuid
                            required:
                              - reason
                              - sourceContractId
                              - sourcePlanInstanceId
                            additionalProperties: false
                          - type: object
                            properties:
                              reason:
                                type: string
                                enum:
                                  - manual_override
                              previousPlanInstanceVersionId:
                                type: string
                                format: uuid
                            required:
                              - reason
                              - previousPlanInstanceVersionId
                            additionalProperties: false
                          - type: object
                            properties:
                              reason:
                                type: string
                                enum:
                                  - readjustment
                              previousPlanInstanceVersionId:
                                type: string
                                format: uuid
                              percentage:
                                type: string
                            required:
                              - reason
                              - previousPlanInstanceVersionId
                              - percentage
                            additionalProperties: false
                          - type: object
                            properties:
                              reason:
                                type: string
                                enum:
                                  - rollback
                              rolledBackFromPlanInstanceVersionId:
                                type: string
                                format: uuid
                            required:
                              - reason
                              - rolledBackFromPlanInstanceVersionId
                            additionalProperties: false
                          - type: 'null'
                      createdBy:
                        type: string
                        nullable: true
                        format: uuid
                      planSettings:
                        type: object
                        properties:
                          id:
                            type: string
                            format: uuid
                          fixedAmount:
                            type: number
                            minimum: 0
                          minimumAmount:
                            type: number
                            minimum: 0
                          metrics:
                            type: array
                            items:
                              type: object
                              properties:
                                id:
                                  type: string
                                  format: uuid
                                resourceId:
                                  type: string
                                  format: uuid
                                currencyUnitId:
                                  type: string
                                  format: uuid
                                name:
                                  type: string
                                  minLength: 1
                                priceTierDivision:
                                  type: string
                                  enum:
                                    - unique_tier
                                    - progressive
                                fixedAmount:
                                  type: number
                                  minimum: 0
                                minimumAmount:
                                  type: number
                                  minimum: 0
                                resource:
                                  type: object
                                  properties:
                                    id:
                                      type: string
                                      format: uuid
                                    name:
                                      type: string
                                      minLength: 1
                                    type:
                                      type: string
                                      enum:
                                        - unit
                                        - currency
                                    billingModel:
                                      type: string
                                      enum:
                                        - in_full
                                        - proration
                                    itemId:
                                      type: string
                                      format: uuid
                                  required:
                                    - id
                                    - name
                                    - type
                                    - billingModel
                                    - itemId
                                  additionalProperties: false
                                currencyUnit:
                                  type: object
                                  description: Schema representing a currency unit.
                                  properties:
                                    id:
                                      type: string
                                      format: uuid
                                    name:
                                      type: string
                                    code:
                                      type: string
                                  required:
                                    - id
                                    - name
                                    - code
                                  additionalProperties: false
                                priceTiers:
                                  type: array
                                  items:
                                    type: object
                                    properties:
                                      id:
                                        type: string
                                        format: uuid
                                      billingType:
                                        type: string
                                        enum:
                                          - unit
                                          - package
                                          - flat
                                          - basis_points
                                      from:
                                        type: number
                                        minimum: 1
                                      to:
                                        type: number
                                        nullable: true
                                        minimum: 1
                                      packageSize:
                                        type: number
                                        nullable: true
                                        minimum: 1
                                      price:
                                        type: string
                                        nullable: true
                                      fixedPrice:
                                        type: string
                                        nullable: true
                                      basisPoints:
                                        type: number
                                        nullable: true
                                        minimum: 0
                                    required:
                                      - id
                                      - billingType
                                      - from
                                      - to
                                      - packageSize
                                      - price
                                      - fixedPrice
                                      - basisPoints
                                    additionalProperties: false
                              required:
                                - id
                                - resourceId
                                - currencyUnitId
                                - name
                                - priceTierDivision
                                - fixedAmount
                                - minimumAmount
                                - resource
                                - currencyUnit
                                - priceTiers
                              additionalProperties: false
                        required:
                          - id
                          - fixedAmount
                          - minimumAmount
                          - metrics
                        additionalProperties: false
                    required:
                      - id
                      - planInstanceId
                      - planVersionId
                      - planSettingsId
                      - versionNumber
                      - isActive
                      - planInstanceVersionReason
                      - metadata
                      - createdBy
                      - planSettings
                    additionalProperties: false
                required:
                  - id
                  - contractId
                  - planId
                  - activePlanInstanceVersionId
                  - activePlanVersionId
                  - activePlanInstanceVersionReason
                  - status
                  - plan
                  - activePlanInstanceVersion
                additionalProperties: false
        '404':
          description: Error object returned to the client when a resource is not found.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: A human-readable description of the error
components:
  securitySchemes:
    ApiKey:
      type: apiKey
      description: API Key Authentication.
      name: X-API-KEY
      in: header

````