Remaining Data
Calculate the remaining data allowance for the relevant package assignment.
From eSIM assignment fields
remainingData = package.dataLimit - usageValueTotal allowance (package.dataLimit)
3 GB
Used data (usageValue)
1.206621 GB
Remaining data
1.793379 GB
Convert numeric strings such as usageValue to numbers before subtraction. Use consistent units for both values.
From the dedicated usage endpoint
remainingTraffic = rate_group_allowance - rate_group_usage
3 - 1.206621 = 1.793379 GBRead the unit from rate_group_allow_qtyp. Calculate per relevant rate group; do not add or subtract values in different units without conversion.
Remaining data alone does not establish whether a package can be used. Check the assignment status, usage status, activation date, and expiration date.
Usage is near real-time and may have a short mobile-network reporting delay. When several packages are assigned to an eSIM, calculate the balance for each relevant assignment instead of assuming the first array entry is current.
Last updated