Disbursements
Check your balance
In a nutshell
Check your Paystack balance before you create a transfer, so the request doesn't fail for insufficient funds.
You can only send what you have. We run a balance check before creating a transfer request. If you donβt have sufficient funds (inclusive of fees), the transfer request would fail with a Your balance is not enough to fulfill this request message.
Copy linkFetch your balance
You can set up an automation to fetch your Paystack balance before initiating a transfer request. To fetch your Paystack balance, make a GET request to the check balanceAPI endpoint:
GETapi.paystack.co/balance
curl https://api.paystack.co/balance \
-H "Authorization: Bearer $PAYSTACK_SECRET_KEY"const https = require("https");
const options = {
hostname: "api.paystack.co",
port: 443,
path: "/balance",
method: "GET",
headers: {
Authorization: `Bearer ${process.env.PAYSTACK_SECRET_KEY}`,
},
};
const req = https.request(options, (res) => {
let data = "";
res.on("data", (chunk) => {
data += chunk;
});
res.on("end", () => {
console.log(res.statusCode, JSON.parse(data));
});
});
req.on("error", (error) => {
console.error(error);
});
req.end();<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.paystack.co/balance",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer " . getenv("PAYSTACK_SECRET_KEY"),
"Cache-Control: no-cache",
),
));
$response = curl_exec($curl);
echo curl_getinfo($curl, CURLINFO_HTTP_CODE) . " " . $response;
?>The data parameter in the response object is an array of objects. This is because you can have more than one currency on your integration.
Amount in subunits
Each balance parameter in the data array is the subunit of your currency. Depending on how you manage amount on your integration, you can either divide the balance by 100 or compare directly with your transfer amount which is already in the subunit.
Copy linkWhy funds aren't available yet
A successful customer payment doesn't become transfer balance straight away. Paystack settles the funds first, based on your account setup and settlement schedule, so money you collected a few minutes ago may not be available to send yet. The balance endpoint shows what you can send right now.
Treat an insufficient balance as a normal case in your payout logic: check the balance, and wait or top up when it doesn't cover the amount plus fees. To see when collected funds settle, review your settlement history on the Paystack Dashboard.