Soracom Air for Cellular
Expiration Function
In some applications, you may want to end your device's data session or suspend or terminate your subscription at a pre-determined date and time. The Expiration function allows you to set your IoT SIM to perform a one-time action.
Expiry Actions
The following actions are available when setting an Expiry Action for an Air subscriber:
- Do nothing - Allow any existing connections to continue, but block all future connections.
- Delete session - Forcibly end any existing connections and block all future connections.
- Deactivate - Forcibly end any existing connections and change the subscription status to Inactive.
- Suspend - Forcibly end any existing connections and change the subscription status to Suspended.
- Terminate - Forcibly end any existing connections and terminate the subscription.
When setting the Do nothing or Delete session actions, the subscription status will not be changed. Any daily basic fees associated with the existing status will continue. The Expiry Action date and time must be cleared or extended in order for the subscriber to establish new connections.
When setting the Deactivate or Suspend actions, the subscription status will be changed to Inactive or Suspended, respectively, at the specified date / time. Any daily basic fees for each status will apply according to the subscription plan. The subscription status must be changed back to Active and its Expiry Action date / time must be cleared or extended in order for the subscriber to establish new connections.
When setting the Terminate action, the subscription will be permanently terminated at the specified date / time. The subscription cannot be re-activated and no further connections will be possible.
Configuration
Set or Update an Expiry Action
-
Login to the User Console. From the Menu, open the SIM Management screen.
-
From the list of subscribers, click the for the SIM you want to modify.
-
Click the Actions menu, then select Change expiration.
-
Select an Expiry Action and set the expiration date and time.
- Click Change Expiration Date
Remove an Expiry Action
-
Login to the User Console. From the Menu, open the SIM Management screen.
-
From the list of subscribers, click the for the SIM you want to modify.
-
Click the Actions menu, then select Change expiration.
- Select No expiry action, then click Change Expiration Date.
Programmatic Usage
You can also use the Soracom API, Soracom CLI, and Metadata Service to enable or disable expiration.
Soracom API
To access the Soracom API, first use the auth API to obtain an API Key and Token. Refer to the API Reference Guide for instructions on how to use the API Key and Token in API requests.
Then, use the setExpiryTime API to enable expiration on an IoT SIM:
curl -X POST \
> -H 'X-Soracom-API-Key: <MY-API-KEY>' \
> -H 'X-Soracom-Token: <MY-TOKEN>' \
> -H 'Content-Type: application/json' \
> -d '{
> "expiryAction": "deleteSession",
> "expiryTime": 1704067200000
> }' \
> https://g.api.soracom.io/v1/subscribers/<IMSI>/set_expiry_time
To remove expiration from an IoT SIM, use the unsetExpiryTime API:
Soracom CLI
To use the Soracom CLI, you must first configure it to authenticate with your account information, authorization key, or SAM user credentials.
Then, run the following command to enable expiration on an IoT SIM:
soracom subscribers set-expiry-time --imsi <IMSI> --expiry-action "deleteSession" --expiry-time 1704067200000 --coverage-type g
To remove expiration from an IoT SIM, use following command: