Skip to main content

Wallet API

The Wallet API allows merchants to view and manage their Zikopay wallet balances. Each merchant account has one or more wallets (based on supported currencies) to hold funds from payment transactions and to fund outgoing payouts.

Get Wallet Balances

This endpoint retrieves the current balances for all your wallets.

Endpoint

GET /wallet

Headers

NameDescription
X-API-KeyYour Zikopay API Key
X-API-SecretYour Zikopay API Secret
AcceptMust be application/json

Example Request

GET https://api.payment.zikopay.com/v1/wallet

Success Response

{
"wallets": [
{
"id": "wal_5f3a9b2e8c4d7",
"currency": "XAF",
"balance": 150000.00,
"pending_balance": 15000.00,
"reserved_balance": 5000.00,
"available_balance": 130000.00,
"last_updated": "2025-04-18T08:30:15Z"
},
{
"id": "wal_6e2b8c3f9d5a6",
"currency": "XOF",
"balance": 75000.00,
"pending_balance": 7500.00,
"reserved_balance": 2500.00,
"available_balance": 65000.00,
"last_updated": "2025-04-18T09:15:22Z"
}
]
}

Error Response

{
"success": false,
"message": "Failed to retrieve wallets",
"errors": {
"authentication": ["Invalid API credentials"]
}
}

Response Parameters

ParameterTypeDescription
idstringUnique wallet identifier
currencystringWallet currency code
balancenumberTotal wallet balance
pending_balancenumberFunds that are pending settlement
reserved_balancenumberFunds reserved for pending payouts
available_balancenumberFunds available for payouts (balance - reserved_balance)
last_updatedstringISO8601 timestamp when balance was last updated

Get Wallet Transactions

This endpoint retrieves transaction history for a specific wallet or all wallets.

Endpoint

GET /wallet/transactions

Headers

NameDescription
X-API-KeyYour Zikopay API Key
X-API-SecretYour Zikopay API Secret
AcceptMust be application/json

Query Parameters

ParameterTypeRequiredDescription
wallet_idstringNoFilter by specific wallet ID
currencystringNoFilter by currency (e.g., XAF, XOF)
typestringNoFilter by transaction type (payin, payout, adjustment)
statusstringNoFilter by transaction status
from_datestringNoStart date for filtering (YYYY-MM-DD)
to_datestringNoEnd date for filtering (YYYY-MM-DD)
pageintegerNoPage number for pagination (default: 1)
limitintegerNoNumber of records per page (default: 20, max: 100)

Example Request

GET https://api.payment.zikopay.com/v1/wallet/transactions?currency=XAF&from_date=2025-04-01&to_date=2025-04-18&limit=10

Success Response

{
"success": true,
"message": "Transactions retrieved successfully",
"data": {
"transactions": [
{
"id": "txn_8f7e6d5c4b3a2",
"reference": "TXN174506674372585E",
"type": "payin",
"amount": 10000.00,
"fee": 350.00,
"net_amount": 9650.00,
"currency": "XAF",
"status": "completed",
"operator": "orange_cm",
"customer_name": "John Doe",
"description": "Payment for order #12345",
"created_at": "2025-04-15T14:30:45Z"
},
{
"id": "txn_7e6d5c4b3a2f1",
"reference": "TXN174506674372586F",
"type": "payout",
"amount": 5000.00,
"fee": 175.00,
"net_amount": 5175.00,
"currency": "XAF",
"status": "completed",
"operator": "mtn_cm",
"customer_name": "Jane Smith",
"description": "Vendor payment",
"created_at": "2025-04-16T10:15:30Z"
}
// Additional transactions...
],
"pagination": {
"total": 45,
"count": 10,
"per_page": 10,
"current_page": 1,
"total_pages": 5,
"links": {
"next": "https://api.payment.zikopay.com/v1/wallet/transactions?page=2&limit=10&currency=XAF&from_date=2025-04-01&to_date=2025-04-18"
}
}
}
}

Error Response

{
"success": false,
"message": "Failed to retrieve transactions",
"errors": {
"from_date": ["Invalid date format, use YYYY-MM-DD"]
}
}

Response Parameters

Transaction Object

ParameterTypeDescription
idstringUnique transaction identifier
referencestringTransaction reference
typestringTransaction type: payin, payout, or adjustment
amountnumberTransaction amount
feenumberFee charged for the transaction
net_amountnumberNet amount (payins: amount - fee, payouts: amount + fee)
currencystringTransaction currency
statusstringTransaction status
operatorstringPayment operator used
customer_namestringCustomer name
descriptionstringTransaction description
created_atstringISO8601 timestamp when the transaction was created

Pagination Object

ParameterTypeDescription
totalintegerTotal number of transactions matching the criteria
countintegerNumber of transactions in the current page
per_pageintegerNumber of transactions per page
current_pageintegerCurrent page number
total_pagesintegerTotal number of pages
linksobjectNavigation links for pagination

Get Wallet Balance Summary

This endpoint provides a summary of all wallet balances across currencies.

Endpoint

GET /wallet/summary

Headers

NameDescription
X-API-KeyYour Zikopay API Key
X-API-SecretYour Zikopay API Secret
AcceptMust be application/json

Example Request

GET https://api.payment.zikopay.com/v1/wallet/summary

Success Response

