cURL
curl --request GET \
--url https://api.hyperrails.io/api/v1/partners/balances \
--header 'Authorization: Bearer <token>' \
--header 'x-service-source: <x-service-source>'import requests
url = "https://api.hyperrails.io/api/v1/partners/balances"
headers = {
"x-service-source": "<x-service-source>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'x-service-source': '<x-service-source>', Authorization: 'Bearer <token>'}
};
fetch('https://api.hyperrails.io/api/v1/partners/balances', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.hyperrails.io/api/v1/partners/balances",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"x-service-source: <x-service-source>"
],
]);
$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.hyperrails.io/api/v1/partners/balances"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-service-source", "<x-service-source>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.hyperrails.io/api/v1/partners/balances")
.header("x-service-source", "<x-service-source>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hyperrails.io/api/v1/partners/balances")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-service-source"] = '<x-service-source>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"accountId": "c1fba25a-a36b-479c-b17d-64dbaf3ba32c",
"currency": "GHS",
"balance": 3,
"availableBalance": 3
}
]{
"code": "INVALID_CURRENCY",
"message": "Invalid source currency. Supported: NGN, GHS",
"details": {}
}Wallets and Balances
Get All Wallets
Returns all balances
GET
/
partners
/
balances
cURL
curl --request GET \
--url https://api.hyperrails.io/api/v1/partners/balances \
--header 'Authorization: Bearer <token>' \
--header 'x-service-source: <x-service-source>'import requests
url = "https://api.hyperrails.io/api/v1/partners/balances"
headers = {
"x-service-source": "<x-service-source>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'x-service-source': '<x-service-source>', Authorization: 'Bearer <token>'}
};
fetch('https://api.hyperrails.io/api/v1/partners/balances', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.hyperrails.io/api/v1/partners/balances",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"x-service-source: <x-service-source>"
],
]);
$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.hyperrails.io/api/v1/partners/balances"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-service-source", "<x-service-source>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.hyperrails.io/api/v1/partners/balances")
.header("x-service-source", "<x-service-source>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hyperrails.io/api/v1/partners/balances")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-service-source"] = '<x-service-source>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"accountId": "c1fba25a-a36b-479c-b17d-64dbaf3ba32c",
"currency": "GHS",
"balance": 3,
"availableBalance": 3
}
]{
"code": "INVALID_CURRENCY",
"message": "Invalid source currency. Supported: NGN, GHS",
"details": {}
}Authorizations
API key authentication using Bearer token
Headers
Identifies the calling service
Example:
"HyperRails"
Was this page helpful?
⌘I