Subscription Lifecycle
A Subscription represents a plan linked to a SIM profile. Below are all the possible states for a Subscriptions and an example request/response to the SIM endpoint to consult that state.
Status | Description |
---|---|
PENDING | not active yet, usually because the activation date was defined in the future |
ACTIVE | currently active, meaning with remaining allowance and not expired yet |
DEPLETED | no remaining allowance in the subscription |
EXPIRED | subscription passed its expiration date |
#
Example Requestcurl -X GET \ https://services.truphone.com/connect-api/v1/sim/8944474600000109251/subscriptions \ -H "Authorization: Bearer $ACCESS_TOKEN" \ -H 'Cache-Control: no-cache' \ -H 'Content-Type: application/json' \ -H 'X-Correlation-ID: unique-id-from-requester-123'
#
Example Response[ { "status": "DEPLETED", "id": "Njc1NzY1NzY1ZDIK", "initialBalance": "314572800", "spentBalance": "314572800", "activationDate": "2019-08-01T09:09:33Z", "expirationDate": "2019-08-02T09:09:33Z", "createdDate": "2020-03-19T15:51:41Z", "product": { "id": "MzA5MjE3ODMwOTEyCg==", "name": "Prepaid data 30GB", "period": 0, "period_unit": "DAYS", "plan_id": "TruphoneinternalPlan_Id" }, "iccid": "8932673628198237", "device_id": "12345657", "auto_renew": "false" }]