Airtime
Search…
View an account's balance
With the /account/balance endpoint, you can retrieve the balance of your account in real-time
get
https://topups.reloadly.com/
accounts/balance
Account Balance

Request samples

cURL
C#
Golang
Java
Node JS
PHP
Python
1
curl --location --request GET 'https://topups.reloadly.com/accounts/balance' \
2
--header 'Accept: application/com.reloadly.topups-v1+json' \
3
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN_HERE' \
4
--header 'Content-Type: application/json'
Copied!
1
using System;
2
using System.Threading.Tasks;
3
using System.Net.Http;
4
using System.Text;
5
using Newtonsoft.Json;
6
7
namespace WebAPIClient {
8
class Program {
9
10
static async Task Main(string[] args) {
11
await ApiCall();
12
}
13
14
private static async Task ApiCall() {
15
16
var message = new HttpRequestMessage(HttpMethod.Get, "https://topups.reloadly.com/accounts/balance");
17
18
message.Headers.TryAddWithoutValidation("Authorization", "Bearer YOUR_ACCESS_TOKEN_HERE");
19
message.Headers.TryAddWithoutValidation("Accept", "application/com.reloadly.topups-v1+json");
20
message.Headers.TryAddWithoutValidation("Content-Type", "application/json");
21
22
using
23
var httpClient = new HttpClient();
24
var response = await httpClient.SendAsync(message);
25
var responseBody = await response.Content.ReadAsStringAsync();
26
var result = JsonConvert.DeserializeObject < dynamic > (responseBody);
27
28
Console.WriteLine(result);
29
}
30
31
}
32
}
Copied!
1
package main
2
3
import (
4
"fmt"
5
"net/http"
6
"io/ioutil"
7
)
8
9
func main() {
10
11
url := "https://topups.reloadly.com/accounts/balance"
12
method := "GET"
13
14
client := &http.Client {
15
}
16
req, err := http.NewRequest(method, url, nil)
17
18
if err != nil {
19
fmt.Println(err)
20
return
21
}
22
req.Header.Add("Accept", "application/com.reloadly.topups-v1+json")
23
req.Header.Add("Authorization", "Bearer YOUR_ACCESS_TOKEN_HERE")
24
req.Header.Add("Content-Type", "application/json")
25
26
res, err := client.Do(req)
27
if err != nil {
28
fmt.Println(err)
29
return
30
}
31
defer res.Body.Close()
32
33
body, err := ioutil.ReadAll(res.Body)
34
if err != nil {
35
fmt.Println(err)
36
return
37
}
38
fmt.Println(string(body))
39
}
Copied!
1
OkHttpClient client = new OkHttpClient().newBuilder()
2
.build();
3
Request request = new Request.Builder()
4
.url("https://topups.reloadly.com/accounts/balance")
5
.method("GET", null)
6
.addHeader("Accept", "application/com.reloadly.topups-v1+json")
7
.addHeader("Authorization", "Bearer YOUR_ACCESS_TOKEN_HERE")
8
.addHeader("Content-Type", "application/json")
9
.build();
10
Response response = client.newCall(request).execute();
Copied!
1
var myHeaders = new Headers();
2
myHeaders.append("Accept", "application/com.reloadly.topups-v1+json");
3
myHeaders.append("Authorization", "Bearer YOUR_ACCESS_TOKEN_HERE");
4
myHeaders.append("Content-Type", "application/json");
5
6
var requestOptions = {
7
method: 'GET',
8
headers: myHeaders,
9
redirect: 'follow'
10
};
11
12
fetch("https://topups.reloadly.com/accounts/balance", requestOptions)
13
.then(response => response.text())
14
.then(result => console.log(result))
15
.catch(error => console.log('error', error));
Copied!
1
<?php
2
3
$curl = curl_init();
4
5
curl_setopt_array($curl, array(
6
CURLOPT_URL => 'https://topups.reloadly.com/accounts/balance',
7
CURLOPT_RETURNTRANSFER => true,
8
CURLOPT_ENCODING => '',
9
CURLOPT_MAXREDIRS => 10,
10
CURLOPT_TIMEOUT => 0,
11
CURLOPT_FOLLOWLOCATION => true,
12
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
13
CURLOPT_CUSTOMREQUEST => 'GET',
14
CURLOPT_HTTPHEADER => array(
15
'Accept: application/com.reloadly.topups-v1+json',
16
'Authorization: Bearer YOUR_ACCESS_TOKEN_HERE',
17
'Content-Type: application/json'
18
),
19
));
20
21
$response = curl_exec($curl);
22
23
curl_close($curl);
24
echo $response;
Copied!
1
import requests
2
import json
3
4
url = "https://topups.reloadly.com/accounts/balance"
5
6
payload={}
7
headers = {
8
'Accept': 'application/com.reloadly.topups-v1+json',
9
'Authorization': 'Bearer YOUR_ACCESS_TOKEN_HERE',
10
'Content-Type': 'application/json'
11
}
12
13
response = requests.request("GET", url, headers=headers, data=payload)
14
15
print(response.text)
Copied!

Response parameters

Parameter
Type
Description
balance
number
This indicates the current account balance
currencyCode
string
This indicates the account's currency code
currencyName
string
This indicates the account's currency name
updatedAt
string
This indicates the last time a top-up was made from the account
Last modified 6mo ago