Getting Started
Set up your API key, understand authentication, and make your first request.
Get your API key
1
Log in to your dashboard
Access your SWIFT-WALLET dashboard using your credentials.
2
Navigate to API Keys
Go to /api_keys.php in your dashboard to manage your API keys.
3
Create or copy your key
Generate a new API key or copy an existing active key for your integration.
Security Tip:
Keep your API keys secret. Never embed them in client-side code or expose them in public repositories.
Authenticate requests
Choose your preferred authentication method. We support multiple ways to authenticate your requests:
Authorization Header
Recommended method
Authorization: Bearer YOUR_API_KEY_HERE
Query Parameter
Simple URL-based auth
?api_key=YOUR_API_KEY_HERE
JSON Body
For POST requests
{
"api_key": "YOUR_API_KEY_HERE"
}
Best Practices:
Use HTTPS in production and rotate keys regularly for enhanced security.
Base URLs
Production
https://swiftwallet.co.ke/v3/
Use this for all production API requests.
API Endpoints
Wallet: https://swiftwallet.co.ke/v3/wallet/
Channels: https://swiftwallet.co.ke/v3/channels/
Fees: https://swiftwallet.co.ke/v3/fees/
STK Push: https://swiftwallet.co.ke/v3/stk-initiate/
Transactions: https://swiftwallet.co.ke/v3/transactions/
B2C: https://swiftwallet.co.ke/v3/pay-request/
Channels API
Manage payment channels and retrieve available payment methods for your integration.
Get Available Channels
curl -X GET "https://swiftwallet.co.ke/v3/channels/" \
-H "Authorization: Bearer YOUR_API_KEY"
Expected Response
{
"success": true,
"data": {
"channels": [
{
"id": 1,
"name": "Paybill",
"type": "paybill"
},
{
"id": 2,
"name": "Till Number",
"type": "till"
}
]
},
"timestamp": "2024-01-15T10:30:00+00:00"
}
Your First Request
Check your wallet balances to verify your API key is working correctly.
curl -X GET "https://swiftwallet.co.ke/v3/wallet/" \
-H "Authorization: Bearer YOUR_API_KEY"
Expected Response
{
"success": true,
"data": {
"user_id": 123,
"balances": {
"service_wallet_balance": 1250.00,
"payments_wallet_balance": 750.50
}
},
"timestamp": "2024-01-15T10:30:00+00:00"
}