Fetch balance

The balance API provides an endpoint that allows you to fetch your wallet balance.

curl --request GET \
     --url https://api.waza.co/api/wallets/balance/:currency \
     --header 'waza-x-key: your-api-key' \
const https = require('https')

const options = {
  hostname: 'api.waza.co',
  port: 443,
  path: '/api/countries',
  method: 'GET',
  headers: {
    'x-waza-key': 'YOUR-API-KEY',
  }
}

const req = https.request(options, res => {
  let data = ''

  res.on('data', (chunk) => {
    data += chunk
  });

  res.on('end', () => {
    console.log(JSON.parse(data))
  })
}).on('error', error => {
  console.error(error)
})

req.end()

A successful Balance API call should return a similar response structure as seen below:

{
    "status": "success",
    "message": "Wallet balance fetched successfully!",
    "data": {
        "balance": 0,
        "currency": "NGN"
    }
}

📘

Info

Balances are in the lowest currency value - kobo, pesewas or cent