Get My eSIMs
curl --request GET \
--url https://api.vellosim.com/api/esim/my-esims \
--header 'X-API-Key: <api-key>'const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.vellosim.com/api/esim/my-esims', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.vellosim.com/api/esim/my-esims"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.vellosim.com/api/esim/my-esims",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.vellosim.com/api/esim/my-esims"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"esims": [
{
"_id": "esim_64f8a1b2c3d4e5f6a7b8c9d0",
"packageCode": "US_5GB_30D",
"packageName": "USA 5GB - 30 Days",
"transactionId": "esim_1699564800_12345",
"iccid": "8944500123456789012",
"qrCodeUrl": "https://vellosim.com/qr/abc123",
"activationCode": "LPA:1$smdp.address$matchingId",
"esimStatus": "ACTIVE",
"data": "5GB",
"totalVolume": 5368709120,
"orderUsage": 1073741824,
"data_usage_remain": 4294967296,
"validity": 30,
"activateTime": "2024-10-15T10:30:00Z",
"expiredTime": "2024-11-14T10:30:00Z",
"createdAt": "2024-10-15T10:00:00Z",
"price": 8000,
"currency": "NGN",
"packageDetails": {
"coverage": ["United States"],
"networkProviders": ["AT&T", "T-Mobile", "Verizon"]
}
},
{
"_id": "esim_64f8a1b2c3d4e5f6a7b8c9d1",
"packageCode": "EU_10GB_15D",
"packageName": "Europe 10GB - 15 Days",
"transactionId": "esim_1699564900_12346",
"iccid": "8944500123456789013",
"qrCodeUrl": "https://vellosim.com/qr/def456",
"activationCode": "LPA:1$smdp.address$matchingId2",
"esimStatus": "EXPIRED",
"data": "10GB",
"totalVolume": 10737418240,
"orderUsage": 8589934592,
"data_usage_remain": 0,
"validity": 15,
"activateTime": "2024-09-01T08:00:00Z",
"expiredTime": "2024-09-16T08:00:00Z",
"createdAt": "2024-08-31T20:00:00Z",
"price": 12000,
"currency": "NGN",
"packageDetails": {
"coverage": ["France", "Germany", "Italy", "Spain"],
"networkProviders": ["Orange", "Vodafone", "T-Mobile"]
}
}
],
"total": 25,
"page": 1,
"limit": 10,
"totalPages": 3
}
{
"success": false,
"message": "Unauthorized",
"error": {
"code": "INVALID_TOKEN",
"details": "Invalid or expired authentication token"
}
}
Orders
Get My eSIMs
Get all your eSIM orders with filtering and pagination
GET
/
api
/
esim
/
my-esims
Get My eSIMs
curl --request GET \
--url https://api.vellosim.com/api/esim/my-esims \
--header 'X-API-Key: <api-key>'const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.vellosim.com/api/esim/my-esims', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.vellosim.com/api/esim/my-esims"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.vellosim.com/api/esim/my-esims",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.vellosim.com/api/esim/my-esims"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"esims": [
{
"_id": "esim_64f8a1b2c3d4e5f6a7b8c9d0",
"packageCode": "US_5GB_30D",
"packageName": "USA 5GB - 30 Days",
"transactionId": "esim_1699564800_12345",
"iccid": "8944500123456789012",
"qrCodeUrl": "https://vellosim.com/qr/abc123",
"activationCode": "LPA:1$smdp.address$matchingId",
"esimStatus": "ACTIVE",
"data": "5GB",
"totalVolume": 5368709120,
"orderUsage": 1073741824,
"data_usage_remain": 4294967296,
"validity": 30,
"activateTime": "2024-10-15T10:30:00Z",
"expiredTime": "2024-11-14T10:30:00Z",
"createdAt": "2024-10-15T10:00:00Z",
"price": 8000,
"currency": "NGN",
"packageDetails": {
"coverage": ["United States"],
"networkProviders": ["AT&T", "T-Mobile", "Verizon"]
}
},
{
"_id": "esim_64f8a1b2c3d4e5f6a7b8c9d1",
"packageCode": "EU_10GB_15D",
"packageName": "Europe 10GB - 15 Days",
"transactionId": "esim_1699564900_12346",
"iccid": "8944500123456789013",
"qrCodeUrl": "https://vellosim.com/qr/def456",
"activationCode": "LPA:1$smdp.address$matchingId2",
"esimStatus": "EXPIRED",
"data": "10GB",
"totalVolume": 10737418240,
"orderUsage": 8589934592,
"data_usage_remain": 0,
"validity": 15,
"activateTime": "2024-09-01T08:00:00Z",
"expiredTime": "2024-09-16T08:00:00Z",
"createdAt": "2024-08-31T20:00:00Z",
"price": 12000,
"currency": "NGN",
"packageDetails": {
"coverage": ["France", "Germany", "Italy", "Spain"],
"networkProviders": ["Orange", "Vodafone", "T-Mobile"]
}
}
],
"total": 25,
"page": 1,
"limit": 10,
"totalPages": 3
}
{
"success": false,
"message": "Unauthorized",
"error": {
"code": "INVALID_TOKEN",
"details": "Invalid or expired authentication token"
}
}
Endpoint
GET /api/esim/my-esims
Description
Retrieve a paginated list of all your eSIM orders with optional filtering by status and search.Authentication
string
required
API Key for authentication
YOUR_API_KEY
Query Parameters
number
default:"1"
Page number for pagination
number
default:"10"
Number of items per page (max: 100)
string
Filter by eSIM status:
ACTIVE- Currently active eSIMsEXPIRED- Expired eSIMsPENDING- Payment pendingFAILED- Failed ordersCANCELLED- Cancelled orders
string
Search by package name, ICCID, or transaction ID
Response
array
Array of eSIM order objects
number
Total number of eSIMs matching the filter
number
Current page number
number
Items per page
number
Total number of pages
Example Request
# Get all eSIMs
curl -X GET 'https://api.vellosim.com/api/esim/my-esims' \
-H "X-API-Key: YOUR_API_KEY"
# Get active eSIMs only
curl -X GET 'https://api.vellosim.com/api/esim/my-esims?status=ACTIVE' \
-H "X-API-Key: YOUR_API_KEY"
# Search eSIMs
curl -X GET 'https://api.vellosim.com/api/esim/my-esims?search=USA&page=1&limit=20' \
-H "X-API-Key: YOUR_API_KEY"
// Get all eSIMs with pagination
async function getMyEsims(page = 1, limit = 10) {
const response = await fetch(
`https://api.vellosim.com/api/esim/my-esims?page=${page}&limit=${limit}`,
{
method: 'GET',
headers: {
'X-API-Key': ' YOUR_API_KEY',
'Content-Type': 'application/json'
}
}
);
return await response.json();
}
// Get active eSIMs only
async function getActiveEsims() {
const response = await fetch(
'https://api.vellosim.com/api/esim/my-esims?status=ACTIVE',
{
method: 'GET',
headers: {
'X-API-Key': ' YOUR_API_KEY',
'Content-Type': 'application/json'
}
}
);
return await response.json();
}
// Search eSIMs
async function searchEsims(query) {
const response = await fetch(
`https://api.vellosim.com/api/esim/my-esims?search=${encodeURIComponent(query)}`,
{
method: 'GET',
headers: {
'X-API-Key': ' YOUR_API_KEY',
'Content-Type': 'application/json'
}
}
);
return await response.json();
}
import requests
def get_my_esims(page=1, limit=10, status=None, search=None):
"""Get user's eSIMs with optional filtering"""
headers = {
'X-API-Key': ' YOUR_API_KEY',
'Content-Type': 'application/json'
}
params = {
'page': page,
'limit': limit
}
if status:
params['status'] = status
if search:
params['search'] = search
response = requests.get(
'https://api.vellosim.com/api/esim/my-esims',
headers=headers,
params=params
)
return response.json()
# Get all eSIMs
all_esims = get_my_esims()
print(f"Total eSIMs: {all_esims['total']}")
# Get active eSIMs
active_esims = get_my_esims(status='ACTIVE')
print(f"Active eSIMs: {len(active_esims['esims'])}")
# Search for USA eSIMs
usa_esims = get_my_esims(search='USA')
<?php
function getMyEsims($page = 1, $limit = 10, $status = null, $search = null) {
$apiKey = 'YOUR_API_KEY';
$params = [
'page' => $page,
'limit' => $limit
];
if ($status) {
$params['status'] = $status;
}
if ($search) {
$params['search'] = $search;
}
$url = 'https://api.vellosim.com/api/esim/my-esims?' . http_build_query($params);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'X-API-Key: ' . $apiKey,
'Content-Type: application/json'
]);
$response = curl_exec($ch);
$data = json_decode($response, true);
curl_close($ch);
return $data;
}
// Get all eSIMs
$allEsims = getMyEsims();
echo "Total eSIMs: " . $allEsims['total'] . "\n";
// Get active eSIMs
$activeEsims = getMyEsims(1, 10, 'ACTIVE');
echo "Active eSIMs: " . count($activeEsims['esims']) . "\n";
?>
Example Response
{
"esims": [
{
"_id": "esim_64f8a1b2c3d4e5f6a7b8c9d0",
"packageCode": "US_5GB_30D",
"packageName": "USA 5GB - 30 Days",
"transactionId": "esim_1699564800_12345",
"iccid": "8944500123456789012",
"qrCodeUrl": "https://vellosim.com/qr/abc123",
"activationCode": "LPA:1$smdp.address$matchingId",
"esimStatus": "ACTIVE",
"data": "5GB",
"totalVolume": 5368709120,
"orderUsage": 1073741824,
"data_usage_remain": 4294967296,
"validity": 30,
"activateTime": "2024-10-15T10:30:00Z",
"expiredTime": "2024-11-14T10:30:00Z",
"createdAt": "2024-10-15T10:00:00Z",
"price": 8000,
"currency": "NGN",
"packageDetails": {
"coverage": ["United States"],
"networkProviders": ["AT&T", "T-Mobile", "Verizon"]
}
},
{
"_id": "esim_64f8a1b2c3d4e5f6a7b8c9d1",
"packageCode": "EU_10GB_15D",
"packageName": "Europe 10GB - 15 Days",
"transactionId": "esim_1699564900_12346",
"iccid": "8944500123456789013",
"qrCodeUrl": "https://vellosim.com/qr/def456",
"activationCode": "LPA:1$smdp.address$matchingId2",
"esimStatus": "EXPIRED",
"data": "10GB",
"totalVolume": 10737418240,
"orderUsage": 8589934592,
"data_usage_remain": 0,
"validity": 15,
"activateTime": "2024-09-01T08:00:00Z",
"expiredTime": "2024-09-16T08:00:00Z",
"createdAt": "2024-08-31T20:00:00Z",
"price": 12000,
"currency": "NGN",
"packageDetails": {
"coverage": ["France", "Germany", "Italy", "Spain"],
"networkProviders": ["Orange", "Vodafone", "T-Mobile"]
}
}
],
"total": 25,
"page": 1,
"limit": 10,
"totalPages": 3
}
{
"success": false,
"message": "Unauthorized",
"error": {
"code": "INVALID_TOKEN",
"details": "Invalid or expired authentication token"
}
}
eSIM Status
| Status | Description |
|---|---|
CREATED | eSIM created, not yet activated |
ACTIVE | eSIM is active and in use |
EXPIRED | eSIM validity period has ended |
PENDING | Payment pending |
FAILED | Order or activation failed |
CANCELLED | Order was cancelled |
SUSPENDED | eSIM temporarily suspended |
Use Cases
Display User's eSIMs
Display User's eSIMs
Show all eSIMs in a dashboard:
async function displayEsimsDashboard() {
const { esims, total } = await getMyEsims(1, 20);
esims.forEach(esim => {
console.log(`${esim.packageName} - ${esim.esimStatus}`);
console.log(`Data remaining: ${formatBytes(esim.data_usage_remain)}`);
console.log(`Expires: ${new Date(esim.expiredTime).toLocaleDateString()}\n`);
});
console.log(`Showing ${esims.length} of ${total} total eSIMs`);
}
Filter Active eSIMs
Filter Active eSIMs
Show only currently active eSIMs:
async function getActiveEsimsOnly() {
const { esims } = await getMyEsims(1, 100, 'ACTIVE');
return esims;
}
// Display active eSIMs
const activeEsims = await getActiveEsimsOnly();
console.log(`You have ${activeEsims.length} active eSIMs`);
Search and Filter
Search and Filter
Search for specific eSIMs:
async function findEsim(query) {
const { esims } = await searchEsims(query);
if (esims.length === 0) {
console.log('No eSIMs found');
return null;
}
return esims;
}
// Search for USA eSIMs
const usaEsims = await findEsim('USA');
Pagination Implementation
Pagination Implementation
Implement pagination in your UI:
async function loadEsimsPage(page) {
const { esims, totalPages, page: currentPage } = await getMyEsims(page, 10);
renderEsims(esims);
renderPagination(currentPage, totalPages);
}
// Load next page
function nextPage(currentPage) {
loadEsimsPage(currentPage + 1);
}
Data Usage Formatting
Helper function to format data usage:function formatBytes(bytes) {
if (bytes === 0) return '0 Bytes';
const k = 1024;
const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];
const i = Math.floor(Math.log(bytes) / Math.log(k));
return Math.round(bytes / Math.pow(k, i) * 100) / 100 + ' ' + sizes[i];
}
// Usage
const remaining = formatBytes(esim.data_usage_remain); // "4.0 GB"
Next Steps
Get eSIM Details
Get detailed information for a specific eSIM
Purchase eSIM
Buy a new eSIM package
eSIM Statistics
View your eSIM usage statistics
Integration Guide
Build an eSIM management dashboard
⌘I
