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

# Get a subscription



## OpenAPI

````yaml /openapi.yaml get /v2/subscriptions/{xid}
openapi: 3.1.0
info:
  title: Bondio API
  version: '1.0'
  description: Bondio's REST API for eSIM provisioning, plans, subscriptions, and billing.
servers:
  - url: https://api.bondio.co
    description: prod
security:
  - BearerAuth: []
tags:
  - name: Plan
  - name: Esim
  - name: Subscription
  - name: Addon Attachment
paths:
  /v2/subscriptions/{xid}:
    parameters:
      - schema:
          type: string
        name: xid
        in: path
        required: true
        description: esim ICCID or subscription id
    get:
      tags:
        - SubscriptionV2
      summary: Get a subscription
      operationId: get-v2-subscriptions-xid
      parameters:
        - schema:
            type: string
          in: query
          name: expand
          description: can be used to fetch full esim object with `expand=esim`
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscriptionV2'
components:
  schemas:
    SubscriptionV2:
      title: SubscriptionV2
      x-stoplight:
        id: 42fsx0aepeykb
      type: object
      examples:
        - id: sub2_wyr3ios2
          esim:
            id: esim_iddfsdf1
            iccid: 891004234814455936F
            activationCode: LPA:1$smdp.bondio.com$23LKL-32340MX-20349LIH
            msisdn: '449898978234'
            label: alpha
          createdAt: 123143243
          metadata: tag1
      required:
        - id
        - esim
        - createdAt
        - metadata
      properties:
        id:
          type: string
          x-stoplight:
            id: onh9j4vuq17i4
        esim:
          x-stoplight:
            id: pv6dew9qsgk9l
          anyOf:
            - $ref: '#/components/schemas/Esim'
              x-stoplight:
                id: rtb5i2vo3h6hm
            - type: string
              x-stoplight:
                id: ta8rwiie5i1fr
              description: ICCID of the esim
        createdAt:
          type: integer
          x-stoplight:
            id: u0ow9hvyo6nxi
        metadata:
          type:
            - string
            - 'null'
          x-stoplight:
            id: pvg1jphh2w9q0
    Esim:
      title: Esim
      x-stoplight:
        id: wuubfexjvtk38
      type: object
      examples:
        - iccid: 891004234814455936F
          activationCode: LPA:1$smdp.bondio.com$23LKL-32340MX-20349LIH
          msisdn: '449898978234'
          label: alpha
      required:
        - iccid
        - msisdn
        - activationCode
        - label
      properties:
        iccid:
          type: string
          x-stoplight:
            id: 77c3kygb5y0ym
        msisdn:
          type: string
          x-stoplight:
            id: 5lsad34xx9dp2
        activationCode:
          type: string
          x-stoplight:
            id: 55rvmfcomwgh9
        label:
          type: string
          x-stoplight:
            id: 0xaawmb6yf9d8
          description: The plan-esim compatibility label
        availability:
          $ref: '#/components/schemas/Availability'
          x-stoplight:
            id: 214dmj7esx16g
    Availability:
      title: Availability
      x-stoplight:
        id: 9dike6s5qmy6j
      type: object
      examples:
        - gracePeriodFinishAction: LAPSE
          gracePeriodFinishAt: 1768481221
          currentState: ACTIVE
      required:
        - gracePeriodFinishAction
        - gracePeriodFinishAt
        - currentState
      properties:
        gracePeriodFinishAction:
          x-stoplight:
            id: zx89smtdjw4vv
          enum:
            - LAPSE
            - PRESERVE
          description: >-
            The action that would be taken by the system once the grace period
            is finished.
        gracePeriodFinishAt:
          type: integer
          x-stoplight:
            id: d9jtor8yynr7y
          description: Timestamp at which the grace period finishes.
        currentState:
          x-stoplight:
            id: o4y33otft632k
          enum:
            - ACTIVE
            - LAPSED
      x-internal: false
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````