Subscription Changes
Any change to a user’s subscription, such as swapping a SIM, or upgrading or downgrading a subscription.
Properties
- Name
- object
- Type
- string
- Description
Type of object is always
subscriptionChange.Allowed values:subscriptionChange
- Name
- id
- Type
- string
- Description
Unique identifier for the subscription change.
Example:"sch_0SNlurA049MEWV3bE0SMtbIEJApp"
- Name
- appliedAt
- Type
- nullable string
- Description
Time when the subscription change was applied.
Example:"2021-01-21T19:36:57Z"
- Name
- createdAt
- Type
- string
- Description
Time when the subscription change was created.
Example:"2021-01-21T19:12:28Z"
- Name
- failureCode
- Type
- nullable string
- Description
An error code indicating the reason for a failed subscription change.
Example:"consentNotGiven"
- Name
- plan
- Type
- nullable Plan
- Description
- The plan to which the subscription should be changed.
- Name
- requestedChange
- Type
- object
- Description
- Object with the requested changes.
- Name
- scheduledAt
- Type
- nullable string
- Description
Approximate time when the change should take place. This is typically set for changes scheduled at renewal. For changes that take effect immediately (when
requestedChange.whenis"now"), this may be null.Example:"2021-01-21T19:12:28Z"
- Name
- sim
- Type
- nullable Sim
- Description
- The SIM to which the subscription should be changed.
- Name
- status
- Type
- string
- Description
The current status of the subscription change. Note that the
initiatedstatus is currently only available when using the Billing API, where it implies that the subscription change invoice has not yet been paid.Allowed values:pendinginitiatedappliedfaileddeleted
- Name
- subscription
- Type
- nullable string
- Description
Unique identifier of the subscription to be changed.
Example:"sub_0SNlurA049MEWV2gSfSxi00xlPIi"
SubscriptionChange object
{
"object": "subscriptionChange",
"id": "sch_0SNlurA049MEWV3bE0SMtbIEJApp",
"appliedAt": "2021-01-21T19:36:57Z",
"createdAt": "2021-01-21T19:12:28.0Z",
"failureCode": "consentNotGiven",
"plan": {
"object": "plan",
"id": "pln_0SNlurA049MEWV3V0q7gjQbM4EVo",
"metadata": {},
"activationTrigger": "creation",
"allowances": {
"dataBytes": 10000000000,
"voiceSeconds": 30000,
"smsMessages": 100
},
"coverage": {
"object": "coverage",
"id": "de",
"countries": {
"0": "DE",
"1": "FR",
"2": "US"
},
"name": "Europe"
},
"createdAt": "2021-01-21T19:38:34.0Z",
"description": "A data plan you will love! Operates in most countries of the world.",
"firstPeriodTrigger": "creation",
"image": "https://i.gigscdn.com/pr/nTZpgaEj5dTQ2Jo/original.png",
"limits": {
"dataBytes": 100000000000,
"bandwidthBitsPerSecond": 100000000,
"throttling": {
"thresholdBytes": 10000000000,
"bandwidthBitsPerSecond": 512000
}
},
"name": "Gigs Global",
"price": {
"amount": 999,
"currency": "USD"
},
"provider": "p5",
"requirements": {
"address": "present",
"device": "none",
"user.birthday": "none",
"user.fullName": "present"
},
"simTypes": {
"0": "eSIM",
"1": "pSIM"
},
"status": "available",
"validity": {
"minimumPeriods": 12,
"type": "recurring",
"unit": "day",
"value": 7
},
"data": 10000000000,
"dataUnit": "byte",
"sms": 100,
"smsUnit": "message",
"voice": 30000,
"voiceUnit": "second"
},
"requestedChange": {
"plan": "pln_0SNlurA049MEWV3V0q7gjQbM4EVo",
"sim": "sim_0SNlurA049MEWV1BAAmWZULA4lf6",
"phoneNumber": "auto",
"when": "renewal"
},
"scheduledAt": "2021-01-21T19:12:28Z",
"sim": {
"object": "sim",
"id": "sim_0SNlurA049MEWV1BAAmWZULA4lf6",
"metadata": {},
"createdAt": "2021-01-21T19:38:34.0Z",
"iccid": "89883070000007537119",
"provider": "p9",
"status": "inactive",
"suspension": null,
"type": "eSIM"
},
"status": "pending",
"subscription": "sub_0SNlurA049MEWV2gSfSxi00xlPIi"
}
List all subscription changes
Returns a list of subscription changes. The subscription changes returned are sorted by creation date, with the most recently created subscription changes appearing first.
Path Parameters
Query Parameters
- Name
- status
- Type
- array
- Description
A comma-separated list of statuses to filter the subscription changes by.
Default:pending,initiated
- 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
afterparameter 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
beforeparameter 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.
Example:20Default:10>= 0<= 200
Responses
Returns a dictionary with an items property that contains an array of subscription changes.
- Name
- object
- Type
- string
- Description
Type of object is always
list.Allowed values:list
- Name
- items
- Type
- array
- Description
- List of objects of type
subscriptionChange.
- Name
- moreItemsAfter
- Type
- nullable string
- Description
A unique identifier to be used as
afterpagination parameter if more items are available sorted after the current batch of items.
- Name
- moreItemsBefore
- Type
- nullable string
- Description
A unique identifier to be used as
beforepagination parameter if more items are available sorted before the current batch of items.
Request
curl https://api.gigs.com/projects/${GIGS_PROJECT}/subscriptionChanges \
-X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${GIGS_TOKEN}" \
-H "Accept: application/json"
Responses 200
{
"object": "list",
"items": [
{
"object": "subscriptionChange",
"id": "sch_0SNlurA049MEWV3bE0SMtbIEJApp",
"appliedAt": "2021-01-21T19:36:57Z",
"createdAt": "2021-01-21T19:12:28Z",
"failureCode": "consentNotGiven",
"plan": {
"object": "plan",
"id": "pln_0SNlurA049MEWV3V0q7gjQbM4EVo",
"metadata": {},
"activationTrigger": "creation",
"allowances": {
"dataBytes": 10000000000,
"voiceSeconds": 30000,
"smsMessages": 100
},
"coverage": {
"object": "coverage",
"id": "de",
"countries": [
"DE",
"FR",
"US"
],
"name": "Europe"
},
"createdAt": "2021-01-21T19:38:34Z",
"description": "A data plan you will love! Operates in most countries of the world.",
"firstPeriodTrigger": "creation",
"image": "https://i.gigscdn.com/pr/nTZpgaEj5dTQ2Jo/original.png",
"limits": {
"dataBytes": 100000000000,
"bandwidthBitsPerSecond": 100000000,
"throttling": {
"thresholdBytes": 10000000000,
"bandwidthBitsPerSecond": 512000
}
},
"name": "Gigs Global",
"price": {
"amount": 999,
"currency": "USD"
},
"provider": "p5",
"requirements": {
"address": "present",
"device": "none",
"user.birthday": "none",
"user.fullName": "present"
},
"simTypes": [
"eSIM",
"pSIM"
],
"status": "available",
"validity": {
"minimumPeriods": 12,
"type": "recurring",
"unit": "day",
"value": 7
},
"data": 10000000000,
"dataUnit": "byte",
"sms": 100,
"smsUnit": "message",
"voice": 30000,
"voiceUnit": "second"
},
"requestedChange": {
"plan": "pln_0SNlurA049MEWV3V0q7gjQbM4EVo",
"sim": "sim_0SNlurA049MEWV1BAAmWZULA4lf6",
"phoneNumber": "auto",
"when": "renewal"
},
"scheduledAt": "2021-01-21T19:12:28Z",
"sim": {
"object": "sim",
"id": "sim_0SNlurA049MEWV1BAAmWZULA4lf6",
"metadata": {},
"createdAt": "2021-01-21T19:38:34Z",
"iccid": "89883070000007537119",
"provider": "p9",
"status": "inactive",
"suspension": null,
"type": "eSIM"
},
"status": "pending",
"subscription": "sub_0SNlurA049MEWV2gSfSxi00xlPIi"
}
],
"moreItemsAfter": null,
"moreItemsBefore": null
}
Create a subscription change
Creates a new subscription change for an existing subscription in the specified project.
Note that plan changes cannot be created within the cutoff period of 1 hour before the subscription period ends. In the UK, this cutoff period is extended to 13 hours but only for changes scheduled at renewal.
Immediate plan changes
A plan change with when set to "now" and no SIM change also has to follow these rules. A plan change that breaks one of them, such as a move to a cheaper plan, can usually be scheduled for "renewal" instead.
- A plan change can only be immediate when the new plan has the same or more data, voice and SMS allowances. Unlimited counts as more than any amount.
- A plan change can only be immediate when the new plan is in the same currency as the subscription's current price.
- A plan change can only be immediate when the network provider supports it.
- A plan change can't be immediate on projects using the Payments API.
- A plan change can only be immediate when the new plan costs the same or more than the subscription's current price.
- On projects using the Billing API, a plan change can't be immediate once the invoice for the next renewal exists.
- A plan change can only be immediate when the new plan has the same validity duration as the current plan.
Body
- Name
- plan
- Type
- nullable string
- Description
Unique identifier of the target plan, to which the subscription should be changed.
Example:"pln_0SNlurA049MEWV3V0q7gjQbM4EVo"
- Name
- sim
- Type
- nullable string
- Description
Unique identifier of the target SIM, to which the subscription should be changed. Can also be set to "auto", in which case an eSIM will be automatically allocated.
Example:"sim_0SNlurA049MEWV1BAAmWZULA4lf6"
- Name
- phoneNumber
- Type
- nullable string
- Description
Requests a change of the subscription's phone number. Only "auto" is supported: the network provider assigns a new random number. Mutually exclusive with
planandsim, and only valid withwhenset to "now". Changing the phone number is only available for a subset of network providers.Example:"auto"
- Name
- subscription
- Type
- string
- Description
Unique identifier of the subscription to be changed.
Example:"sub_0SNlurA049MEWV2gSfSxi00xlPIi"
required- Name
- when
- Type
- string
- Description
When the change should take effect. If set to
"now", the change will take effect immediately. If set to"renewal", the change will instead take effect at the next subscription renewal date. SIM changes can only happen"now". Which plan changes can happen"now"is listed on Create a subscription change.Example:"renewal"Default:renewalAllowed values:nowrenewal
Path Parameters
Responses
Returns the newly created subscription change.
- Name
- object
- Type
- string
- Description
Type of object is always
subscriptionChange.Allowed values:subscriptionChange
- Name
- id
- Type
- string
- Description
Unique identifier for the subscription change.
Example:"sch_0SNlurA049MEWV3bE0SMtbIEJApp"
- Name
- appliedAt
- Type
- nullable string
- Description
Time when the subscription change was applied.
Example:"2021-01-21T19:36:57Z"
- Name
- createdAt
- Type
- string
- Description
Time when the subscription change was created.
Example:"2021-01-21T19:12:28Z"
- Name
- failureCode
- Type
- nullable string
- Description
An error code indicating the reason for a failed subscription change.
Example:"consentNotGiven"
- Name
- plan
- Type
- nullable Plan
- Description
- The plan to which the subscription should be changed.
- Name
- requestedChange
- Type
- object
- Description
- Object with the requested changes.
- Name
- scheduledAt
- Type
- nullable string
- Description
Approximate time when the change should take place. This is typically set for changes scheduled at renewal. For changes that take effect immediately (when
requestedChange.whenis"now"), this may be null.Example:"2021-01-21T19:12:28Z"
- Name
- sim
- Type
- nullable Sim
- Description
- The SIM to which the subscription should be changed.
- Name
- status
- Type
- string
- Description
The current status of the subscription change. Note that the
initiatedstatus is currently only available when using the Billing API, where it implies that the subscription change invoice has not yet been paid.Allowed values:pendinginitiatedappliedfaileddeleted
- Name
- subscription
- Type
- nullable string
- Description
Unique identifier of the subscription to be changed.
Example:"sub_0SNlurA049MEWV2gSfSxi00xlPIi"
Request
curl https://api.gigs.com/projects/${GIGS_PROJECT}/subscriptionChanges \
-X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${GIGS_TOKEN}" \
-H "Accept: application/json" \
-d '{
"plan": "pln_0SNlurA049MEWV3V0q7gjQbM4EVo",
"subscription": "sub_0SNlurA049MEWV2gSfSxi00xlPIi",
"when": "renewal"
}'
Responses 201
{
"object": "subscriptionChange",
"id": "sch_0SNlurA049MEWV3bE0SMtbIEJApp",
"appliedAt": null,
"createdAt": "2021-01-21T19:12:28Z",
"failureCode": null,
"plan": {
"object": "plan",
"id": "pln_0SNlurA049MEWV3V0q7gjQbM4EVo",
"metadata": {},
"activationTrigger": "creation",
"allowances": {
"dataBytes": 10000000000,
"voiceSeconds": 30000,
"smsMessages": 100
},
"coverage": {
"object": "coverage",
"id": "de",
"countries": [
"DE",
"FR",
"US"
],
"name": "Europe"
},
"createdAt": "2021-01-21T19:38:34Z",
"description": "A data plan you will love! Operates in most countries of the world.",
"firstPeriodTrigger": "creation",
"image": "https://i.gigscdn.com/pr/nTZpgaEj5dTQ2Jo/original.png",
"limits": {
"dataBytes": 100000000000,
"bandwidthBitsPerSecond": 100000000,
"throttling": {
"thresholdBytes": 10000000000,
"bandwidthBitsPerSecond": 512000
}
},
"name": "Gigs Global",
"price": {
"amount": 999,
"currency": "USD"
},
"provider": "p5",
"requirements": {
"address": "present",
"device": "none",
"user.birthday": "none",
"user.fullName": "present"
},
"simTypes": [
"eSIM",
"pSIM"
],
"status": "available",
"validity": {
"minimumPeriods": 12,
"type": "recurring",
"unit": "day",
"value": 7
},
"data": 10000000000,
"dataUnit": "byte",
"sms": 100,
"smsUnit": "message",
"voice": 30000,
"voiceUnit": "second"
},
"requestedChange": {
"plan": "pln_0SNlurA049MEWV3V0q7gjQbM4EVo",
"sim": null,
"phoneNumber": null,
"when": "renewal"
},
"scheduledAt": "2021-01-21T19:12:28Z",
"sim": null,
"status": "pending",
"subscription": "sub_0SNlurA049MEWV2gSfSxi00xlPIi"
}
Retrieve a subscription change
Retrieve the details of an existing subscription change which the authenticated user is authorized to view.
Path Parameters
- Name
- subscriptionChange
- Type
- string
- Description
The unique identifier for the subscription change.
Example:"sch_0SNlurA049MEWV3bE0SMtbIEJApp"
required
Responses
Returns the subscription change if it exists.
- Name
- object
- Type
- string
- Description
Type of object is always
subscriptionChange.Allowed values:subscriptionChange
- Name
- id
- Type
- string
- Description
Unique identifier for the subscription change.
Example:"sch_0SNlurA049MEWV3bE0SMtbIEJApp"
- Name
- appliedAt
- Type
- nullable string
- Description
Time when the subscription change was applied.
Example:"2021-01-21T19:36:57Z"
- Name
- createdAt
- Type
- string
- Description
Time when the subscription change was created.
Example:"2021-01-21T19:12:28Z"
- Name
- failureCode
- Type
- nullable string
- Description
An error code indicating the reason for a failed subscription change.
Example:"consentNotGiven"
- Name
- plan
- Type
- nullable Plan
- Description
- The plan to which the subscription should be changed.
- Name
- requestedChange
- Type
- object
- Description
- Object with the requested changes.
- Name
- scheduledAt
- Type
- nullable string
- Description
Approximate time when the change should take place. This is typically set for changes scheduled at renewal. For changes that take effect immediately (when
requestedChange.whenis"now"), this may be null.Example:"2021-01-21T19:12:28Z"
- Name
- sim
- Type
- nullable Sim
- Description
- The SIM to which the subscription should be changed.
- Name
- status
- Type
- string
- Description
The current status of the subscription change. Note that the
initiatedstatus is currently only available when using the Billing API, where it implies that the subscription change invoice has not yet been paid.Allowed values:pendinginitiatedappliedfaileddeleted
- Name
- subscription
- Type
- nullable string
- Description
Unique identifier of the subscription to be changed.
Example:"sub_0SNlurA049MEWV2gSfSxi00xlPIi"
Request
curl https://api.gigs.com/projects/${GIGS_PROJECT}/subscriptionChanges/{subscriptionChange} \
-X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${GIGS_TOKEN}" \
-H "Accept: application/json"
Responses 200
{
"object": "subscriptionChange",
"id": "sch_0SNlurA049MEWV3bE0SMtbIEJApp",
"appliedAt": "2021-01-21T19:36:57Z",
"createdAt": "2021-01-21T19:12:28Z",
"failureCode": "consentNotGiven",
"plan": {
"object": "plan",
"id": "pln_0SNlurA049MEWV3V0q7gjQbM4EVo",
"metadata": {},
"activationTrigger": "creation",
"allowances": {
"dataBytes": 10000000000,
"voiceSeconds": 30000,
"smsMessages": 100
},
"coverage": {
"object": "coverage",
"id": "de",
"countries": [
"DE",
"FR",
"US"
],
"name": "Europe"
},
"createdAt": "2021-01-21T19:38:34Z",
"description": "A data plan you will love! Operates in most countries of the world.",
"firstPeriodTrigger": "creation",
"image": "https://i.gigscdn.com/pr/nTZpgaEj5dTQ2Jo/original.png",
"limits": {
"dataBytes": 100000000000,
"bandwidthBitsPerSecond": 100000000,
"throttling": {
"thresholdBytes": 10000000000,
"bandwidthBitsPerSecond": 512000
}
},
"name": "Gigs Global",
"price": {
"amount": 999,
"currency": "USD"
},
"provider": "p5",
"requirements": {
"address": "present",
"device": "none",
"user.birthday": "none",
"user.fullName": "present"
},
"simTypes": [
"eSIM",
"pSIM"
],
"status": "available",
"validity": {
"minimumPeriods": 12,
"type": "recurring",
"unit": "day",
"value": 7
},
"data": 10000000000,
"dataUnit": "byte",
"sms": 100,
"smsUnit": "message",
"voice": 30000,
"voiceUnit": "second"
},
"requestedChange": {
"plan": "pln_0SNlurA049MEWV3V0q7gjQbM4EVo",
"sim": "sim_0SNlurA049MEWV1BAAmWZULA4lf6",
"phoneNumber": "auto",
"when": "renewal"
},
"scheduledAt": "2021-01-21T19:12:28Z",
"sim": {
"object": "sim",
"id": "sim_0SNlurA049MEWV1BAAmWZULA4lf6",
"metadata": {},
"createdAt": "2021-01-21T19:38:34Z",
"iccid": "89883070000007537119",
"provider": "p9",
"status": "inactive",
"suspension": null,
"type": "eSIM"
},
"status": "pending",
"subscription": "sub_0SNlurA049MEWV2gSfSxi00xlPIi"
}
Delete a subscription change
Retrieve the details of an existing subscription change and delete it. Only subscription changes that have not been applied can be deleted.
Path Parameters
- Name
- subscriptionChange
- Type
- string
- Description
The unique identifier for the subscription change.
Example:"sch_0SNlurA049MEWV3bE0SMtbIEJApp"
required
Responses
Returns the subscription change after a successful deletion.
- Name
- object
- Type
- string
- Description
Type of object is always
subscriptionChange.Allowed values:subscriptionChange
- Name
- id
- Type
- string
- Description
Unique identifier for the subscription change.
Example:"sch_0SNlurA049MEWV3bE0SMtbIEJApp"
- Name
- appliedAt
- Type
- nullable string
- Description
Time when the subscription change was applied.
Example:"2021-01-21T19:36:57Z"
- Name
- createdAt
- Type
- string
- Description
Time when the subscription change was created.
Example:"2021-01-21T19:12:28Z"
- Name
- failureCode
- Type
- nullable string
- Description
An error code indicating the reason for a failed subscription change.
Example:"consentNotGiven"
- Name
- plan
- Type
- nullable Plan
- Description
- The plan to which the subscription should be changed.
- Name
- requestedChange
- Type
- object
- Description
- Object with the requested changes.
- Name
- scheduledAt
- Type
- nullable string
- Description
Approximate time when the change should take place. This is typically set for changes scheduled at renewal. For changes that take effect immediately (when
requestedChange.whenis"now"), this may be null.Example:"2021-01-21T19:12:28Z"
- Name
- sim
- Type
- nullable Sim
- Description
- The SIM to which the subscription should be changed.
- Name
- status
- Type
- string
- Description
The current status of the subscription change. Note that the
initiatedstatus is currently only available when using the Billing API, where it implies that the subscription change invoice has not yet been paid.Allowed values:pendinginitiatedappliedfaileddeleted
- Name
- subscription
- Type
- nullable string
- Description
Unique identifier of the subscription to be changed.
Example:"sub_0SNlurA049MEWV2gSfSxi00xlPIi"
Request
curl https://api.gigs.com/projects/${GIGS_PROJECT}/subscriptionChanges/{subscriptionChange} \
-X DELETE \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${GIGS_TOKEN}" \
-H "Accept: application/json"
Responses 200
{
"object": "subscriptionChange",
"id": "sch_0SNlurA049MEWV3bE0SMtbIEJApp",
"appliedAt": "2021-01-21T19:36:57Z",
"createdAt": "2021-01-21T19:12:28Z",
"failureCode": "consentNotGiven",
"plan": {
"object": "plan",
"id": "pln_0SNlurA049MEWV3V0q7gjQbM4EVo",
"metadata": {},
"activationTrigger": "creation",
"allowances": {
"dataBytes": 10000000000,
"voiceSeconds": 30000,
"smsMessages": 100
},
"coverage": {
"object": "coverage",
"id": "de",
"countries": [
"DE",
"FR",
"US"
],
"name": "Europe"
},
"createdAt": "2021-01-21T19:38:34Z",
"description": "A data plan you will love! Operates in most countries of the world.",
"firstPeriodTrigger": "creation",
"image": "https://i.gigscdn.com/pr/nTZpgaEj5dTQ2Jo/original.png",
"limits": {
"dataBytes": 100000000000,
"bandwidthBitsPerSecond": 100000000,
"throttling": {
"thresholdBytes": 10000000000,
"bandwidthBitsPerSecond": 512000
}
},
"name": "Gigs Global",
"price": {
"amount": 999,
"currency": "USD"
},
"provider": "p5",
"requirements": {
"address": "present",
"device": "none",
"user.birthday": "none",
"user.fullName": "present"
},
"simTypes": [
"eSIM",
"pSIM"
],
"status": "available",
"validity": {
"minimumPeriods": 12,
"type": "recurring",
"unit": "day",
"value": 7
},
"data": 10000000000,
"dataUnit": "byte",
"sms": 100,
"smsUnit": "message",
"voice": 30000,
"voiceUnit": "second"
},
"requestedChange": {
"plan": "pln_0SNlurA049MEWV3V0q7gjQbM4EVo",
"sim": "sim_0SNlurA049MEWV1BAAmWZULA4lf6",
"phoneNumber": "auto",
"when": "renewal"
},
"scheduledAt": "2021-01-21T19:12:28Z",
"sim": {
"object": "sim",
"id": "sim_0SNlurA049MEWV1BAAmWZULA4lf6",
"metadata": {},
"createdAt": "2021-01-21T19:38:34Z",
"iccid": "89883070000007537119",
"provider": "p9",
"status": "inactive",
"suspension": null,
"type": "eSIM"
},
"status": "pending",
"subscription": "sub_0SNlurA049MEWV2gSfSxi00xlPIi"
}