Subscription Add-ons

Properties

  • Name
    object
    Type
    string
    Description

    Type of object is always subscriptionAddon.

  • Name
    id
    Type
    string
    Description

    Unique identifier for the subscription add-on.

    Example: sad_0SNlurA049MEWV2UNWPbDfW5B40U
  • Name
    addon
    Type
    object
    PREVIEW
    Description
    • Name
      object
      Type
      string
      required
      Description

      Type of object is always addon.

    • Name
      id
      Type
      string
      required
      Description

      Unique identifier for the add-on.

      Example: add_0SNlurA049MEWV4VxLfwJc7PJtHc
    • Name
      allowances
      Type
      object
      required
      Description
      The allowances included in the add-on.
    • Name
      data
      Type
      integer
      DEPRECATED
      required
      Description

      The data allowance in bytes included in this add-on. A value of -1 indicates unlimited data.

      Example: 10000000000
    • Name
      dataUnit
      Type
      string
      DEPRECATED
      required
      Description

      The unit of the data value is always byte.

    • Name
      description
      Type
      nullable string
      required
      Description

      The description of the add-on.

      Example: Disable international roaming.
    • Name
      name
      Type
      string
      required
      Description

      Name for the add-on.

      Example: 1GB Data Top-up
    • Name
      price
      Type
      object
      required
      Description
      The price of the add-on.
    • Name
      provider
      Type
      string
      required
      Description

      The ID of the network provider supported by this add-on.

      Example: p5
    • Name
      recurrenceType
      Type
      string
      required
      Description

      The recurrence type the add-on.

      Example: oneTime
      Allowed values: oneTime, recurring
    • Name
      sms
      Type
      integer
      DEPRECATED
      required
      Description

      The sms allowance included in this add-on. A value of -1 indicates unlimited sms.

      Example: 100
    • Name
      smsUnit
      Type
      string
      DEPRECATED
      required
      Description

      The unit of the sms value is always sms.

    • Name
      status
      Type
      string
      required
      Description

      The current status of the add-on.

      Allowed values: draft, available, archived
    • Name
      type
      Type
      string
      required
      Description

      The type of the add-on.

      Example: topUp
      Allowed values: topUp, other
    • Name
      validity
      Type
      nullable object
      required
      Description
      The optional validity of the add-on. Add-ons without a set validity will inherit the validity of the subscribed plan.
    • Name
      voice
      Type
      integer
      DEPRECATED
      required
      Description

      The voice call allowance in seconds included in this add-on. A value of -1 indicates unlimited voice calls.

      Example: 30000
    • Name
      voiceUnit
      Type
      string
      DEPRECATED
      required
      Description

      The unit of the voice value is always second.

    • Name
      createdAt
      Type
      string
      required
      Description

      Time when the add-on was created .

      Example: 2021-01-21T19:12:28Z
  • Name
    currentPeriod
    Type
    nullable object
    Description
    Current subscription add-on period. Only present for active subscription add-ons.
    • Name
      number
      Type
      integer
      required
      Description

      Sequence number of the period.

      Example: 1
      >= 1
    • Name
      start
      Type
      string
      required
      Description

      Beginning of the period.

      Example: 2021-01-21T19:32:13Z
    • Name
      end
      Type
      string
      required
      Description

      End of the period.

      Example: 2021-02-20T19:38:34Z
  • Name
    status
    Type
    string
    Description

    The current status of the subscription add-on.

    Allowed values: pending, active, ended
  • Name
    subscription
    Type
    string
    Description

    Unique identifier of the subscription the add-on applies to.

    Example: sub_0SNlurA049MEWV2gSfSxi00xlPIi
  • Name
    user
    Type
    string
    Description

    Unique identifier of the user the subscription add-on belongs to.

    Example: usr_0SNlurA049MEWV4OpCwsNyC9Kn2d
  • Name
    activatedAt
    Type
    nullable string
    Description

    Time when the subscription add-on was activated.

    Example: 2021-01-15T12:36:57Z
  • Name
    canceledAt
    Type
    nullable string
    Description

    Time when the subscription add-on was canceled.

    Example: 2021-01-22T19:39:53Z
  • Name
    createdAt
    Type
    string
    Description

    Time when the subscription add-on was created.

    Example: 2021-01-15T12:30:28Z
  • Name
    endedAt
    Type
    string
    Description

    Time when the subscription add-on was ended.

    Example: 2021-01-30T23:12:28Z

