Piaxis API Documentation
Welcome to the comprehensive Piaxis Piaxis 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:
- External API Endpoints
- Authentication & Security
- SDKs
- Payment Processing API
- Escrow API
- Direct Disbursements API
- Overview
- Public Contract Notes
- How recipient resolution works
- When
recipient_idis needed - Payment-method scope
- Authentication
- Create Disbursement
- Quote Disbursement
- Get Disbursement
- List Disbursements
- Cancel Disbursement
- Marketplace Mapping
- Marketplace collect -> release -> payout example
- Fee Behaviour
- Related References
- Escrow Disbursements API
- Webhook Events & Integration
- Overview
- Contract Split
- Public Contract Notes
- Private Merchant/Developer Management
- Secret Lifecycle
- Merchant/Developer Delivery Pattern
- Public Payment Helper Delivery Pattern
- Merchant/Developer Event Catalog
- Signature Verification
- Consumer Requirements
- Public Helper Event Types
- Minimal Handler Example
- Operational Guidance
- Related References
Quick Links:
Authentication & Security - Authentication methods, OAuth2 flow, security best practices
SDKs - Official SDK packages, import names, and coverage notes
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 |
Request OTP via |
Required Headers
Baseline headers for API-key authenticated requests:
Content-Type: application/json
api-key: YOUR_MERCHANT_API_KEY
User-Agent: YourApp/1.0
Merchant-secured escrow and disbursement routes also require:
X-piaxis-Client-ID: YOUR_MERCHANT_CLIENT_ID
Store that value in your server environment as PIAXIS_CLIENT_ID.
It is required on the merchant-secured route families documented under
Escrows, Direct Disbursements, Escrow Disbursements, and GET /api/merchant-payments.
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://api.gopiaxis.com/api/docs/"
}
}
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 limit/offset pagination:
Request Parameters:
GET /api/merchant-payments?limit=50&offset=0 HTTP/1.1
Response Structure:
{
"total": 1250,
"limit": 50,
"offset": 0,
"results": []
}
Testing & Development
Sandbox Environment
Use the sandbox environment for testing and development:
Base URL:
https://sandbox.api.gopiaxis.com/apiPublic docs:
https://api.gopiaxis.com/api/docs/Access: Request sandbox credentials from Piaxis before running live-flow tests
Test Credentials:
API Key:
YOUR_SANDBOX_API_KEYClient ID:
YOUR_SANDBOX_CLIENT_IDWebhook Secret:
YOUR_SANDBOX_WEBHOOK_SECRET
Test Data
Use the sandbox numbers, cards, and webhook secrets issued for your merchant account. If a scenario requires special fixtures, prefer the examples in this documentation or the SDK sandbox guides.
Development Resources
API Integration
Official SDKs are available for the public Payment API surface:
Python SDK: https://github.com/piaxepay/python-sdk
TypeScript SDK: https://github.com/piaxepay/typescript-sdk
For raw HTTP integrations or for fields not yet wrapped by the SDKs, you can also use 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
AI-friendly Markdown:
/api/docs/piaxis-api-integration-guide.mdAI discovery file:
/api/docs/llms.txtPostman 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",
"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"
}
)
For merchant-secured escrow and disbursement requests, add:
.. sourcecode:: http
X-piaxis-Client-ID: YOUR_MERCHANT_CLIENT_ID
response.raise_for_status()
payment = response.json()
print(f"Payment created: {payment['payment_id']}")
print(f"Status: {payment['status']}")
print(f"Amount: {payment['amount']} {payment['currency']}")
Support Resources
Documentation & Guides
Public docs: https://api.gopiaxis.com/api/docs/
Endpoint catalog: External API Endpoints
Authentication guide: Authentication & Security
SDK reference: SDKs
Developer Support
Email: api-support@gopiaxis.com
Community & Learning
Emergency Support
For critical production issues:
Email: emergency@gopiaxis.com
Include the following information in emergency requests:
Merchant ID
Transaction/Payment ID (if applicable)
Error messages and timestamps
Impact description