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 Air SIM to perform a one-time action.

Expiry Actions

The following actions are available when setting an Expiry Action for an Air subscriber:

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

  1. Login to the User Console. From the Menu, open the SIM Management screen.

  2. From the list of subscribers, click the for the SIM you want to modify.

  3. Click the Actions menu, then select Change expiry.

    https://console.soracom.io

    Change expiry

  4. Select an Expiry Action and set the expiration date and time.

    Expiry Action

  5. Click Change Expiration Date

Remove an Expiry Action

  1. Login to the User Console. From the Menu, open the SIM Management screen.

  2. From the list of subscribers, click the for the SIM you want to modify.

  3. Click the Actions menu, then select Change expiry.

  4. 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 Air 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 Air SIM, use the unsetExpiryTime API:

curl -X POST \
>  -H 'X-Soracom-API-Key: <MY-API-KEY>' \
>  -H 'X-Soracom-Token: <MY-TOKEN>' \
>  https://g.api.soracom.io/v1/subscribers/<IMSI>/unset_expiry_time

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 Air SIM:

soracom subscribers set-expiry-time --imsi <IMSI> --expiry-action "deleteSession" --expiry-time 1704067200000 --coverage-type g

To remove expiration from an Air SIM, use following command:

soracom subscribers unset-expiry-time --imsi <IMSI> --coverage-type g