Skip to main content

Quick Reference


Common Payload Structure

All webhooks share this base structure:

eSIM Data Object (Common to All Events)


Event Type Details

1. esim.created

When: eSIM purchase completed and resource details retrieved from provider Timing: 5-30 seconds after purchase Full Example:
Use Cases:
  • Update your database with eSIM details
  • Send confirmation email with QR code
  • Display eSIM in user’s dashboard
  • Generate invoice/receipt

2. esim.activated

When: User installs and activates the eSIM profile on their device Timing: When provider notifies activation (typically within minutes of installation) Full Example:
Key Fields:
  • activateTime: When activation occurred
  • expiredTime: Calculated expiration date
  • eid: Device identifier
  • previousStatus: Status before activation
  • newStatus: “ACTIVATED” or “IN_USE”
Use Cases:
  • Start usage tracking
  • Send activation confirmation
  • Update analytics/reports
  • Trigger welcome message

3. esim.data_updated

When: Data usage information changes (every few hours or at usage milestones) Timing: Varies (typically when 25%, 50%, 75%, 90%, 100% thresholds reached) Full Example:
Key Fields:
  • dataUsage: Current usage in MB
  • data_usage_remain: Remaining data in MB
  • changes: Shows what changed from previous state
Use Cases:
  • Track consumption patterns
  • Send low data alerts
  • Offer top-up/add-ons
  • Update usage charts

4. esim.usage_updated

When: Complete usage information refreshed (data + validity) Timing: Periodic updates or after manual requery Full Example:
Key Fields:
  • dataUsage + data_usage_remain: Data usage
  • validity_usage_remain: Days remaining
  • lastUsageUpdate: Timestamp of update
Use Cases:
  • Comprehensive usage sync
  • Dashboard updates
  • Analytics refresh
  • Billing updates

5. esim.suspended

When: eSIM is suspended (manual or automatic) Timing: Immediately when suspension occurs Full Example:
Possible Status Values:
  • REVOKED: Profile revoked
  • CANCEL: Order cancelled
Use Cases:
  • Notify user of suspension
  • Display suspension reason
  • Offer reactivation options
  • Update access controls

6. esim.expired

When: eSIM reaches end of validity period or data exhausted Timing: At expiration time or when data runs out Full Example:
Possible Status Values:
  • USED_UP: Data fully consumed
  • USED_EXPIRED: Data used + validity expired
  • UNUSED_EXPIRED: Expired with unused data
Use Cases:
  • Archive eSIM data
  • Offer renewal/repurchase
  • Generate usage report
  • Update analytics

7. esim.status_changed

When: Any status change not covered by specific events Timing: Varies based on status change Full Example:
Use Cases:
  • Catch all status changes
  • Handle edge cases
  • Maintain audit trail
  • Debug status transitions

8. esim.requeried

When: eSIM data manually refreshed from provider Timing: After admin or system requery operation Full Example:
Use Cases:
  • Sync latest provider data
  • Resolve data discrepancies
  • Force update in UI
  • Debugging/support

eSIM Status Values


SMDP Status Values


Data Units

All data-related fields use megabytes (MB) as the unit:

Time/Duration Units

Validity duration typically in days:

Timestamp Format

All timestamps are in ISO 8601 format (UTC):

Webhook Headers

Every webhook request includes these headers:

Signature Verification

Verify webhook signatures to ensure requests are from Vellosim:

Handling Webhook Events

Process different event types appropriately:

Webhook Response Best Practices

Always return a 200 status code to acknowledge receipt. Process the webhook asynchronously if needed.
Your endpoint should respond within 5 seconds. For longer processing, queue the webhook for async processing.
Webhooks may be sent multiple times. Use the event ID to prevent duplicate processing.
Always verify webhook signatures to ensure authenticity and prevent spoofing.

Error Handling & Retry Logic

Retry Schedule

Failed webhooks are retried with exponential backoff:
  • Attempt 1: Immediate
  • Attempt 2: 1 minute later
  • Attempt 3: 5 minutes later
  • Attempt 4: 15 minutes later
  • Attempt 5: 1 hour later
  • Attempt 6: 2 hours later
Maximum: 5 retries (6 total attempts)

HTTP Status Codes

  • 2xx: Success, no retry
  • 410 Gone: Endpoint invalid, stop retrying
  • All others: Retry with backoff

Async Processing Example


Testing Webhooks

Local Testing with ngrok

Expose your local server for webhook testing:

Test with webhook.site

Use webhook.site to inspect webhook payloads:
  1. Go to webhook.site
  2. Copy the unique URL
  3. Configure it as your webhook endpoint
  4. Trigger events and inspect payloads in real-time

Integration Checklist

✅ Webhook URL configured in API key settings
✅ Signature verification implemented
✅ Idempotency handling (using event.id)
✅ Async processing (return 200 OK immediately)
✅ Error logging and monitoring
✅ Retry handling on your side (optional)
✅ Test with ngrok/webhook.site
✅ Monitor webhook delivery logs

Next Steps

Purchase eSIM

Learn how to purchase eSIMs

Fetch eSIM Details

Retrieve complete eSIM information

Top-up eSIM

Add data to existing eSIMs

List All eSIMs

Fetch all user eSIMs with pagination