> ## 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.

# (Topup) Create a plan attachment



## OpenAPI

````yaml /openapi.yaml post /v2/subscriptions/{xid}/plan-attachments
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}/plan-attachments:
    parameters:
      - schema:
          type: string
        name: xid
        in: path
        required: true
        description: esim ICCID or subscription id
    post:
      tags:
        - SubscriptionV2
      summary: (Topup) Create a plan attachment
      operationId: post-v2-subscriptions-xid-plan-attachments
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - activationType
              properties:
                planId:
                  type: string
                  x-stoplight:
                    id: o21ygwpr10eav
                plan:
                  type: object
                  x-stoplight:
                    id: avgx5ocst8zbs
                  required:
                    - dataMBs
                    - periodDays
                    - coverageId
                  properties:
                    dataMBs:
                      type: integer
                      x-stoplight:
                        id: b43lx7f5dxvlg
                    periodDays:
                      type: integer
                      x-stoplight:
                        id: egnrcr0nnfem8
                    coverageId:
                      type: string
                      x-stoplight:
                        id: r63ceyc1naywn
                activationType:
                  x-stoplight:
                    id: o99zjm2pwe9xc
                  enum:
                    - FIRST_USAGE
                    - NOW
                    - SCHEDULED
                activationAt:
                  type: number
                  x-stoplight:
                    id: xqdmipbuo75xv
                  description: >-
                    Unix timestamp at which the plan should be activated. Only
                    required when activation type is SCHEDULED.
        description: Exactly one of the planId or plan should be provided
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlanAttachment'
components:
  schemas:
    PlanAttachment:
      title: PlanAttachment
      x-stoplight:
        id: 4khtht2byisce
      type: object
      required:
        - id
        - createdAt
        - activationAt
        - expirationAt
        - state
        - usedAllowance
        - plan
      properties:
        id:
          type: string
          x-stoplight:
            id: pfay6jmculzxo
        createdAt:
          type: number
          x-stoplight:
            id: 0ye7j7zd7yy9r
        activationAt:
          type: number
          x-stoplight:
            id: xp5yzoeyl152d
        expirationAt:
          type: number
          x-stoplight:
            id: k4ec6ozn8l3dh
        state:
          x-stoplight:
            id: h7e0wsa9mncix
          enum:
            - CREATED
            - PENDING_FOR_FIRST_USE
            - SCHEDULED
            - ACTIVE
            - EXPIRED
            - SUSPENDED
        usedAllowance:
          $ref: '#/components/schemas/Allowance'
          x-stoplight:
            id: nsx5ksce9t4lu
        plan:
          $ref: '#/components/schemas/PlanForAttachment'
          x-stoplight:
            id: ykduvzapqrrfx
    Allowance:
      title: Allowance
      x-stoplight:
        id: xprozbv6umr33
      type: object
      examples:
        - dataBytes: 1024
          voiceSeconds: 60
          smsMessages: 100
      properties:
        dataBytes:
          type:
            - integer
            - 'null'
          x-stoplight:
            id: cjcvtodo08pjs
          format: int64
          minimum: 0
        voiceSeconds:
          type:
            - integer
            - 'null'
          x-stoplight:
            id: 5lrv0ke2wi39u
        smsMessages:
          type:
            - integer
            - 'null'
          x-stoplight:
            id: 17ms5p0dzfm0m
    PlanForAttachment:
      title: PlanForAttachment
      x-stoplight:
        id: odujx98nt7wac
      type: object
      examples:
        - name: Australia 1GB 7d
          dataMegaBytes: 1024
          periodDays: 1
          periodIterations: 7
          throttledSpeedKbps: 128
          label: alpha
          coverageProfileId: cvpr_ybrs38es
      x-internal: false
      properties:
        name:
          type: string
          deprecated: true
        dataMegaBytes:
          type: integer
        periodDays:
          type: integer
          description: Plan validity in days
        periodIterations:
          type: integer
          description: |
            Number of times the periodDays should be repeated.
          default: 1
        throttledSpeedKbps:
          type: integer
          description: >-
            Speed after allocated data is used up. The default zero means no
            usage allowed afterwards.
          default: 0
        label:
          type: string
          description: The plan-esim compatibility label
        coverageProfileId:
          type: string
          x-stoplight:
            id: 08gh0d0gwjx1r
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````