Response

{
  "object": "subscriptionAddon",
  "id": "sad_0SNlurA049MEWV2UNWPbDfW5B40U",
  "addon": {
    "object": "addon",
    "id": "add_0SNlurA049MEWV4VxLfwJc7PJtHc",
    "allowances": {
      "dataBytes": 10000000000,
      "voiceSeconds": 30000,
      "smsMessages": 100
    },
    "data": 10000000000,
    "dataUnit": "byte",
    "description": "Disable international roaming.",
    "name": "1GB Data Top-up",
    "price": {
      "amount": 999,
      "currency": "USD"
    },
    "provider": "p5",
    "recurrenceType": "oneTime",
    "sms": 100,
    "smsUnit": "message",
    "status": "draft",
    "type": "topUp",
    "validity": {
      "unit": "day",
      "value": 7
    },
    "voice": 30000,
    "voiceUnit": "second",
    "createdAt": "2021-01-21T19:12:28Z"
  },
  "currentPeriod": {
    "number": 1,
    "start": "2021-01-21T19:32:13Z",
    "end": "2021-02-20T19:38:34Z"
  },
  "status": "pending",
  "subscription": "sub_0SNlurA049MEWV2gSfSxi00xlPIi",
  "user": "usr_0SNlurA049MEWV4OpCwsNyC9Kn2d",
  "activatedAt": "2021-01-15T12:36:57Z",
  "canceledAt": "2021-01-22T19:39:53Z",
  "createdAt": "2021-01-15T12:30:28Z",
  "endedAt": "2021-01-30T23:12:28Z"
}

GET/projects/{project}/subscriptionAddons/{id}

Retrieve a subscription add-on

Retrieve the details of an existing subscription add-on which the authenticated user is authorized to view.

Path Parameters

  • Name
    project
    Type
    string
    required
    Description

    The unique identifier for the project.

    Example: gigs
  • Name
    id
    Type
    string
    required
    Description

    The unique identifier for the subscription add-on.

    Example: sad_0SNlurA049MEWV2UNWPbDfW5B40U

Response Schemas

  • Name
    object
    Type
    string
    required
    Description

    Type of object is always subscriptionAddon.

  • Name
    id
    Type
    string
    required
    Description

    Unique identifier for the subscription add-on.

    Example: sad_0SNlurA049MEWV2UNWPbDfW5B40U
  • Name
    addon
    Type
    object
    PREVIEW
    required
    Description
    • Name
      object
      Type
      string
      required
      Description

      Type of object is always addon.

    • Name
      id
      Type
      string
      required
      Description

      Unique identifier for the add-on.

      Example: add_0SNlurA049MEWV4VxLfwJc7PJtHc
    • Name
      allowances
      Type
      object
      required
      Description
      The allowances included in the add-on.
    • Name
      data
      Type
      integer
      DEPRECATED
      required
      Description

      The data allowance in bytes included in this add-on. A value of -1 indicates unlimited data.

      Example: 10000000000
    • Name
      dataUnit
      Type
      string
      DEPRECATED
      required
      Description

      The unit of the data value is always byte.

    • Name
      description
      Type
      nullable string
      required
      Description

      The description of the add-on.

      Example: Disable international roaming.
    • Name
      name
      Type
      string
      required
      Description

      Name for the add-on.

      Example: 1GB Data Top-up
    • Name
      price
      Type
      object
      required
      Description
      The price of the add-on.
    • Name
      provider
      Type
      string
      required
      Description

      The ID of the network provider supported by this add-on.

      Example: p5
    • Name
      recurrenceType
      Type
      string
      required
      Description

      The recurrence type the add-on.

      Example: oneTime
      Allowed values: oneTime, recurring
    • Name
      sms
      Type
      integer
      DEPRECATED
      required
      Description

      The sms allowance included in this add-on. A value of -1 indicates unlimited sms.

      Example: 100
    • Name
      smsUnit
      Type
      string
      DEPRECATED
      required
      Description

      The unit of the sms value is always sms.

    • Name
      status
      Type
      string
      required
      Description

      The current status of the add-on.

      Allowed values: draft, available, archived
    • Name
      type
      Type
      string
      required
      Description

      The type of the add-on.

      Example: topUp
      Allowed values: topUp, other
    • Name
      validity
      Type
      nullable object
      required
      Description
      The optional validity of the add-on. Add-ons without a set validity will inherit the validity of the subscribed plan.
    • Name
      voice
      Type
      integer
      DEPRECATED
      required
      Description

      The voice call allowance in seconds included in this add-on. A value of -1 indicates unlimited voice calls.

      Example: 30000
    • Name
      voiceUnit
      Type
      string
      DEPRECATED
      required
      Description

      The unit of the voice value is always second.

    • Name
      createdAt
      Type
      string
      required
      Description

      Time when the add-on was created .

      Example: 2021-01-21T19:12:28Z
  • Name
    currentPeriod
    Type
    nullable object
    required
    Description
    Current subscription add-on period. Only present for active subscription add-ons.
    • Name
      number
      Type
      integer
      required
      Description

      Sequence number of the period.

      Example: 1
      >= 1
    • Name
      start
      Type
      string
      required
      Description

      Beginning of the period.

      Example: 2021-01-21T19:32:13Z
    • Name
      end
      Type
      string
      required
      Description

      End of the period.

      Example: 2021-02-20T19:38:34Z
  • Name
    status
    Type
    string
    required
    Description

    The current status of the subscription add-on.

    Allowed values: pending, active, ended
  • Name
    subscription
    Type
    string
    required
    Description

    Unique identifier of the subscription the add-on applies to.

    Example: sub_0SNlurA049MEWV2gSfSxi00xlPIi
  • Name
    user
    Type
    string
    required
    Description

    Unique identifier of the user the subscription add-on belongs to.

    Example: usr_0SNlurA049MEWV4OpCwsNyC9Kn2d
  • Name
    activatedAt
    Type
    nullable string
    required
    Description

    Time when the subscription add-on was activated.

    Example: 2021-01-15T12:36:57Z
  • Name
    canceledAt
    Type
    nullable string
    required
    Description

    Time when the subscription add-on was canceled.

    Example: 2021-01-22T19:39:53Z
  • Name
    createdAt
    Type
    string
    required
    Description

    Time when the subscription add-on was created.

    Example: 2021-01-15T12:30:28Z
  • Name
    endedAt
    Type
    string
    required
    Description

    Time when the subscription add-on was ended.

    Example: 2021-01-30T23:12:28Z

