Get customer balances
curl --request GET \
--url https://api.daya.co/v1/customers/{id}/balances \
--header 'X-Api-Key: <x-api-key>'import requests
url = "https://api.daya.co/v1/customers/{id}/balances"
headers = {"X-Api-Key": "<x-api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Api-Key': '<x-api-key>'}};
fetch('https://api.daya.co/v1/customers/{id}/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.daya.co/v1/customers/{id}/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 => [
"X-Api-Key: <x-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.daya.co/v1/customers/{id}/balances"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Api-Key", "<x-api-key>")
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.daya.co/v1/customers/{id}/balances")
.header("X-Api-Key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.daya.co/v1/customers/{id}/balances")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Api-Key"] = '<x-api-key>'
response = http.request(request)
puts response.read_body{
"data": [
{
"customer_id": "650e8400-e29b-41d4-a716-446655440000",
"currency": "NGN",
"available": "125000.00",
"pending": "0.00",
"locked": "0.00"
}
]
}
Customers
Get customer balances
Retrieve the NGN balance held for a customer
GET
/
v1
/
customers
/
{id}
/
balances
Get customer balances
curl --request GET \
--url https://api.daya.co/v1/customers/{id}/balances \
--header 'X-Api-Key: <x-api-key>'import requests
url = "https://api.daya.co/v1/customers/{id}/balances"
headers = {"X-Api-Key": "<x-api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Api-Key': '<x-api-key>'}};
fetch('https://api.daya.co/v1/customers/{id}/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.daya.co/v1/customers/{id}/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 => [
"X-Api-Key: <x-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.daya.co/v1/customers/{id}/balances"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Api-Key", "<x-api-key>")
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.daya.co/v1/customers/{id}/balances")
.header("X-Api-Key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.daya.co/v1/customers/{id}/balances")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Api-Key"] = '<x-api-key>'
response = http.request(request)
puts response.read_body{
"data": [
{
"customer_id": "650e8400-e29b-41d4-a716-446655440000",
"currency": "NGN",
"available": "125000.00",
"pending": "0.00",
"locked": "0.00"
}
]
}
Overview
Returns the available, pending, and locked NGN balance held for one of your customers. Use this endpoint after creating a permanent funding account withsettlement_destination.type: CUSTOMER_NGN_BALANCE.
The balance belongs to the customer identified by id; it is separate from your merchant balances returned by GET /v1/merchant/balance.
Authentication
string
required
Your merchant API key.
Path Parameters
string
required
Customer ID (UUID).
Request Example
curl --request GET \
--url https://api.daya.co/v1/customers/650e8400-e29b-41d4-a716-446655440000/balances \
--header 'X-Api-Key: YOUR_API_KEY'
Response
array
required
Balance entries for the customer. Customer balances currently use
NGN.{
"data": [
{
"customer_id": "650e8400-e29b-41d4-a716-446655440000",
"currency": "NGN",
"available": "125000.00",
"pending": "0.00",
"locked": "0.00"
}
]
}
Using the Balance
To send an NGN bank transfer from this balance, create the transfer with:currency: NGNdebit_currency: NGNdebit_scope: CUSTOMERon_behalf_of.customer_idset to this customer ID
Errors
400: Invalid customer ID.401: Missing or invalid API key.403: Customer NGN balances are not enabled for the environment.404: Customer not found for the authenticated merchant.502: The balance provider could not return the balance.