> ## 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) Attach an addon to a subscription

> Attaches an addon plan to an already existing subscription in order to increase its validity and/or data, voice or sms allowance. The subscription should not have expired for it to work.



## OpenAPI

````yaml /openapi.yaml post /v1/subscriptions/{id}/addons
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:
  /v1/subscriptions/{id}/addons:
    parameters:
      - schema:
          type: string
        name: id
        in: path
        required: true
    post:
      tags:
        - Subscription
      summary: (Topup) Attach an addon to a subscription
      description: >-
        Attaches an addon plan to an already existing subscription in order to
        increase its validity and/or data, voice or sms allowance. The
        subscription should not have expired for it to work.
      operationId: create-a-subscription-addon
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                addonPlanId:
                  type: string
                  x-stoplight:
                    id: 4wt33wyf9nxev
                  description: >-
                    The id of the addon plan to be attached. The addon plan
                    should not be archived
                addonPlan:
                  type: object
                  x-stoplight:
                    id: 6d7d0jtwgb8em
                  properties:
                    coverageId:
                      type: string
                      x-stoplight:
                        id: u3y7ywq0lhku5
                    dataMBs:
                      type: integer
                      x-stoplight:
                        id: kjyyuosqz94c6
                    periodDays:
                      type: integer
                      x-stoplight:
                        id: na9ip54kytg9o
                validityStartBehavior:
                  type: string
                  x-stoplight:
                    id: z3p07zmv1xx9a
                  description: >
                    Defines the start time of the addon plan. There are two
                    options:

                    1. START_NOW: Start the validity of add on plan instantly

                    2. END_OF_CUR_EXPIRY Start the validity add on plan on end
                    of current plan expiry.

                    In both the cases, the data allowance is available
                    instantly.
        description: Exactly one of the `addon` or `addonPlanId` must be provided
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AddonAttachment'
        '412':
          description: The request couldn't be processed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    AddonAttachment:
      title: AddonAttachment
      x-stoplight:
        id: 55qgbjge33wvx
      type: object
      examples:
        - id: addon_do3st1ana
          attachedAt: 17123891233
          addonPlan:
            id: plan_gulabo12
            name: Australia 1GB 7d recurring throttled
            voiceMinutes: 60
            dataMegaBytes: 1024
            smsMessages: 100
            periodDays: 1
            periodIterations: 7
            throttledSpeedKbps: 128
            archivedAt: null
            label: sigma
            createdAt: 1781231233
            coverageProfileId: cvpr_hdy2da3n
      required:
        - id
        - addonPlanId
        - attachedAt
        - addonPlan
      properties:
        id:
          type: string
          x-stoplight:
            id: 3vid5ra8fr3ns
        addonPlanId:
          type: string
          x-stoplight:
            id: ofj9pla28ldol
          deprecated: true
        attachedAt:
          type: integer
          x-stoplight:
            id: yzo63mai5r9sh
        addonPlan:
          $ref: '#/components/schemas/PlanForAttachment'
          x-stoplight:
            id: piyn1gq4vra9v
    Error:
      type: object
      x-examples:
        Example 1:
          object: error
          code: invalidICCID
          details:
            - object: propertyErrorDetail
              code: propertyRequired
              message: Invalid value for property.
              property: property1
              suggestion: alternative_value
          documentation:
            - >-
              https://developers.gigs.com/docs/api/ZG9jOjExMTYzMDU0-error-handling
          hint: Parameter iccid must match /^([0-9]{19}F?|[0-9]{20})$/i
          message: Invalid ICCID format.
          type: invalid
      examples:
        - code: outOfInventory
          message: >-
            New subscription could not be created because the account is out of
            inventory
          docsUrl: https://bondio.stoplight.io/docs/bondio-api
      required:
        - code
        - message
        - docsUrl
      properties:
        code:
          type: string
          description: |-
            A machine-readable description of the error.

            Example: `outOfInventory`
        message:
          type: string
          description: A human readable description of the error
        docsUrl:
          type:
            - string
            - 'null'
          description: >-
            A URL to the docs page providing further information to resolve the
            error.
    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

````