Version 2.0

Xaunic Wallet API — Developer Guide

The Xaunic Wallet API allows businesses to integrate mobile money collections and disbursements from their Xaunic Wallet account.

Base URLhttps://wallet.xaunic.net/api

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

  1. Log in to your Xaunic Wallet account.
  2. Navigate to Settings → API Settings.
  3. Copy your API Key and API Secret.
  4. Use these credentials to obtain an access token.

2.2 Obtain channel IDs

  1. Open Collections or Payments.
  2. Select Channels.
  3. Open the required channel.
  4. Record the displayed Channel ID.

3. Authentication

Exchange your API key and secret for an access token, then use that token for subsequent requests.

HeaderRequiredDescription
x-api-keyYesAPI Key
x-api-secretYesAPI Secret
AcceptYesapplication/json
POST /login
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

POST/accounts

Retrieve Accounts

Returns all linked accounts.

POST/accounts/{account_number}

Retrieve Account

Returns a specific account.

POST/collections/create · /payments/create

Retrieve Channels

Returns configured channels.

POST/collections/create/{id} · /payments/create/{id}

Retrieve Channel

Returns a single configured channel.

POST/collections/post · /payments/post

Initiate Transaction

Creates a collection or payout transaction.

POST/collections · /payments

Transaction History

Returns transactions within a date range.

POST/collections/details/{reference} · /payments/details/{reference}

Transaction Details

Returns a single transaction.

Initiate transaction example

POST /payments/post
{
  "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.

POST your callback_url
{
  "reference": "TXN001",
  "status": "SUCCESS",
  "transaction_id": "XAU12345",
  "amount": 10000
}

6. Error codes

HTTPMeaning
200Success
400Bad Request
401Unauthorized
403Forbidden
404Not Found
422Validation Error
500Internal 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
<?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 →