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

# Retrieve a plan by id

> Use this endpoint to retrieve a plan using the id.



## OpenAPI

````yaml /openapi/legacy/subscriptions/partner-to-bango/openapi.yaml get /plan/{planId}
openapi: 3.0.1
info:
  title: Bango Subscriptions API
  version: 1.4.0
  description: |-
    Manage user subscriptions to products and services.

    ### Change log
    - 1.4.0: 
        - Adding Plan Management API methods
          - Add `POST /plan`
          - Add `GET /plan/{planName}`
          - Add `GET /plan/{planId}`
          - Add `GET /plans`
        - Support for additional character types  as the first character of `planName`'s 
    - 1.3.0:
        - Add `productName` update functionality to `PUT /subscription/{subscriptionId}`
    - 1.2.0:
        - Move to OpenAPI 3.0.1 and refactor
        - Synchronize with API behavior
    - 1.1.0:
        - Remove `billingPolicy`, `useRequestedDateForBilling` from `DELETE /subscription/{subscriptionId}/cancel`
    - 1.0.0:
        - Add `merchantAccountKey` to `POST` and `GET`
    - 0.0.1:
        - Initial release
  contact:
    name: Bango Support
    url: https://bango.com
    email: support@bango.com
  termsOfService: https://bango.com/privacy
servers:
  - url: https://virtserver.swaggerhub.com/BangoProducts/Subscriptions-API/1.4.0
security:
  - basicAuth: []
tags:
  - name: echo
    description: Service availability
  - name: subscriptions
    description: Subscription management
  - name: plans
    description: Plan management
externalDocs:
  description: Bango developer documentation
  url: https://developer.bango.com
paths:
  /plan/{planId}:
    get:
      tags:
        - plans
      summary: Retrieve a plan by id
      description: Use this endpoint to retrieve a plan using the id.
      operationId: get-plan-by-id
      parameters:
        - name: planId
          in: path
          description: >-
            The unique identifier generated by Bango for a plan. This is a
            globally unique, opaque string
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Plan found
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SuccessResponse'
                  - $ref: '#/components/schemas/Plan'
        '400':
          $ref: '#/components/responses/ErrorBadRequest'
        '401':
          $ref: '#/components/responses/ErrorUnauthorized'
        '404':
          $ref: '#/components/responses/ErrorPlanNotFound'
        '429':
          $ref: '#/components/responses/ErrorTooManyRequests'
        '500':
          $ref: '#/components/responses/ErrorUnexpected'
        '503':
          $ref: '#/components/responses/ErrorUnavailable'