Request

GET
/projects/{project}/subscriptionAddons/{id}
curl https://api.gigs.com/projects/{project}/subscriptionAddons/{id} \
-X GET \
-H "Content-type: application/json" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json"

Response

{
  "object": "subscriptionAddon",
  "id": "sad_0SNlurA049MEWV2UNWPbDfW5B40U",
  "addon": {
    "object": "addon",
    "id": "add_0SNlurA049MEWV4VxLfwJc7PJtHc",
    "allowances": {
      "dataBytes": 10000000000,
      "voiceSeconds": 30000,
      "smsMessages": 100
    },
    "data": 10000000000,
    "dataUnit": "byte",
    "description": "Disable international roaming.",
    "name": "1GB Data Top-up",
    "price": {
      "amount": 999,
      "currency": "USD"
    },
    "provider": "p5",
    "recurrenceType": "oneTime",
    "sms": 100,
    "smsUnit": "message",
    "status": "draft",
    "type": "topUp",
    "validity": {
      "unit": "day",
      "value": 7
    },
    "voice": 30000,
    "voiceUnit": "second",
    "createdAt": "2021-01-21T19:12:28Z"
  },
  "currentPeriod": {
    "number": 1,
    "start": "2021-01-21T19:32:13Z",
    "end": "2021-02-20T19:38:34Z"
  },
  "status": "pending",
  "subscription": "sub_0SNlurA049MEWV2gSfSxi00xlPIi",
  "user": "usr_0SNlurA049MEWV4OpCwsNyC9Kn2d",
  "activatedAt": "2021-01-15T12:36:57Z",
  "canceledAt": "2021-01-22T19:39:53Z",
  "createdAt": "2021-01-15T12:30:28Z",
  "endedAt": "2021-01-30T23:12:28Z"
}

DELETE/projects/{project}/subscriptionAddons/{id}

End a subscription add-on

Ends a subscription add-on immediately. Only active subscription add-ons can be ended.

Path Parameters

  • Name
    project
    Type
    string
    required
    Description

    The unique identifier for the project.

    Example: gigs
  • Name
    id
    Type
    string
    required
    Description

    The unique identifier for the subscription add-on.

    Example: sad_0SNlurA049MEWV2UNWPbDfW5B40U

