Retrieving account balances

Retrieving balances for all of a Brand's accounts

You can retrieve balances for all your customer accounts, or restrict it by specifying a specific customer_id.

To retrieve account balances, use the GET /balances/ operation and provide the query parameters as shown in the table below.

Parameter

Type

Description

customer_id

String

The unique ID used to reference a customer resource.

Page

int32

Number of the page to retrieve.

Count

int32

Number of items to retrieve per page.

An example of a request to retrieve balances for balances for a specific customer ID is shown below.

curl --request GET \
     --url 'https://sandbox.bond.tech/api/v0/balances?customer_id=931e2341-c3eb-4681-97d4-f6e09d90da14&page=1&count=20' \
     --header 'Accept: application/json' \
     --header 'Authorization: YOUR-AUTHORIZATION' \
     --header 'Identity: YOUR-IDENTITY'
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://sandbox.bond.tech/api/v0/balances?customer_id=931e2341-c3eb-4681-97d4-f6e09d90da14&page=1&count=20")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Accept"] = 'application/json'
request["Identity"] = 'YOUR-IDENTITY'
request["Authorization"] = 'YOUR-AUTHORIZATION'

response = http.request(request)
puts response.read_body
const options = {
  method: 'GET',
  headers: {
    Accept: 'application/json',
    Identity: 'YOUR-IDENTITY',
    Authorization: 'YOUR-AUTHORIZATION'
  }
};

fetch('https://sandbox.bond.tech/api/v0/balances?customer_id=931e2341-c3eb-4681-97d4-f6e09d90da14&page=1&count=20', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
import requests

url = "https://sandbox.bond.tech/api/v0/balances"

querystring = {"customer_id":"931e2341-c3eb-4681-97d4-f6e09d90da14","page":"1","count":"20"}

headers = {
    "Accept": "application/json",
    "Identity": "YOUR-IDENTITY",
    "Authorization": "YOUR-AUTHORIZATION"
}

response = requests.request("GET", url, headers=headers, params=querystring)

print(response.text)
var client = new RestClient("https://sandbox.bond.tech/api/v0/balances?customer_id=931e2341-c3eb-4681-97d4-f6e09d90da14&page=1&count=20");
var request = new RestRequest(Method.GET);
request.AddHeader("Accept", "application/json");
request.AddHeader("Identity", "YOUR-IDENTITY");
request.AddHeader("Authorization", "YOUR-AUTHORIZATION");
IRestResponse response = client.Execute(request);
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://sandbox.bond.tech/api/v0/balances?customer_id=931e2341-c3eb-4681-97d4-f6e09d90da14&page=1&count=20")
  .get()
  .addHeader("Accept", "application/json")
  .addHeader("Identity", "YOUR-IDENTITY")
  .addHeader("Authorization", "YOUR-AUTHORIZATION")
  .build();

Response response = client.newCall(request).execute();

An example of a response to a successful request to retrieve the balances for a specific customer ID is shown below.

{
    "page": 1,
    "pages": 1,
    "count": 1,
    "next_page": null,
    "balances": [
        {
            "account_id": "ad25f108-c130-4059-b07d-f7675ab90c13",
            "currency": "USD",
            "balance_type": "POS Purchase",
            "current_balance": "624.99",
            "available_balance": "25873.61"
        }
    ]
}

Retrieving balances for a single account_id

To retrieve the balance for a single Account ID, use the GET /balances/{account_id} operation with no further parameters.

An example of a request to retrieve the balance for a single account ID is shown below.

curl --request GET \
     --url https://sandbox.bond.tech/api/v0/balances/9dc86a8a-4c12-4107-84a8-e7cf6a76586f \
     --header 'Accept: application/json' \
     --header 'Authorization: YOUR-AUTHORIZATION' \
     --header 'Identity: YOUR-IDENTITY'
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://sandbox.bond.tech/api/v0/balances/9dc86a8a-4c12-4107-84a8-e7cf6a76586f")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Accept"] = 'application/json'
request["Identity"] = 'YOUR-IDENTITY'
request["Authorization"] = 'YOUR-AUTHORIZATION'

response = http.request(request)
puts response.read_body
const options = {
  method: 'GET',
  headers: {
    Accept: 'application/json',
    Identity: 'YOUR-IDENTITY',
    Authorization: 'YOUR-AUTHORIZATION'
  }
};

fetch('https://sandbox.bond.tech/api/v0/balances/9dc86a8a-4c12-4107-84a8-e7cf6a76586f', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
import requests

url = "https://sandbox.bond.tech/api/v0/balances/9dc86a8a-4c12-4107-84a8-e7cf6a76586f"

headers = {
    "Accept": "application/json",
    "Identity": "YOUR-IDENTITY",
    "Authorization": "YOUR-AUTHORIZATION"
}

response = requests.request("GET", url, headers=headers)

print(response.text)
var client = new RestClient("https://sandbox.bond.tech/api/v0/balances/9dc86a8a-4c12-4107-84a8-e7cf6a76586f");
var request = new RestRequest(Method.GET);
request.AddHeader("Accept", "application/json");
request.AddHeader("Identity", "YOUR-IDENTITY");
request.AddHeader("Authorization", "YOUR-AUTHORIZATION");
IRestResponse response = client.Execute(request);
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://sandbox.bond.tech/api/v0/balances/9dc86a8a-4c12-4107-84a8-e7cf6a76586f")
  .get()
  .addHeader("Accept", "application/json")
  .addHeader("Identity", "YOUR-IDENTITY")
  .addHeader("Authorization", "YOUR-AUTHORIZATION")
  .build();

Response response = client.newCall(request).execute();

An example of a response to a successful request to retrieve an account's balance is shown below.

{
    "account_id": "76bc2814-2058-47b1-8e95-fa7437a4e228",
    "currency": "USD",
    "balance_type": "POS Purchase",
    "current_balance": "-8.22",
    "available_balance": "2000.26"
}

For a complete specification and interactive examples, see Retrieving balances in the Bond API Reference.

For details regarding retrieving the history of an account, see Getting an external account's history.


Did this page help you?