components:
  schemas:
    SuccessResponse:
      type: object
      properties:
        responseCode:
          description: Always 'OK'
          type: string
          enum:
            - OK
        responseMessage:
          type: string
          example: Success
      required:
        - responseCode
        - responseMessage
    Plan:
      description: A subscription plan record in the Bango Platform
      type: object
      properties:
        planId:
          $ref: '#/components/schemas/PlanId'
        productName:
          $ref: '#/components/schemas/ProductName'
        planName:
          $ref: '#/components/schemas/PlanName'
        planPhases:
          type: array
          items:
            $ref: '#/components/schemas/PlanPhase'
    PlanId:
      description: >-
        The unique identifier generated by Bango for a plan. This is a globally
        unique, opaque string
      type: string
      format: uuid
      example: 123e4567-e89b-12d3-a456-426614174000
    ProductName:
      description: >-
        The unique identifier for the product or service the user is subscribing
        to. The product catalog defines these identifiers. The first character
        of the planName can't be a number.
      type: string
      example: bango-music
    PlanName:
      description: >-
        The unique identifier for the plan detailing the prices and offer
        periods associated with the subscription. Bango use NCName type which
        means that the planName cannot contain several symbol characters like :,
        @, $, %, &, /, +, ,, ;, whitespace characters or different parenthesis.
      type: string
      example: bango-music-3-months-free
    PlanPhase:
      type: object
      properties:
        sequence:
          type: integer
          description: >-
            The unique sequence identifier in which the phases must be executed
            for the plan. This must be sequential. E.g, if you have three phases
            in the plan you must use 0, 1 & 2 as your sequenceId's. If you
            provide duplicate sequenceId's in the same plan or do not follow the
            sequential ordering a `400 BAD_REQUEST` will be returned.
          example: 0
        billDescription:
          description: >-
            passed through to the payment providers system for usage on the
            customer bill if applicable
          example: Bango Music 3 months on us
        type:
          $ref: '#/components/schemas/PhaseType'
        duration:
          $ref: '#/components/schemas/PhaseDuration'
        billingPeriod:
          $ref: '#/components/schemas/BillingPeriod'
        price:
          $ref: '#/components/schemas/Price'
      required:
        - sequenceId
        - type
        - billingPeriod
        - price
    PhaseType:
      type: string
      enum:
        - TRIAL
        - DISCOUNT
        - FIXEDTERM
        - EVERGREEN
    PhaseDuration:
      description: >
        How long a phase lasts, in ISO 8601 format. If omitted or the empty
        string, this will be ignored. Only the EVERGREEN phase will last
        forever.


        ISO 8601 supports durations using several units simultaneously. For
        example, you can define a duration of 2 months and 1 week using "P2M1W".
        Bango supports this for full flexibility, but note that durations
        including hours and minutes may round up to the nearest day. Typically,
        durations are measured in weeks or months and use no other units.


        Bango Subscription plans can be set to use both D (day) & M (month) for
        periods. T (time) is not supported.


        See https://en.wikipedia.org/wiki/ISO_8601#Durations
      type: string
      format: iso-8601-duration
      example: P3M
    BillingPeriod:
      description: |-
        How frequently the user is billed. For the avoidance of doubt:

        - BIWEEKLY = every 2 weeks
        - BIMESTRIAL = every 2 months
        - BIANNUAL = every 6 months
        - BIENNIAL = every 2 years
      type: string
      enum:
        - MONTHLY
        - DAILY
        - WEEKLY
        - BIWEEKLY
        - THIRTY_DAYS
        - SIXTY_DAYS
        - NINETY_DAYS
        - BIMESTRIAL
        - QUARTERLY
        - TRIANNUAL
        - BIANNUAL
        - ANNUAL
        - BIENNIAL
        - NO_BILLING_PERIOD
    Price:
      type: object
      properties:
        amount:
          type: number
          example: 0
        currency:
          $ref: '#/components/schemas/CurrencyCode'
      required:
        - amount
        - currency
    CurrencyCode:
      description: A three-character ISO 4217 currency code.
      type: string
      enum:
        - AED
        - AFN
        - ALL
        - AMD
        - ANG
        - AOA
        - ARS
        - AUD
        - AWG
        - AZN
        - BAM
        - BBD
        - BDT
        - BGN
        - BHD
        - BIF
        - BMD
        - BND
        - BOB
        - BRL
        - BSD
        - BTC
        - BTN
        - BWP
        - BYR
        - BZD
        - CAD
        - CDF
        - CHF
        - CLP
        - CNY
        - COP
        - CRC
        - CUC
        - CUP
        - CVE
        - CZK
        - DJF
        - DKK
        - DOP
        - DZD
        - EGP
        - ERN
        - ETB
        - EUR
        - FJD
        - FKP
        - GBP
        - GEL
        - GGP
        - GHS
        - GIP
        - GMD
        - GNF
        - GTQ
        - GYD
        - HKD
        - HNL
        - HRK
        - HTG
        - HUF
        - IDR
        - ILS
        - IMP
        - INR
        - IQD
        - IRR
        - ISK
        - JEP
        - JMD
        - JOD
        - JPY
        - KES
        - KGS
        - KHR
        - KMF
        - KPW
        - KRW
        - KWD
        - KYD
        - KZT
        - LAK
        - LBP
        - LKR
        - LRD
        - LSL
        - LTL
        - LVL
        - LYD
        - MAD
        - MDL
        - MGA
        - MKD
        - MMK
        - MNT
        - MOP
        - MRO
        - MUR
        - MVR
        - MWK
        - MXN
        - MYR
        - MZN
        - NAD
        - NGN
        - NIO
        - NOK
        - NPR
        - NZD
        - OMR
        - PAB
        - PEN
        - PGK
        - PHP
        - PKR
        - PLN
        - PYG
        - QAR
        - RON
        - RSD
        - RUB
        - RWF
        - SAR
        - SBD
        - SCR
        - SDG
        - SEK
        - SGD
        - SHP
        - SLL
        - SOS
        - SPL
        - SRD
        - STD
        - SVC
        - SYP
        - SZL
        - THB
        - TJS
        - TMT
        - TND
        - TOP
        - TRY
        - TTD
        - TVD
        - TWD
        - TZS
        - UAH
        - UGX
        - USD
        - UYU
        - UZS
        - VEF
        - VND
        - VUV
        - WST
        - XAF
        - XCD
        - XDR
        - XOF
        - XPF
        - YER
        - ZAR
        - ZMW
        - ZWD
      example: USD
  responses:
    ErrorBadRequest:
      description: Bad request
      content:
        application/json:
          schema:
            type: object
            properties:
              responseCode:
                description: Always 'BAD_REQUEST'
                type: string
                enum:
                  - BAD_REQUEST
              responseMessage:
                type: string
                example: Invalid request
            required:
              - responseCode
              - responseMessage
    ErrorUnauthorized:
      description: User is not authorized to access the endpoint
      content:
        application/json:
          schema:
            type: object
            properties:
              responseCode:
                description: Always 'UNAUTHORIZED'
                type: string
                enum:
                  - UNAUTHORIZED
              responseMessage:
                type: string
                example: Invalid access credential
            required:
              - responseCode
              - responseMessage
    ErrorPlanNotFound:
      description: Plan not found
      content:
        application/json:
          schema:
            type: object
            properties:
              responseCode:
                description: Always 'NOT_FOUND'
                type: string
                enum:
                  - NOT_FOUND
              responseMessage:
                type: string
                example: Plan not found
            required:
              - responseCode
              - responseMessage
    ErrorTooManyRequests:
      description: Too many requests
      content:
        application/json:
          schema:
            type: object
            properties:
              responseCode:
                description: Always 'TOO_MANY_REQUESTS'
                type: string
                enum:
                  - TOO_MANY_REQUESTS
              responseMessage:
                type: string
                example: Request limit reached. Please try again later
            required:
              - responseCode
              - responseMessage
    ErrorUnexpected:
      description: Unexpected error
      content:
        application/json:
          schema:
            type: object
            properties:
              responseCode:
                description: Always 'INTERNAL_ERROR'
                type: string
                enum:
                  - INTERNAL_ERROR
              responseMessage:
                type: string
                example: >-
                  The server encountered an unexpected condition which prevented
                  it from fulfilling the request
            required:
              - responseCode
              - responseMessage
    ErrorUnavailable:
      description: Service unavailable
      content:
        application/json:
          schema:
            type: object
            properties:
              responseCode:
                description: Always 'SERVICE_UNAVAILABLE'
                type: string
                enum:
                  - SERVICE_UNAVAILABLE
              responseMessage:
                type: string
                example: >-
                  The server is undergoing maintenance and is not available.
                  Please, try again later
            required:
              - responseCode
              - responseMessage
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: Base64 encoding of username:password as supplied by Bango Support

````