Response Schemas

  • Name
    object
    Type
    string
    required
    Description

    Type of object is always subscriptionAddon.

  • Name
    id
    Type
    string
    required
    Description

    Unique identifier for the subscription add-on.

    Example: sad_0SNlurA049MEWV2UNWPbDfW5B40U
  • Name
    addon
    Type
    object
    PREVIEW
    required
    Description
    • Name
      object
      Type
      string
      required
      Description

      Type of object is always addon.

    • Name
      id
      Type
      string
      required
      Description

      Unique identifier for the add-on.

      Example: add_0SNlurA049MEWV4VxLfwJc7PJtHc
    • Name
      allowances
      Type
      object
      required
      Description
      The allowances included in the add-on.
    • Name
      data
      Type
      integer
      DEPRECATED
      required
      Description

      The data allowance in bytes included in this add-on. A value of -1 indicates unlimited data.

      Example: 10000000000
    • Name
      dataUnit
      Type
      string
      DEPRECATED
      required
      Description

      The unit of the data value is always byte.

    • Name
      description
      Type
      nullable string
      required
      Description

      The description of the add-on.

      Example: Disable international roaming.
    • Name
      name
      Type
      string
      required
      Description

      Name for the add-on.

      Example: 1GB Data Top-up
    • Name
      price
      Type
      object
      required
      Description
      The price of the add-on.
    • Name
      provider
      Type
      string
      required
      Description

      The ID of the network provider supported by this add-on.

      Example: p5
    • Name
      recurrenceType
      Type
      string
      required
      Description

      The recurrence type the add-on.

      Example: oneTime
      Allowed values: oneTime, recurring
    • Name
      sms
      Type
      integer
      DEPRECATED
      required
      Description

      The sms allowance included in this add-on. A value of -1 indicates unlimited sms.

      Example: 100
    • Name
      smsUnit
      Type
      string
      DEPRECATED
      required
      Description

      The unit of the sms value is always sms.

    • Name
      status
      Type
      string
      required
      Description

      The current status of the add-on.

      Allowed values: draft, available, archived
    • Name
      type
      Type
      string
      required
      Description

      The type of the add-on.

      Example: topUp
      Allowed values: topUp, other
    • Name
      validity
      Type
      nullable object
      required
      Description
      The optional validity of the add-on. Add-ons without a set validity will inherit the validity of the subscribed plan.
    • Name
      voice
      Type
      integer
      DEPRECATED
      required
      Description

      The voice call allowance in seconds included in this add-on. A value of -1 indicates unlimited voice calls.

      Example: 30000
    • Name
      voiceUnit
      Type
      string
      DEPRECATED
      required
      Description

      The unit of the voice value is always second.

    • Name
      createdAt
      Type
      string
      required
      Description

      Time when the add-on was created .

      Example: 2021-01-21T19:12:28Z
  • Name
    currentPeriod
    Type
    nullable object
    required
    Description
    Current subscription add-on period. Only present for active subscription add-ons.
    • Name
      number
      Type
      integer
      required
      Description

      Sequence number of the period.

      Example: 1
      >= 1
    • Name
      start
      Type
      string
      required
      Description

      Beginning of the period.

      Example: 2021-01-21T19:32:13Z
    • Name
      end
      Type
      string
      required
      Description

      End of the period.

      Example: 2021-02-20T19:38:34Z
  • Name
    status
    Type
    string
    required
    Description

    The current status of the subscription add-on.

    Allowed values: pending, active, ended
  • Name
    subscription
    Type
    string
    required
    Description

    Unique identifier of the subscription the add-on applies to.

    Example: sub_0SNlurA049MEWV2gSfSxi00xlPIi
  • Name
    user
    Type
    string
    required
    Description

    Unique identifier of the user the subscription add-on belongs to.

    Example: usr_0SNlurA049MEWV4OpCwsNyC9Kn2d
  • Name
    activatedAt
    Type
    nullable string
    required
    Description

    Time when the subscription add-on was activated.

    Example: 2021-01-15T12:36:57Z
  • Name
    canceledAt
    Type
    nullable string
    required
    Description

    Time when the subscription add-on was canceled.

    Example: 2021-01-22T19:39:53Z
  • Name
    createdAt
    Type
    string
    required
    Description

    Time when the subscription add-on was created.

    Example: 2021-01-15T12:30:28Z
  • Name
    endedAt
    Type
    string
    required
    Description

    Time when the subscription add-on was ended.

    Example: 2021-01-30T23:12:28Z

