External API Documentation
Welcome to the comprehensive Piaxis External API documentation. This guide provides everything developers need to integrate with Piaxis’s payment platform, including escrow services, direct payments, disbursements, and webhook notifications.
Overview
The Piaxis External API enables merchants and partners to integrate payment processing, escrow services, and disbursement capabilities into their applications. Our API supports multiple payment methods across East Africa and provides robust features for secure financial transactions.
Key Capabilities: - Direct Payments: Process immediate payments via mobile money, cards, and Piaxis wallet - Escrow Services: Secure transaction management with customizable terms and conditions - Direct Disbursements: Immediate bulk payments to multiple recipients for payroll, refunds, and rewards - Escrow Disbursements: Conditional bulk payments requiring fulfillment before release - Real-time Webhooks: Instant notifications for all transaction events - Multi-currency Support: Handle transactions in UGX, USD, and other supported currencies
Getting Started: 1. Authentication & Security - Set up API authentication and security 2. Payment Processing API - Process direct payments without escrow 3. Escrow API - Implement secure escrow transactions 4. Direct Disbursements API - Process direct bulk payments to multiple recipients 5. Escrow Disbursements API - Manage conditional bulk payouts with fulfillment terms 6. Webhook Events & Integration - Handle real-time event notifications
API Documentation
Core Services
Core API Services:
Quick Links:
Authentication & Security - Authentication methods, OAuth2 flow, security best practices
Payment Processing API - Direct payment processing with comprehensive examples
Escrow API - Escrow transactions, term fulfillment, release and reverse operations
Direct Disbursements API - Direct bulk payments with immediate processing and comprehensive examples
Escrow Disbursements API - Conditional bulk payments with term fulfillment requirements
Webhook Events & Integration - Event handling, security, monitoring, and integration examples
API Fundamentals
Base URLs
Environment |
Base URL |
|---|---|
All environments |
|
Authentication Methods
The piaxis API supports multiple authentication methods depending on your use case:
Method |
Use Case |
Required Headers |
|---|---|---|
API Key |
Server-to-server integrations |
|
OAuth2 |
User-authorized transactions |
|
OTP Verification |
Sensitive operations |
|
Required Headers
All API requests must include these headers:
Content-Type: application/json
api-key: YOUR_MERCHANT_API_KEY
User-Agent: YourApp/1.0
Optional but Recommended:
X-Idempotency-Key: unique_request_id
X-Request-ID: custom_tracking_id
Supported Payment Methods
Method |
Description |
Countries |
Processing Time |
|---|---|---|---|
|
MTN Mobile Money |
Uganda, Rwanda, Ghana |
30-60 seconds |
|
Airtel Money |
Uganda, Kenya, Tanzania |
30-60 seconds |
|
Visa/Mastercard |
All supported countries |
5-10 seconds |
|
External piaxis Wallet |
All supported countries |
5-15 seconds |
Supported Currencies
Code |
Currency |
Supported Payment Methods |
|---|---|---|
|
Ugandan Shilling |
mtn, airtel, card, piaxis_external |
|
US Dollar |
card, piaxis_external |
|
Euro |
card, piaxis_external |
Rate Limiting
The piaxis API implements rate limiting to ensure fair usage and system stability:
Standard Limits
Endpoint Category |
Rate Limit |
Reset Period |
|---|---|---|
Authentication |
100 requests/hour |
Rolling hour |
Payment Creation |
1,000 requests/hour |
Rolling hour |
Escrow Operations |
500 requests/hour |
Rolling hour |
Data Retrieval (GET) |
5,000 requests/hour |
Rolling hour |
Webhooks (outbound) |
No limit |
N/A |
Rate Limit Headers
All API responses include rate limiting information:
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 995
X-RateLimit-Reset: 1642694400
X-RateLimit-Retry-After: 3600
Handling Rate Limits:
When you exceed rate limits, the API returns HTTP 429 with retry information:
{
"error": {
"code": "RATE_LIMIT_EXCEEDED",
"message": "Rate limit exceeded. Try again later.",
"retry_after": 3600
}
}
Response Format
Standard Response Structure
All successful API responses follow this structure:
{
"status": "success",
"data": {},
"meta": {
"request_id": "req_1234567890abcdef",
"timestamp": "2024-01-15T10:30:00Z",
"api_version": "2024-01-01"
}
}
Error Response Structure
Error responses provide detailed information for debugging:
{
"error": {
"code": "VALIDATION_ERROR",
"message": "One or more fields are invalid",
"details": {
"field": "amount",
"reason": "Amount must be greater than 0"
},
"timestamp": "2024-01-15T10:30:00Z",
"request_id": "req_1234567890abcdef",
"documentation_url": "https://docs.gopiaxis.com/errors/validation"
}
}
Common Error Codes
HTTP Code |
Error Code |
Description |
|---|---|---|
400 |
|
Request data is invalid or malformed |
401 |
|
API key is invalid or missing |
403 |
|
Insufficient permissions for this operation |
404 |
|
Requested resource does not exist |
409 |
|
Request conflicts with current state |
429 |
|
Too many requests, retry later |
500 |
|
Server error, contact support |
502 |
|
External payment provider error |
Idempotency
The piaxis API supports idempotency for safe request retries. Include an idempotency key in your requests:
POST /api/payments/create HTTP/1.1
Host: api.gopiaxis.com
Content-Type: application/json
api-key: YOUR_API_KEY
X-Idempotency-Key: unique_key_12345
Benefits: - Prevents duplicate transactions on network failures - Safe to retry failed requests - Guarantees exactly-once processing
Key Requirements: - Use unique keys for each logical request - Keys can be reused for identical retry attempts - Keys expire after 24 hours
Pagination
List endpoints support cursor-based pagination:
Request Parameters:
GET /api/payments?limit=50&offset=0&sort=created_at:desc HTTP/1.1
Response Structure:
{
"status": "success",
"data": {
"items": [],
"pagination": {
"total": 1250,
"limit": 50,
"offset": 0,
"has_more": true,
"next_cursor": "cursor_abc123"
}
}
}
Testing & Development
Sandbox Environment
Use the sandbox environment for testing and development:
Base URL:
https://sandbox-api.gopiaxis.comDashboard:
https://sandbox-dashboard.gopiaxis.comTest Data: Predefined test phone numbers, cards, and scenarios
Test Credentials:
API Key:
pk_test_1234567890abcdefClient ID:
test_096b723a-45c5-4957-94d7-747835136265Webhook Secret:
whsec_test_abcdef1234567890
Test Data
Test Phone Numbers:
Success:
+256700000000to+256700000050Failure:
+256700000051to+256700000099Insufficient Funds:
+256700001000Timeout:
+256700002000
Test Card Numbers:
Visa Success:
4111111111111111Visa Decline:
4000000000000002Mastercard Success:
5555555555554444Mastercard Insufficient:
5105105105105100
Development Resources
API Integration
Since official SDKs are currently under development, you can integrate with piaxis using standard HTTP clients in your preferred language:
Python: Use
requestsorhttpxlibraryNode.js: Use
axiosorfetchPHP: Use
GuzzleorcURLRuby: Use
HTTPartyorNet::HTTP
Development Tools
API Reference: Available in this documentation
Postman Collection: Contact support for access
OpenAPI Spec:
/openapi.jsonendpoint on API serverTesting Environment: Sandbox environment available
Example Integration
Quick Start Example
Here’s a complete example of processing a payment:
import requests
# 1. Create a payment
payment_data = {
"amount": 50000,
"currency": "UGX",
"payment_method": "mtn",
"reference": "ORDER-2024-001",
"description": "Product purchase",
"user_info": {
"email": "[email protected]",
"phone_number": "+256700000000",
"name": "John Doe"
}
}
response = requests.post(
"https://api.gopiaxis.com/api/payments/create",
json=payment_data,
headers={
"api-key": "YOUR_API_KEY",
"Content-Type": "application/json"
}
)
if response.status_code == 200:
payment = response.json()
print(f"Payment created: {payment['data']['payment_id']}")
print(f"Status: {payment['data']['status']}")
print(f"Payment URL: {payment['data']['payment_url']}")
else:
print(f"Error: {response.text}")
Support Resources
Documentation & Guides
API Reference: https://docs.gopiaxis.com/api/
Integration Guides: https://docs.gopiaxis.com/guides/
Best Practices: https://docs.gopiaxis.com/best-practices/
Developer Support
Email: api-support@gopiaxis.com
Developer Forum: https://forum.gopiaxis.com/
GitHub: https://github.com/piaxis/
Status Page: https://status.gopiaxis.com/
Community & Learning
Developer Newsletter: https://gopiaxis.com/newsletter/
Webinars: https://gopiaxis.com/webinars/
Case Studies: https://gopiaxis.com/case-studies/
Emergency Support
For critical production issues:
Email: emergency@gopiaxis.com
Phone: +256-XXX-XXXX (24/7 for enterprise customers)
Slack: Available for enterprise customers
Include the following information in emergency requests:
Merchant ID
Transaction/Payment ID (if applicable)
Error messages and timestamps
Impact description