eSIM Usage Callback
POST https://your-usage-callback-url/
V3 of the Callback system is now available and provides additional data as well as HMAC signature validation. This must be enabled in the eSIM Portal. V2 of the Callback system is still available by default, but will be disabled in the future.
When data is used on an eSIM, a usage event can be sent to a URL defined by you in the eSIM Portal. The usage event will report the current bundle in use by an eSIM, and it’s remaining data.
Example of validating HMAC body in NodeJS:
import crypto from "crypto";
const signature = crypto
.createHmac("sha256", key) // key is your API Key
.update(body) // body is the raw (string) request body
.digest("base64");
const matches = signature === signatureHeader;
Validation uses your API Key as the HMAC key. The body of the request is the raw (string) request body, and should not be parsed as JSON before validation.
Note: Bundle names are case sensitive e.g. “esim_1GB_7D_IM_U”.
Request Body Notes:
- The “try” button for this endpoint is NOT functional
- The schema defines an example message that is sent to the configured callback URL.
- For more information on callback notification types, Please see the Notifications Page.
Request Body required
object
Your eSIM ICCID value
Type of callback alert
object
ID of the Bundle assignment; used for removing single assignment of a Bundle from an eSIM
Reference of the Bundle assignment; this can be used with Assignment endpoint https://docs.esim-go.com/api/#get-/esims/assignments
Name of Bundle applied to eSIM
Description of Bundle applied to eSIM
Starting quantity of data supplied by Bundle
Remaining quantity of data
Start time of Bundle.
Format as defined in RFC 3339, section 5.6. Timezone is UTC (ends with ‘Z’).
Example: 2006-01-02T15:04:05Z
End time of Bundle.
Format as defined in RFC 3339, section 5.6. Timezone is UTC (ends with ‘Z’).
Example: 2007-01-02T15:04:05Z
object
Your eSIM ICCID value
Type of callback alert
object
Name of Bundle applied to eSIM
Starting quantity of data supplied by Bundle
Remaining quantity of data
Start time of Bundle.
Format as defined in RFC 3339, section 5.6. Timezone is UTC (ends with ‘Z’).
Example: 2006-01-02T15:04:05Z
End time of Bundle.
Format as defined in RFC 3339, section 5.6. Timezone is UTC (ends with ‘Z’).
Example: 2007-01-02T15:04:05Z