REST API · v1.0.0

Build on
ThirdMoney.

Integrate African payment infrastructure into your product. RESTful API, instant webhooks, multi-currency support, and a sandbox to build freely — all from a single key.

REST API JSON Responses Webhook Events Sandbox Included Bearer Auth Multi-Currency
terminal
live
# Check API health
curl https://thirdmoney.digital/api/health
# Response
{ "status": "ok", "version": "1.0.0", "time": "2ms" }
Start Here

Getting Started

Three steps from zero to live API calls. Takes about 10 minutes.

Step 1

Create Your Account

Register at thirdmoney.digital/register. After creating your account, navigate to your Dashboard and open the Merchant tab.

Dashboard → Merchant
Step 2

Register Your Business

Fill in your business name, category, and website URL. Applications are reviewed by our team within 24 hours. You'll receive an email notification once approved.

Business Name Category Website URL
Step 3

Get Your API Keys

Once approved, your API key and secret are instantly available in the Merchant section of your dashboard. You'll get both a live key and a sandbox key for testing.

tm_live_•••••••••••• tm_test_••••••••••••
Security

Authentication

ThirdMoney uses Bearer tokens in the Authorization header. There are two token types depending on the endpoint.

auth-example.sh
Bearer Token
# Authenticated request using JWT
curl -X GET https://thirdmoney.digital/api/me \
-H "Authorization: Bearer YOUR_JWT_TOKEN"

Two token types

Merchant endpoints use your API key (from your dashboard) as the Bearer token in an X-TM-Key header. User endpoints use the JWT returned by POST /api/auth/login. Tokens expire after 24 hours — use /api/auth/refresh to rotate.

Reference

API Endpoints

Base URL: https://thirdmoney.digital  ·  All requests and responses use application/json.

Auth

No authentication required. Used for account creation and login.

POST /api/auth/register
POST /api/auth/login
POST /api/auth/refresh

Wallet & Transfers

Send, receive, deposit, and withdraw funds from your wallet.

GET /api/me
GET /api/wallets
POST /api/send/preview
POST /api/send
POST /api/deposit/initiate
POST /api/withdraw
GET /api/transactions

Savings Groups

Create and manage group savings circles.

GET /api/groups
POST /api/groups
POST /api/groups/:id/contribute

Fundraising Campaigns

Create and fund public or private campaigns.

GET /api/campaigns/browse
POST /api/campaigns
POST /api/campaigns/:id/contribute

Merchant

Manage your merchant profile, payments, and API keys.

GET /api/merchant
POST /api/merchant/register
GET /api/merchant/payments
POST /api/merchant/rotate-key

Health

Service status and version info.

GET /health
Examples

Request & Response

A complete example using the Send Money endpoint — one of the most common API interactions.

POST /api/send
Request
Authorization: Bearer <token>
{
"recipient": "john_doe",
"amount": 50000,
"currency": "UGX",
"note": "Rent payment",
"pin": "1234"
}
200 application/json
Response
{
"success": true,
"message": "Transfer successful",
"data": {
"reference": "TM-9X2K4F",
"amount": 50000,
"currency": "UGX",
"fee": 500,
"recipient_gets": 49500
}
}
Merchant

Accepting Merchant Payments

Use your API key to initiate payment requests from your backend. Set a callback_url and we'll notify you instantly when the payment completes.

<?php
$response = file_get_contents('https://thirdmoney.digital/api/pay', false,
stream_context_create(['http' => [
'method' => 'POST',
'header' => "Content-Type: application/json\r\n" .
"X-TM-Key: tm_live_your_key_here\r\n",
'content' => json_encode([
'amount' => 50000,
'currency' => 'UGX',
'description' => 'Order #1042',
'callback_url' => 'https://yourshop.com/payment/callback',
])
]]);
$result = json_decode($response, true);
Real-time

Webhooks

Register a callback_url on your payment requests. ThirdMoney will send a POST request to that URL whenever the payment status changes. Webhooks are signed with your merchant secret — always verify before processing.

Payment Events

payment.completed

A payment was successfully processed and funds settled.

payment.failed

A payment attempt failed. Check the error field in the payload.

payment.pending

Payment initiated, awaiting confirmation from the provider.

payment.refunded

A payment was refunded back to the sender.

webhook-payload.json
POST to your callback_url
{
"event": "payment.completed",
"data": {
"reference": "TM-9X2K4F",
"amount": 50000,
"currency": "UGX",
"merchant_id": "your-merchant-id",
"timestamp": 1748390400
}
}
Africa & Beyond

Supported Currencies

Multi-currency wallets across Africa and international transfers. More currencies coming soon.

🇺🇬
UGX
Ugandan Shilling
Uganda
🇰🇪
KES
Kenyan Shilling
Kenya
🇹🇿
TZS
Tanzanian Shilling
Tanzania
🇷🇼
RWF
Rwandan Franc
Rwanda
🇳🇬
NGN
Nigerian Naira
Nigeria
🇿🇦
ZAR
South African Rand
South Africa
🌍
USD
US Dollar
International
Errors

Error Handling

ThirdMoney uses standard HTTP status codes. Errors return a JSON body with a message and sometimes an errors object for validation failures.

Code Meaning
200 Success
201 Created
400 Bad Request
401 Unauthorized
403 Forbidden
404 Not Found
422 Validation Error
429 Rate Limited
500 Server Error
422 Validation Error Example
{
"success": false,
"message": "Validation failed",
"errors": {
"amount": "Amount must be greater than 0",
"currency": "Currency is required"
}
}
Libraries

SDKs & Libraries

Official and community client libraries. Can't find yours? The REST API works with any HTTP client.

PHP
Full support · v1.0
Official
composer require thirdmoney/sdk
JavaScript
Node.js + Browser · v1.0
Official
npm install @thirdmoney/js
Python
Python 3.8+ · community
Community
pip install thirdmoney
Go
Go 1.18+ · community
Community
go get github.com/thirdmoney/go-sdk

All SDKs on GitHub

Open source. PRs welcome. Found a bug? Open an issue.

View