Properties
- Name
object
- Type
- string
- Description
Type of object is always
subscriptionAddon
.Allowed values:subscriptionAddon
- Name
id
- Type
- string
- Description
Unique identifier for the subscription add-on.
Example:"sad_0SNlurA049MEWV2UNWPbDfW5B40U"
- Name
activatedAt
- Type
- nullable string
- Description
Time when the subscription add-on was activated.
Example:"2021-01-15T12:36:57Z"
- Name
addon
- Type
- object
- Description
- The add-on associated to the subscription add-on.
- 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
currentPeriod
- Type
- nullable object
- Description
- Current subscription add-on period. Only present for active subscription add-ons.
- Name
number
- Type
- integer
- Description
Sequence number of the period.
Example:1
>= 1
required- Name
start
- Type
- string
- Description
Beginning of the period.
Example:"2021-01-21T19:32:13Z"
required- Name
end
- Type
- string
- Description
End of the period.
Example:"2021-02-20T19:38:34Z"
required
- Name
endedAt
- Type
- string
- Description
Time when the subscription add-on was ended.
Example:"2021-01-30T23:12:28Z"
- Name
status
- Type
- string
- Description
The current status of the subscription add-on.
Allowed values:pending, initiated, 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"
Response
{
"object": "subscriptionAddon",
"id": "sad_0SNlurA049MEWV2UNWPbDfW5B40U",
"activatedAt": "2021-01-15T12:36:57Z",
"addon": {
"object": "addon",
"id": "add_0SNlurA049MEWV4VxLfwJc7PJtHc",
"allowances": {
"dataBytes": 10000000000,
"voiceSeconds": 30000,
"smsMessages": 100
},
"createdAt": "2021-01-21T19:12:28Z",
"description": "Disable international roaming.",
"name": "1GB Data Top-up",
"price": {
"amount": 999,
"currency": "USD"
},
"provider": "p5",
"recurrenceType": "oneTime",
"status": "draft",
"type": "topUp",
"validity": {
"unit": "day",
"value": 7
},
"data": 10000000000,
"dataUnit": "byte",
"sms": 100,
"smsUnit": "message",
"voice": 30000,
"voiceUnit": "second"
},
"canceledAt": "2021-01-22T19:39:53Z",
"createdAt": "2021-01-15T12:30:28Z",
"currentPeriod": {
"number": 1,
"start": "2021-01-21T19:32:13Z",
"end": "2021-02-20T19:38:34Z"
},
"endedAt": "2021-01-30T23:12:28Z",
"status": "pending",
"subscription": "sub_0SNlurA049MEWV2gSfSxi00xlPIi",
"user": "usr_0SNlurA049MEWV4OpCwsNyC9Kn2d"
}
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
- Description
The unique identifier for the project.
Example:"gigs"
required- Name
subscriptionAddon
- Type
- string
- Description
The unique identifier for the subscription add-on.
Example:"sad_0SNlurA049MEWV2UNWPbDfW5B40U"
required
Response Schemas
Returns the subscription add-on if it exists.
- Name
object
- Type
- string
- Description
Type of object is always
subscriptionAddon
.Allowed values:subscriptionAddon
required- Name
id
- Type
- string
- Description
Unique identifier for the subscription add-on.
Example:"sad_0SNlurA049MEWV2UNWPbDfW5B40U"
required- Name
activatedAt
- Type
- nullable string
- Description
Time when the subscription add-on was activated.
Example:"2021-01-15T12:36:57Z"
required- Name
addon
- Type
- object
- Description
- The add-on associated to the subscription add-on.
required- Name
canceledAt
- Type
- nullable string
- Description
Time when the subscription add-on was canceled.
Example:"2021-01-22T19:39:53Z"
required- Name
createdAt
- Type
- string
- Description
Time when the subscription add-on was created.
Example:"2021-01-15T12:30:28Z"
required- Name
currentPeriod
- Type
- nullable object
- Description
- Current subscription add-on period. Only present for active subscription add-ons.
- Name
number
- Type
- integer
- Description
Sequence number of the period.
Example:1
>= 1
required- Name
start
- Type
- string
- Description
Beginning of the period.
Example:"2021-01-21T19:32:13Z"
required- Name
end
- Type
- string
- Description
End of the period.
Example:"2021-02-20T19:38:34Z"
required
required- Name
endedAt
- Type
- string
- Description
Time when the subscription add-on was ended.
Example:"2021-01-30T23:12:28Z"
required- Name
status
- Type
- string
- Description
The current status of the subscription add-on.
Allowed values:pending, initiated, active, ended
required- Name
subscription
- Type
- string
- Description
Unique identifier of the subscription the add-on applies to.
Example:"sub_0SNlurA049MEWV2gSfSxi00xlPIi"
required- Name
user
- Type
- string
- Description
Unique identifier of the user the subscription add-on belongs to.
Example:"usr_0SNlurA049MEWV4OpCwsNyC9Kn2d"
required
Request
curl https://api.gigs.com/projects/{project}/subscriptionAddons/{subscriptionAddon} \
-X GET \
-H "Content-type: application/json" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json"
Response
{
"object": "subscriptionAddon",
"id": "sad_0SNlurA049MEWV2UNWPbDfW5B40U",
"activatedAt": "2021-01-15T12:36:57Z",
"addon": {
"object": "addon",
"id": "add_0SNlurA049MEWV4VxLfwJc7PJtHc",
"allowances": {
"dataBytes": 10000000000,
"voiceSeconds": 30000,
"smsMessages": 100
},
"createdAt": "2021-01-21T19:12:28Z",
"description": "Disable international roaming.",
"name": "1GB Data Top-up",
"plans": [
"pln_0SNlurA049MEWV3V0q7gjQbM4EVo"
],
"price": {
"amount": 999,
"currency": "USD"
},
"provider": "p5",
"recurrenceType": "oneTime",
"status": "draft",
"type": "topUp",
"validity": {
"unit": "day",
"value": 7
},
"data": 10000000000,
"dataUnit": "byte",
"sms": 100,
"smsUnit": "message",
"voice": 30000,
"voiceUnit": "second"
},
"canceledAt": "2021-01-22T19:39:53Z",
"createdAt": "2021-01-15T12:30:28Z",
"currentPeriod": {
"number": 1,
"start": "2021-01-21T19:32:13Z",
"end": "2021-02-20T19:38:34Z"
},
"endedAt": "2021-01-30T23:12:28Z",
"status": "pending",
"subscription": "sub_0SNlurA049MEWV2gSfSxi00xlPIi",
"user": "usr_0SNlurA049MEWV4OpCwsNyC9Kn2d"
}
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
- Description
The unique identifier for the project.
Example:"gigs"
required- Name
subscriptionAddon
- Type
- string
- Description
The unique identifier for the subscription add-on.
Example:"sad_0SNlurA049MEWV2UNWPbDfW5B40U"
required
Response Schemas
Returns the ended subscription add-on.
- Name
object
- Type
- string
- Description
Type of object is always
subscriptionAddon
.Allowed values:subscriptionAddon
required- Name
id
- Type
- string
- Description
Unique identifier for the subscription add-on.
Example:"sad_0SNlurA049MEWV2UNWPbDfW5B40U"
required- Name
activatedAt
- Type
- nullable string
- Description
Time when the subscription add-on was activated.
Example:"2021-01-15T12:36:57Z"
required- Name
addon
- Type
- object
- Description
- The add-on associated to the subscription add-on.
required- Name
canceledAt
- Type
- nullable string
- Description
Time when the subscription add-on was canceled.
Example:"2021-01-22T19:39:53Z"
required- Name
createdAt
- Type
- string
- Description
Time when the subscription add-on was created.
Example:"2021-01-15T12:30:28Z"
required- Name
currentPeriod
- Type
- nullable object
- Description
- Current subscription add-on period. Only present for active subscription add-ons.
- Name
number
- Type
- integer
- Description
Sequence number of the period.
Example:1
>= 1
required- Name
start
- Type
- string
- Description
Beginning of the period.
Example:"2021-01-21T19:32:13Z"
required- Name
end
- Type
- string
- Description
End of the period.
Example:"2021-02-20T19:38:34Z"
required
required- Name
endedAt
- Type
- string
- Description
Time when the subscription add-on was ended.
Example:"2021-01-30T23:12:28Z"
required- Name
status
- Type
- string
- Description
The current status of the subscription add-on.
Allowed values:pending, initiated, active, ended
required- Name
subscription
- Type
- string
- Description
Unique identifier of the subscription the add-on applies to.
Example:"sub_0SNlurA049MEWV2gSfSxi00xlPIi"
required- Name
user
- Type
- string
- Description
Unique identifier of the user the subscription add-on belongs to.
Example:"usr_0SNlurA049MEWV4OpCwsNyC9Kn2d"
required
Request
curl https://api.gigs.com/projects/{project}/subscriptionAddons/{subscriptionAddon} \
-X DELETE \
-H "Content-type: application/json" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json"
Response
{
"object": "subscriptionAddon",
"id": "sad_0SNlurA049MEWV2UNWPbDfW5B40U",
"activatedAt": "2021-01-15T12:36:57Z",
"addon": {
"object": "addon",
"id": "add_0SNlurA049MEWV4VxLfwJc7PJtHc",
"allowances": {
"dataBytes": 10000000000,
"voiceSeconds": 30000,
"smsMessages": 100
},
"createdAt": "2021-01-21T19:12:28Z",
"description": "Disable international roaming.",
"name": "1GB Data Top-up",
"plans": [
"pln_0SNlurA049MEWV3V0q7gjQbM4EVo"
],
"price": {
"amount": 999,
"currency": "USD"
},
"provider": "p5",
"recurrenceType": "oneTime",
"status": "draft",
"type": "topUp",
"validity": {
"unit": "day",
"value": 7
},
"data": 10000000000,
"dataUnit": "byte",
"sms": 100,
"smsUnit": "message",
"voice": 30000,
"voiceUnit": "second"
},
"canceledAt": "2021-01-22T19:39:53Z",
"createdAt": "2021-01-15T12:30:28Z",
"currentPeriod": {
"number": 1,
"start": "2021-01-21T19:32:13Z",
"end": "2021-02-20T19:38:34Z"
},
"endedAt": "2021-01-30T23:12:28Z",
"status": "pending",
"subscription": "sub_0SNlurA049MEWV2gSfSxi00xlPIi",
"user": "usr_0SNlurA049MEWV4OpCwsNyC9Kn2d"
}
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
- Description
The unique identifier for the project.
Example:"gigs"
required
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,initiated,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
Returns a dictionary with an items property that contains an array of subscription add-ons.
- Name
object
- Type
- string
- Description
Type of object is always
list
.Allowed values:list
required- Name
items
- Type
- array
- Description
- List of objects of type `subscriptionAddon`.
required- Name
moreItemsAfter
- Type
- nullable string
- Description
A unique identifier to be used as
after
pagination parameter if more items are available sorted after the current batch of items.
required- Name
moreItemsBefore
- Type
- nullable string
- Description
A unique identifier to be used as
before
pagination parameter if more items are available sorted before the current batch of items.
required
Request
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",
"activatedAt": "2021-01-15T12:36:57Z",
"addon": {
"object": "addon",
"id": "add_0SNlurA049MEWV4VxLfwJc7PJtHc",
"allowances": {
"dataBytes": 10000000000,
"voiceSeconds": 30000,
"smsMessages": 100
},
"createdAt": "2021-01-21T19:12:28Z",
"description": "Disable international roaming.",
"name": "1GB Data Top-up",
"plans": [
"pln_0SNlurA049MEWV3V0q7gjQbM4EVo"
],
"price": {
"amount": 999,
"currency": "USD"
},
"provider": "p5",
"recurrenceType": "oneTime",
"status": "draft",
"type": "topUp",
"validity": {
"unit": "day",
"value": 7
},
"data": 10000000000,
"dataUnit": "byte",
"sms": 100,
"smsUnit": "message",
"voice": 30000,
"voiceUnit": "second"
},
"canceledAt": "2021-01-22T19:39:53Z",
"createdAt": "2021-01-15T12:30:28Z",
"currentPeriod": {
"number": 1,
"start": "2021-01-21T19:32:13Z",
"end": "2021-02-20T19:38:34Z"
},
"endedAt": "2021-01-30T23:12:28Z",
"status": "pending",
"subscription": "sub_0SNlurA049MEWV2gSfSxi00xlPIi",
"user": "usr_0SNlurA049MEWV4OpCwsNyC9Kn2d"
}
],
"moreItemsAfter": null,
"moreItemsBefore": null
}
Create a subscription add-on
Creates a new subscription add-on for an existing subscription in the specified project.
Body
- Name
addon
- Type
- string
- Description
Unique identifier of the add-on.
Example:"add_0SNlurA049MEWV4VxLfwJc7PJtHc"
required- Name
subscription
- Type
- string
- Description
Unique identifier of the subscription the add-on applies too.
Example:"sub_0SNlurA049MEWV2gSfSxi00xlPIi"
required
Path Parameters
- Name
project
- Type
- string
- Description
The unique identifier for the project.
Example:"gigs"
required
Response Schemas
Returns the newly created subscription add-on.
- Name
object
- Type
- string
- Description
Type of object is always
subscriptionAddon
.Allowed values:subscriptionAddon
required- Name
id
- Type
- string
- Description
Unique identifier for the subscription add-on.
Example:"sad_0SNlurA049MEWV2UNWPbDfW5B40U"
required- Name
activatedAt
- Type
- nullable string
- Description
Time when the subscription add-on was activated.
Example:"2021-01-15T12:36:57Z"
required- Name
addon
- Type
- object
- Description
- The add-on associated to the subscription add-on.
required- Name
canceledAt
- Type
- nullable string
- Description
Time when the subscription add-on was canceled.
Example:"2021-01-22T19:39:53Z"
required- Name
createdAt
- Type
- string
- Description
Time when the subscription add-on was created.
Example:"2021-01-15T12:30:28Z"
required- Name
currentPeriod
- Type
- nullable object
- Description
- Current subscription add-on period. Only present for active subscription add-ons.
- Name
number
- Type
- integer
- Description
Sequence number of the period.
Example:1
>= 1
required- Name
start
- Type
- string
- Description
Beginning of the period.
Example:"2021-01-21T19:32:13Z"
required- Name
end
- Type
- string
- Description
End of the period.
Example:"2021-02-20T19:38:34Z"
required
required- Name
endedAt
- Type
- string
- Description
Time when the subscription add-on was ended.
Example:"2021-01-30T23:12:28Z"
required- Name
status
- Type
- string
- Description
The current status of the subscription add-on.
Allowed values:pending, initiated, active, ended
required- Name
subscription
- Type
- string
- Description
Unique identifier of the subscription the add-on applies to.
Example:"sub_0SNlurA049MEWV2gSfSxi00xlPIi"
required- Name
user
- Type
- string
- Description
Unique identifier of the user the subscription add-on belongs to.
Example:"usr_0SNlurA049MEWV4OpCwsNyC9Kn2d"
required
Request
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",
"activatedAt": "2021-01-15T12:36:57Z",
"addon": {
"object": "addon",
"id": "add_0SNlurA049MEWV4VxLfwJc7PJtHc",
"allowances": {
"dataBytes": 10000000000,
"voiceSeconds": 30000,
"smsMessages": 100
},
"createdAt": "2021-01-21T19:12:28Z",
"description": "Disable international roaming.",
"name": "1GB Data Top-up",
"plans": [
"pln_0SNlurA049MEWV3V0q7gjQbM4EVo"
],
"price": {
"amount": 999,
"currency": "USD"
},
"provider": "p5",
"recurrenceType": "oneTime",
"status": "draft",
"type": "topUp",
"validity": {
"unit": "day",
"value": 7
},
"data": 10000000000,
"dataUnit": "byte",
"sms": 100,
"smsUnit": "message",
"voice": 30000,
"voiceUnit": "second"
},
"canceledAt": "2021-01-22T19:39:53Z",
"createdAt": "2021-01-15T12:30:28Z",
"currentPeriod": {
"number": 1,
"start": "2021-01-21T19:32:13Z",
"end": "2021-02-20T19:38:34Z"
},
"endedAt": "2021-01-30T23:12:28Z",
"status": "pending",
"subscription": "sub_0SNlurA049MEWV2gSfSxi00xlPIi",
"user": "usr_0SNlurA049MEWV4OpCwsNyC9Kn2d"
}