View an account's balance
With the /account/balance
endpoint, you can retrieve the balance of your account in real-time
Account Balance
GET
https://topups.reloadly.com/accounts/balance
Headers
Name
Type
Description
Authorization
string
Your access token is required as a bearer token in the request's header
{
"balance":550.75,
"currencyCode":"USD",
"currencyName":"US Dollar",
"updatedAt":"2018-12-04 08:45:51"
}
{
"timeStamp":"2021-05-11 21:14:00",
"message":"Full authentication is required to access this resource",
"path":"/accounts/balance",
"errorCode":"INVALID_TOKEN",
"infoLink":null,
"details":[
]
}
{
"timestamp":"2021-05-11T21:14:29.629+0000",
"status":404,
"error":"Not Found",
"message":"No message available",
"path":"/accounts/balanc"
}
Request samples
curl --location --request GET 'https://topups.reloadly.com/accounts/balance' \
--header 'Accept: application/com.reloadly.topups-v1+json' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN_HERE' \
--header 'Content-Type: application/json'
using System;
using System.Threading.Tasks;
using System.Net.Http;
using System.Text;
using Newtonsoft.Json;
namespace WebAPIClient {
class Program {
static async Task Main(string[] args) {
await ApiCall();
}
private static async Task ApiCall() {
var message = new HttpRequestMessage(HttpMethod.Get, "https://topups.reloadly.com/accounts/balance");
message.Headers.TryAddWithoutValidation("Authorization", "Bearer YOUR_ACCESS_TOKEN_HERE");
message.Headers.TryAddWithoutValidation("Accept", "application/com.reloadly.topups-v1+json");
message.Headers.TryAddWithoutValidation("Content-Type", "application/json");
using
var httpClient = new HttpClient();
var response = await httpClient.SendAsync(message);
var responseBody = await response.Content.ReadAsStringAsync();
var result = JsonConvert.DeserializeObject < dynamic > (responseBody);
Console.WriteLine(result);
}
}
}
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://topups.reloadly.com/accounts/balance"
method := "GET"
client := &http.Client {
}
req, err := http.NewRequest(method, url, nil)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Accept", "application/com.reloadly.topups-v1+json")
req.Header.Add("Authorization", "Bearer YOUR_ACCESS_TOKEN_HERE")
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
Request request = new Request.Builder()
.url("https://topups.reloadly.com/accounts/balance")
.method("GET", null)
.addHeader("Accept", "application/com.reloadly.topups-v1+json")
.addHeader("Authorization", "Bearer YOUR_ACCESS_TOKEN_HERE")
.addHeader("Content-Type", "application/json")
.build();
Response response = client.newCall(request).execute();
var myHeaders = new Headers();
myHeaders.append("Accept", "application/com.reloadly.topups-v1+json");
myHeaders.append("Authorization", "Bearer YOUR_ACCESS_TOKEN_HERE");
myHeaders.append("Content-Type", "application/json");
var requestOptions = {
method: 'GET',
headers: myHeaders,
redirect: 'follow'
};
fetch("https://topups.reloadly.com/accounts/balance", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://topups.reloadly.com/accounts/balance',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'Accept: application/com.reloadly.topups-v1+json',
'Authorization: Bearer YOUR_ACCESS_TOKEN_HERE',
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import requests
import json
url = "https://topups.reloadly.com/accounts/balance"
payload={}
headers = {
'Accept': 'application/com.reloadly.topups-v1+json',
'Authorization': 'Bearer YOUR_ACCESS_TOKEN_HERE',
'Content-Type': 'application/json'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
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 updated
Was this helpful?