Get Wallet Balance
curl --request GET \
--url https://api.vellosim.com/api/wallet/balance \
--header 'X-API-Key: <api-key>'const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.vellosim.com/api/wallet/balance', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.vellosim.com/api/wallet/balance"
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/wallet/balance",
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/wallet/balance"
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))
}Wallet
Get Wallet Balance
Retrieve your current wallet balance
GET
/
api
/
wallet
/
balance
Get Wallet Balance
curl --request GET \
--url https://api.vellosim.com/api/wallet/balance \
--header 'X-API-Key: <api-key>'const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.vellosim.com/api/wallet/balance', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.vellosim.com/api/wallet/balance"
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/wallet/balance",
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/wallet/balance"
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))
}Endpoint
GET /api/wallet/balance
Description
This endpoint returns the current balance in your Vellosim wallet. Your wallet balance is used to purchase eSIM packages.Authentication
This endpoint requires authentication using your API key in theX-API-Key header.
Production:
X-API-Key: vls_live_YOUR_API_KEY
X-API-Key: vls_test_YOUR_API_KEY
Request
Headers
| Header | Value | Required |
|---|---|---|
| Authorization | YOUR_API_KEY | Yes |
| Content-Type | application/json | Yes |
Parameters
This endpoint does not require any parameters.Response
Success Response (200 OK)
{
"success": true,
"data": {
"balance": 1250.50,
"currency": "USD",
"lastUpdated": "2024-11-10T10:30:00Z"
}
}
Response Fields
| Field | Type | Description |
|---|---|---|
| balance | number | Current wallet balance |
| currency | string | Currency code (USD, EUR, etc.) |
| lastUpdated | string | ISO 8601 timestamp of last balance update |
Error Responses
401 Unauthorized
{
"success": false,
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid or missing API key"
},
"statusCode": 401
}
500 Internal Server Error
{
"success": false,
"error": {
"code": "INTERNAL_ERROR",
"message": "An internal error occurred"
},
"statusCode": 500
}
Examples
curl --request GET \
--url https://api.vellosim.com/api/wallet/balance \
--header 'X-API-Key: YOUR_API_KEY' \
--header 'Content-Type: application/json'
const getBalance = async () => {
const response = await fetch('https://api.vellosim.com/api/wallet/balance', {
method: 'GET',
headers: {
'X-API-Key': `YOUR_API_KEY}`,
'Content-Type': 'application/json'
}
});
const data = await response.json();
console.log('Current balance:', data.data.balance);
return data;
};
import requests
headers = {
'X-API-Key': f' {YOUR_API_KEY}',
'Content-Type': 'application/json'
}
response = requests.get(
'https://api.vellosim.com/api/wallet/balance',
headers=headers
)
data = response.json()
print(f"Current balance: {data['data']['balance']}")
<?php
$apiKey = 'YOUR_API_KEY';
$ch = curl_init('https://api.vellosim.com/api/wallet/balance');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'X-API-Key: ' . $apiKey,
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$data = json_decode($response, true);
echo "Current balance: " . $data['data']['balance'];
curl_close($ch);
?>
Notes
Check your wallet balance before attempting to purchase eSIM packages to ensure you have sufficient funds.
You can top up your wallet balance from your Vellosim dashboard.
⌘I