{
"success": true,
"message": "Wallet summary retrieved successfully",
"data": {
"total_balance_summary": [
{
"currency": "XAF",
"total_balance": 150000.00,
"total_available": 130000.00,
"total_pending": 15000.00,
"total_reserved": 5000.00
},
{
"currency": "XOF",
"total_balance": 75000.00,
"total_available": 65000.00,
"total_pending": 7500.00,
"total_reserved": 2500.00
}
],
"transaction_summary": {
"last_30_days": {
"total_payin_count": 120,
"total_payin_amount": 250000.00,
"total_payout_count": 45,
"total_payout_amount": 125000.00,
"total_fee_amount": 9375.00
}
}
}
}

Code Examples

Get Wallet Balances

PHP

<?php
$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.payment.zikopay.com/v1/wallet",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Accept: application/json",
"X-API-Key: your_api_key",
"X-API-Secret: your_api_secret"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
$data = json_decode($response, true);
if ($data['success']) {
foreach ($data['data'] as $wallet) {
echo "Currency: " . $wallet['currency'] . "\n";
echo "Available Balance: " . $wallet['available_balance'] . "\n";
echo "Total Balance: " . $wallet['balance'] . "\n";
echo "-------------------\n";
}
} else {
echo "Error: " . $data['message'];
}
}
?>

JavaScript

const getWalletBalances = async () => {
try {
const response = await fetch('https://api.payment.zikopay.com/v1/wallet', {
method: 'GET',
headers: {
'Accept': 'application/json',
'X-API-Key': 'your_api_key',
'X-API-Secret': 'your_api_secret'
}
});

const data = await response.json();

if (data.success) {
data.data.forEach(wallet => {
console.log(`Currency: ${wallet.currency}`);
console.log(`Available Balance: ${wallet.available_balance}`);
console.log(`Total Balance: ${wallet.balance}`);
console.log('-------------------');
});
return data.data;
} else {
console.error('Failed to retrieve wallets:', data.message);
return null;
}
} catch (error) {
console.error('Error:', error);
return null;
}
};

Python

import requests

url = "https://api.payment.zikopay.com/v1/wallet"

headers = {
'Accept': 'application/json',
'X-API-Key': 'your_api_key',
'X-API-Secret': 'your_api_secret'
}

response = requests.get(url, headers=headers)

if response.status_code == 200:
data = response.json()
if data['success']:
for wallet in data['data']:
print(f"Currency: {wallet['currency']}")
print(f"Available Balance: {wallet['available_balance']}")
print(f"Total Balance: {wallet['balance']}")
print('-------------------')
else:
print(f"Error: {data['message']}")
else:
print(f"HTTP Error: {response.status_code}")

Get Wallet Transactions

PHP

<?php
// Set parameters
$params = [
'currency' => 'XAF',
'from_date' => '2025-04-01',
'to_date' => '2025-04-18',
'limit' => 10
];

$queryString = http_build_query($params);
$url = "https://api.payment.zikopay.com/v1/wallet/transactions?" . $queryString;

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Accept: application/json",
"X-API-Key: your_api_key",
"X-API-Secret: your_api_secret"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
$data = json_decode($response, true);
if ($data['success']) {
// Display transaction information
foreach ($data['data']['transactions'] as $transaction) {
echo "Reference: " . $transaction['reference'] . "\n";
echo "Type: " . $transaction['type'] . "\n";
echo "Amount: " . $transaction['amount'] . " " . $transaction['currency'] . "\n";
echo "Status: " . $transaction['status'] . "\n";
echo "Date: " . $transaction['created_at'] . "\n";
echo "-------------------\n";
}

// Display pagination information
echo "Page " . $data['data']['pagination']['current_page'] . " of " . $data['data']['pagination']['total_pages'] . "\n";
echo "Total records: " . $data['data']['pagination']['total'] . "\n";
} else {
echo "Error: " . $data['message'];
}
}
?>

Understanding Wallet Balances

Zikopay wallets maintain several balance types to accurately track funds:

Balance Types

  • Total Balance: The sum of all funds in the wallet
  • Available Balance: Funds available for immediate use (Total Balance - Reserved Balance)
  • Pending Balance: Funds that are being processed but have not yet settled
  • Reserved Balance: Funds that are allocated for pending payouts

How Balances Change

  • Pay-ins: When a customer makes a payment, the funds initially go to Pending Balance
  • Settlement: After the payment processor settles funds (typically 1-2 business days), they move from Pending to Available Balance
  • Payout Initiation: When you initiate a payout, the funds move from Available to Reserved Balance
  • Payout Completion: After the payout is processed, the funds (plus fees) are deducted from Reserved Balance

Regional Considerations

  • Currency Support: Different countries use different currencies (XAF, XOF, NGN, GHS)
  • Settlement Times: Settlement times vary by country and payment method
  • Foreign Exchange: Currently, Zikopay does not support automatic currency conversion between wallets

Best Practices

  1. Regular Reconciliation: Reconcile your Zikopay wallet balance with your internal accounting systems regularly
  2. Reserve Planning: Maintain sufficient balance for planned payouts
  3. Balance Monitoring: Implement automated monitoring for low balances
  4. Transaction Review: Regularly review wallet transactions to identify anomalies

Notes

  • Wallet balances are updated in real-time
  • Historical transaction data is available for the past 90 days via the API
  • For older transactions, please contact Zikopay support
  • All balance queries are subject to the standard API rate limits