Wallet balance
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.datashop.africa/api/v2/account/wallet-balance', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://app.datashop.africa/api/v2/account/wallet-balance \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.datashop.africa/api/v2/account/wallet-balance"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.datashop.africa/api/v2/account/wallet-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 => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}Wallet
Wallet balance
Check the wallet balance available for API purchases.
GET
/
api
/
v2
/
account
/
wallet-balance
Wallet balance
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.datashop.africa/api/v2/account/wallet-balance', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://app.datashop.africa/api/v2/account/wallet-balance \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.datashop.africa/api/v2/account/wallet-balance"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.datashop.africa/api/v2/account/wallet-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 => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}Check the balance before accepting a purchase through your integration. The value returned is the spendable wallet balance available for new API purchases.
Parameters
No parameters are required.Request
GET /api/v2/account/wallet-balance
Authorization: Bearer YOUR_API_KEY
Successful response
{
"status": true,
"message": "Wallet fetched successfully",
"data": {
"balance": 12500
}
}
Failed response
{
"status": false,
"message": "Error message"
}
⌘I