Request

DELETE
/projects/{project}/subscriptionAddons/{id}
curl https://api.gigs.com/projects/{project}/subscriptionAddons/{id} \
-X DELETE \
-H "Content-type: application/json" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json"

Response

{
  "object": "subscriptionAddon",
  "id": "sad_0SNlurA049MEWV2UNWPbDfW5B40U",
  "addon": {
    "object": "addon",
    "id": "add_0SNlurA049MEWV4VxLfwJc7PJtHc",
    "allowances": {
      "dataBytes": 10000000000,
      "voiceSeconds": 30000,
      "smsMessages": 100
    },
    "data": 10000000000,
    "dataUnit": "byte",
    "description": "Disable international roaming.",
    "name": "1GB Data Top-up",
    "price": {
      "amount": 999,
      "currency": "USD"
    },
    "provider": "p5",
    "recurrenceType": "oneTime",
    "sms": 100,
    "smsUnit": "message",
    "status": "draft",
    "type": "topUp",
    "validity": {
      "unit": "day",
      "value": 7
    },
    "voice": 30000,
    "voiceUnit": "second",
    "createdAt": "2021-01-21T19:12:28Z"
  },
  "currentPeriod": {
    "number": 1,
    "start": "2021-01-21T19:32:13Z",
    "end": "2021-02-20T19:38:34Z"
  },
  "status": "pending",
  "subscription": "sub_0SNlurA049MEWV2gSfSxi00xlPIi",
  "user": "usr_0SNlurA049MEWV4OpCwsNyC9Kn2d",
  "activatedAt": "2021-01-15T12:36:57Z",
  "canceledAt": "2021-01-22T19:39:53Z",
  "createdAt": "2021-01-15T12:30:28Z",
  "endedAt": "2021-01-30T23:12:28Z"
}

GET/projects/{project}/subscriptionAddons

List all subscription add-ons

Returns a list of subscription add-ons. The subscription add-ons returned are sorted by creation date, with the most recently created subscription add-ons appearing first.

Path Parameters

  • Name
    project
    Type
    string
    required
    Description

    The unique identifier for the project.

    Example: gigs

Query Parameters

  • Name
    addon
    Type
    string
    Description

    The unique identifier for the add-on to be filtered by.

    Example: add_0SNlurA049MEWV4VxLfwJc7PJtHc
  • Name
    status
    Type
    array
    Description

    A comma-separated list of statuses to filter the subscription add-ons by.

    Default: pending,active
  • Name
    subscription
    Type
    string
    Description

    The unique identifier for the subscription to be filtered by.

    Example: sub_0SNlurA049MEWV2gSfSxi00xlPIi
  • Name
    user
    Type
    string
    Description

    The unique identifier for the user to be filtered by.

    Example: usr_0SNlurA049MEWV4OpCwsNyC9Kn2d
  • Name
    after
    Type
    string
    Description

    A cursor for use in pagination. The after parameter takes an object ID that defines the position in the list, only items immediately following the item with that ID will be returned.

  • Name
    before
    Type
    string
    Description

    A cursor for use in pagination. The before parameter takes an object ID that defines the position in the list, only items immediately preceding the item with that ID will be returned.

  • Name
    limit
    Type
    integer
    Description

    The limit of items to be returned in the list, between 0 and 200.

    Default: 10
    >= 0
    <= 200

Response Schemas

  • Name
    object
    Type
    string
    required
    Description

    Type of object is always list.

  • Name
    items
    Type
    array
    required
    Description

    List of objects of type subscriptionAddon.

  • Name
    moreItemsAfter
    Type
    nullable string
    required
    Description

    A unique identifier to be used as after pagination parameter if more items are available sorted after the current batch of items.

  • Name
    moreItemsBefore
    Type
    nullable string
    required
    Description

    A unique identifier to be used as before pagination parameter if more items are available sorted before the current batch of items.

Request

GET
/projects/{project}/subscriptionAddons
curl https://api.gigs.com/projects/{project}/subscriptionAddons \
-X GET \
-H "Content-type: application/json" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json"

Response

