ChapSmart API
Bitcoin-to-mobile-money infrastructure for Tanzania. Send remittances, buy airtime, and purchase sats — all via Lightning Network with real-time pricing and sub-minute settlement.
Authentication
All API requests require authentication via API key headers. Contact our team to receive your credentials.
// Required headers for every request { "X-API-Key": "your_api_key", "X-API-Secret": "your_api_secret", "Content-Type": "application/json" }
Tiers & Fee Structure
Fees decrease as cumulative transaction volume grows. Tiers are calculated across all transaction types (remittance + airtime).
| Tier | Cumulative Volume | Remittance Fee |
|---|---|---|
| Bronze | 0 – 5,000,000 TZS | 1.87% |
| Silver | 5,000,001 – 25,000,000 TZS | 1.55% |
| Gold | 25,000,001+ TZS | 1.32% |
Authentication
Create anonymous accounts and authenticate users. No personal data required.
{}{
"success": true,
"accountNumber": "4071156462128684",
"message": "Account created successfully"
}{
"accountNumber": "4071156462128684"
}{
"success": true,
"accountNumber": "4071156462128684",
"message": "Login successful"
}Remittance
Send Bitcoin via Lightning and deliver TZS to any Vodacom M-Pesa number. Flow: Quote → Generate Invoice → Pay → Auto-delivery.
{
"metadata": {
"amountTZS": 25000,
"phoneNumber": "0741000000",
"recipientName": "John Doe",
"accountNumber": "4071156462128684"
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
| amountTZS | number | required | Amount in TZS (2,500 – 1,000,000) |
| phoneNumber | string | required | Vodacom M-Pesa number (07XX format) |
| recipientName | string | required | First and last name of recipient |
| accountNumber | string | required | Your 16-digit account number |
{
"success": true,
"quoteId": "abc123...",
"youPay": {
"sats": 14680,
"btc": "0.00014680",
"feeSats": 270,
"feePercent": 1.87
},
"userTier": "BRONZE"
}{
"quoteId": "abc123..."
}{
"success": true,
"invoiceId": "XYZ789...",
"bolt11": "lnbc...",
"checkoutLink": "https://pay.chapsmart.com/i/XYZ789",
"youPay": { "sats": 14680 }
}window.webln.sendPayment(bolt11) for one-click payment.{
"success": true,
"invoiceId": "XYZ789...",
"status": "completed",
"message": "Payment confirmed and M-Pesa sent!",
"type": "remittance"
}| Status | Meaning |
|---|---|
| pending | Waiting for Lightning payment |
| settled | Payment received, payout processing |
| completed | Payout delivered to recipient |
| expired | Invoice expired (not paid in time) |
| failed | Payout failed (support will resolve) |
Airtime Top-Up
Buy airtime for any Tanzanian mobile number using Lightning. Same flow: Quote → Generate → Pay → Delivered.
{
"metadata": {
"amountTZS": 1000,
"phoneNumber": "255741000000",
"accountNumber": "4071156462128684"
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
| amountTZS | number | required | Airtime amount (500 – 15,000 TZS) |
| phoneNumber | string | required | Phone number in 255 format (e.g. 255741000000) |
| accountNumber | string | required | Your 16-digit account number |
{
"quoteId": "airtime_quote_id..."
}Buy Sats
Purchase Bitcoin with M-Pesa. Flow: Quote → User pays M-Pesa → Submit transaction ID + BOLT11 → Sats delivered.
{
"amountTZS": 10000,
"accountNumber": "4071169462128684"
}{
"success": true,
"quoteId": "buy_quote_id...",
"calculatedSats": 5870,
"btcPrice": 97500
}| Parameter | Type | Required | Description |
|---|---|---|---|
| amountTZS | number | required | Amount to spend (1,000 – 20,000 TZS) |
| accountNumber | string | required | Your 16-digit account number |
{
"quoteId": "buy_quote_id...",
"mpesaId": "XKR4MPT9QZN",
"bolt11": "lnbc5870n1p..."
}{
"success": true,
"satsSent": 5870,
"message": "Sats delivered to your wallet"
}Data & History
Retrieve transaction history and account statistics.
{
"accountNumber": "4071169462128684"
}{
"success": true,
"transactions": [
{
"type": "remittance",
"amount": 25000,
"status": "completed",
"phoneNumber": "0741***890",
"createdAt": "2026-03-14T09:41:00Z"
}
],
"stats": {
"totalTransactions": 12
}
}{
"success": true,
"userTier": "BRONZE",
"feePercent": 1.87,
"cumulativeAmount": 450000,
"progressToNext": 4550000,
"nextTier": "SILVER",
"progressPercent": 9
}Error Handling
All errors return a consistent JSON structure with an error message.
{
"success": false,
"error": "Description of what went wrong"
}| Code | Meaning |
|---|---|
| 400 | Bad request — missing or invalid parameters |
| 403 | Forbidden — account not found or inactive |
| 404 | Not found — resource doesn't exist |
| 409 | Conflict — quote already used |
| 410 | Gone — quote has expired |
| 500 | Server error — contact support |
Support
Need help integrating? Contact our developer support team.