1. Introduction
Xaunic Wallet handles money in both directions. Use collections to pull funds from customers into your wallet, and payments to disburse from your wallet balance to mobile money or bank recipients. Both flows share the same authentication, channel and callback model.
2. Getting started
2.1 Obtain API credentials
- Log in to your Xaunic Wallet account.
- Navigate to Settings → API Settings.
- Copy your API Key and API Secret.
- Use these credentials to obtain an access token.
2.2 Obtain channel IDs
- Open Collections or Payments.
- Select Channels.
- Open the required channel.
- Record the displayed Channel ID.
3. Authentication
Exchange your API key and secret for an access token, then use that token for subsequent requests.
| Header | Required | Description |
|---|---|---|
| x-api-key | Yes | API Key |
| x-api-secret | Yes | API Secret |
| Accept | Yes | application/json |
curl -X POST https://wallet.xaunic.net/api/login \
-H "x-api-key: YOUR_API_KEY" \
-H "x-api-secret: YOUR_API_SECRET" \
-H "Accept: application/json"4. API reference
/accountsRetrieve Accounts
Returns all linked accounts.
/accounts/{account_number}Retrieve Account
Returns a specific account.
/collections/create · /payments/createRetrieve Channels
Returns configured channels.
/collections/create/{id} · /payments/create/{id}Retrieve Channel
Returns a single configured channel.
/collections/post · /payments/postInitiate Transaction
Creates a collection or payout transaction.
/collections · /paymentsTransaction History
Returns transactions within a date range.
/collections/details/{reference} · /payments/details/{reference}Transaction Details
Returns a single transaction.
Initiate transaction example
{
"reference": "TXN001",
"channel_id": 28,
"phone_number": "256701234567",
"amount": 10000,
"reason": "Invoice Payment",
"callback_url": "https://example.com/api/callback"
}The same payload shape applies to POST /collections/post, using a collection channel ID.
5. Callback specification
Your callback endpoint receives asynchronous transaction status updates.
{
"reference": "TXN001",
"status": "SUCCESS",
"transaction_id": "XAU12345",
"amount": 10000
}6. Error codes
| HTTP | Meaning |
|---|---|
| 200 | Success |
| 400 | Bad Request |
| 401 | Unauthorized |
| 403 | Forbidden |
| 404 | Not Found |
| 422 | Validation Error |
| 500 | Internal Error |
7. Security best practices
- Never expose API credentials.
- Always use HTTPS.
- Rotate API secrets periodically.
- Validate callback payloads.
- Use unique transaction references.
- Log API activity excluding secrets.
8. Sample code
A minimal PHP gateway wrapper
<?php
$base = "https://wallet.xaunic.net/api";
function xaunic_post($path, $payload, $token) {
$ch = curl_init($GLOBALS['base'] . $path);
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer $token",
"Accept: application/json",
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode($payload),
]);
$res = curl_exec($ch);
curl_close($ch);
return json_decode($res, true);
}
// Payout from the wallet
xaunic_post("/payments/post", [
"reference" => "TXN001",
"channel_id" => 28,
"phone_number" => "256701234567",
"amount" => 10000,
"reason" => "Invoice Payment",
"callback_url" => "https://example.com/api/callback",
], $token);Get your API credentials
Create channels and copy your API key and secret from the wallet portal.
Go to Wallet Portal →