{
  "object": "list",
  "items": [
    {
      "object": "subscriptionAddon",
      "id": "sad_0SNlurA049MEWV2UNWPbDfW5B40U",
      "addon": {
        "object": "addon",
        "id": "add_0SNlurA049MEWV4VxLfwJc7PJtHc",
        "allowances": {
          "dataBytes": 10000000000,
          "voiceSeconds": 30000,
          "smsMessages": 100
        },
        "data": 10000000000,
        "dataUnit": "byte",
        "description": "Disable international roaming.",
        "name": "1GB Data Top-up",
        "price": {
          "amount": 999,
          "currency": "USD"
        },
        "provider": "p5",
        "recurrenceType": "oneTime",
        "sms": 100,
        "smsUnit": "message",
        "status": "draft",
        "type": "topUp",
        "validity": {
          "unit": "day",
          "value": 7
        },
        "voice": 30000,
        "voiceUnit": "second",
        "createdAt": "2021-01-21T19:12:28Z"
      },
      "currentPeriod": {
        "number": 1,
        "start": "2021-01-21T19:32:13Z",
        "end": "2021-02-20T19:38:34Z"
      },
      "status": "pending",
      "subscription": "sub_0SNlurA049MEWV2gSfSxi00xlPIi",
      "user": "usr_0SNlurA049MEWV4OpCwsNyC9Kn2d",
      "activatedAt": "2021-01-15T12:36:57Z",
      "canceledAt": "2021-01-22T19:39:53Z",
      "createdAt": "2021-01-15T12:30:28Z",
      "endedAt": "2021-01-30T23:12:28Z"
    }
  ],
  "moreItemsAfter": null,
  "moreItemsBefore": null
}

POST/projects/{project}/subscriptionAddons

Create a subscription add-on

Creates a new subscription add-on for an existing subscription in the specified project.

Body

  • Name
    addon
    Type
    string
    required
    Description

    Unique identifier of the add-on.

    Example: add_0SNlurA049MEWV4VxLfwJc7PJtHc
  • Name
    subscription
    Type
    string
    required
    Description

    Unique identifier of the subscription the add-on applies too.

    Example: sub_0SNlurA049MEWV2gSfSxi00xlPIi

Path Parameters

  • Name
    project
    Type
    string
    required
    Description

    The unique identifier for the project.

    Example: gigs

