Core concepts
Usage
Data left, totals per period and country, and every session.
Usage comes at three levels of detail: what's left now, totals per period, and every single session. Totals and sessions are available per eSIM or for a whole profile.
What's left now
Get usage returns the total, used and remaining data across the eSIM's active packages. Use it for a "data left" figure. One package's own counters come from get package.
Totals per period
Usage history returns usage per period, split by type. Use it for a usage chart or a monthly statement.
aggregationis the period,hour,dayormonth, optionally afterusageCountryto split each period by the country the usage happened in.fromandtoare wall-clock times intimezone, withoutZor an offset, and must fall on a period boundary: midnight forday, the 1st formonth.tois exclusive.- The window reaches at most three calendar months back.
Every period in the window comes back, an empty usage array where nothing
was used. Voice is always split by direction, and outgoing voice by
destination country when known.
Profile usage history takes the same parameters and returns the same shape, summed across every eSIM the profile has held. Usage of an eSIM replaced by a swap stays in, so use it for a customer's total.
Every session
Usage sessions lists each
data session, call and SMS, newest first, over the last three calendar
months. Use it to answer "where did my data go". Data counts in whole bytes,
voice in seconds, SMS in messages. A concealed number reads anonymous.
Profile usage sessions lists
the sessions of every eSIM the profile has held, swapped-out ones included.
Each session's esimReference names the eSIM it was used on.
A period's total in usage history equals the sum of the sessions in the same window. Both can differ from a package's own usage counters, so don't reconcile the two against each other.
Usage events
| Webhook | When |
|---|---|
package.usage | A package's usage grew by at least one whole unit. Carries the running total, not a delta. |
package.usage.threshold | A package crossed one of your endpoint's thresholds, 33% and 66% unless you set others. Once per threshold per renewal. |
esim.mccswitch | The eSIM registered on a different network than last time, with the previous and new country. The first registration carries no previous network. |
sms.sent | Firsty sent the customer of a local eSIM an SMS notification, such as on entering a country or running low on data. Its type says which. Sent to the network, not necessarily received. |
esim.mccswitch is the signal that a traveller arrived somewhere new: the
moment to offer a country plan.