Response Schemas

  • Name
    object
    Type
    string
    required
    Description

    Type of object is always subscriptionAddon.

  • Name
    id
    Type
    string
    required
    Description

    Unique identifier for the subscription add-on.

    Example: sad_0SNlurA049MEWV2UNWPbDfW5B40U
  • Name
    addon
    Type
    object
    PREVIEW
    required
    Description
    • Name
      object
      Type
      string
      required
      Description

      Type of object is always addon.

    • Name
      id
      Type
      string
      required
      Description

      Unique identifier for the add-on.

      Example: add_0SNlurA049MEWV4VxLfwJc7PJtHc
    • Name
      allowances
      Type
      object
      required
      Description
      The allowances included in the add-on.
    • Name
      data
      Type
      integer
      DEPRECATED
      required
      Description

      The data allowance in bytes included in this add-on. A value of -1 indicates unlimited data.

      Example: 10000000000
    • Name
      dataUnit
      Type
      string
      DEPRECATED
      required
      Description

      The unit of the data value is always byte.

    • Name
      description
      Type
      nullable string
      required
      Description

      The description of the add-on.

      Example: Disable international roaming.
    • Name
      name
      Type
      string
      required
      Description

      Name for the add-on.

      Example: 1GB Data Top-up
    • Name
      price
      Type
      object
      required
      Description
      The price of the add-on.
    • Name
      provider
      Type
      string
      required
      Description

      The ID of the network provider supported by this add-on.

      Example: p5
    • Name
      recurrenceType
      Type
      string
      required
      Description

      The recurrence type the add-on.

      Example: oneTime
      Allowed values: oneTime, recurring
    • Name
      sms
      Type
      integer
      DEPRECATED
      required
      Description

      The sms allowance included in this add-on. A value of -1 indicates unlimited sms.

      Example: 100
    • Name
      smsUnit
      Type
      string
      DEPRECATED
      required
      Description

      The unit of the sms value is always sms.

    • Name
      status
      Type
      string
      required
      Description

      The current status of the add-on.

      Allowed values: draft, available, archived
    • Name
      type
      Type
      string
      required
      Description

      The type of the add-on.

      Example: topUp
      Allowed values: topUp, other
    • Name
      validity
      Type
      nullable object
      required
      Description
      The optional validity of the add-on. Add-ons without a set validity will inherit the validity of the subscribed plan.
    • Name
      voice
      Type
      integer
      DEPRECATED
      required
      Description

      The voice call allowance in seconds included in this add-on. A value of -1 indicates unlimited voice calls.

      Example: 30000
    • Name
      voiceUnit
      Type
      string
      DEPRECATED
      required
      Description

      The unit of the voice value is always second.

    • Name
      createdAt
      Type
      string
      required
      Description

      Time when the add-on was created .

      Example: 2021-01-21T19:12:28Z
  • Name
    currentPeriod
    Type
    nullable object
    required
    Description
    Current subscription add-on period. Only present for active subscription add-ons.
    • Name
      number
      Type
      integer
      required
      Description

      Sequence number of the period.

      Example: 1
      >= 1
    • Name
      start
      Type
      string
      required
      Description

      Beginning of the period.

      Example: 2021-01-21T19:32:13Z
    • Name
      end
      Type
      string
      required
      Description

      End of the period.

      Example: 2021-02-20T19:38:34Z
  • Name
    status
    Type
    string
    required
    Description

    The current status of the subscription add-on.

    Allowed values: pending, active, ended
  • Name
    subscription
    Type
    string
    required
    Description

    Unique identifier of the subscription the add-on applies to.

    Example: sub_0SNlurA049MEWV2gSfSxi00xlPIi
  • Name
    user
    Type
    string
    required
    Description

    Unique identifier of the user the subscription add-on belongs to.

    Example: usr_0SNlurA049MEWV4OpCwsNyC9Kn2d
  • Name
    activatedAt
    Type
    nullable string
    required
    Description

    Time when the subscription add-on was activated.

    Example: 2021-01-15T12:36:57Z
  • Name
    canceledAt
    Type
    nullable string
    required
    Description

    Time when the subscription add-on was canceled.

    Example: 2021-01-22T19:39:53Z
  • Name
    createdAt
    Type
    string
    required
    Description

    Time when the subscription add-on was created.

    Example: 2021-01-15T12:30:28Z
  • Name
    endedAt
    Type
    string
    required
    Description

    Time when the subscription add-on was ended.

    Example: 2021-01-30T23:12:28Z

Request

POST
/projects/{project}/subscriptionAddons
curl https://api.gigs.com/projects/{project}/subscriptionAddons \
-X POST \
-H "Content-type: application/json" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json" \
-d "{\"addon\":\"add_0SNlurA049MEWV4VxLfwJc7PJtHc\",\"subscription\":\"sub_0SNlurA049MEWV2gSfSxi00xlPIi\"}"

Response

{
  "object": "subscriptionAddon",
  "id": "sad_0SNlurA049MEWV2UNWPbDfW5B40U",
  "addon": {
    "object": "addon",
    "id": "add_0SNlurA049MEWV4VxLfwJc7PJtHc",
    "allowances": {
      "dataBytes": 10000000000,
      "voiceSeconds": 30000,
      "smsMessages": 100
    },
    "data": 10000000000,
    "dataUnit": "byte",
    "description": "Disable international roaming.",
    "name": "1GB Data Top-up",
    "price": {
      "amount": 999,
      "currency": "USD"
    },
    "provider": "p5",
    "recurrenceType": "oneTime",
    "sms": 100,
    "smsUnit": "message",
    "status": "draft",
    "type": "topUp",
    "validity": {
      "unit": "day",
      "value": 7
    },
    "voice": 30000,
    "voiceUnit": "second",
    "createdAt": "2021-01-21T19:12:28Z"
  },
  "currentPeriod": {
    "number": 1,
    "start": "2021-01-21T19:32:13Z",
    "end": "2021-02-20T19:38:34Z"
  },
  "status": "pending",
  "subscription": "sub_0SNlurA049MEWV2gSfSxi00xlPIi",
  "user": "usr_0SNlurA049MEWV4OpCwsNyC9Kn2d",
  "activatedAt": "2021-01-15T12:36:57Z",
  "canceledAt": "2021-01-22T19:39:53Z",
  "createdAt": "2021-01-15T12:30:28Z",
  "endedAt": "2021-01-30T23:12:28Z"
}