// Start of Selection

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

Quick Links:

API Fundamentals

Base URLs

Environment

Base URL

Production

https://api.gopiaxis.com

Sandbox

https://sandbox-api.gopiaxis.com

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

api-key: YOUR_API_KEY

OAuth2

User-authorized transactions

Authorization: Bearer <token>

OTP Verification

Sensitive operations

X-Verification-Token: <token>

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

MTN Mobile Money

Uganda, Rwanda, Ghana

30-60 seconds

airtel

Airtel Money

Uganda, Kenya, Tanzania

30-60 seconds

card

Visa/Mastercard

All supported countries

5-10 seconds

piaxis_external

External Piaxis Wallet

All supported countries

5-15 seconds

Supported Currencies

Code

Currency

Supported Payment Methods

UGX

Ugandan Shilling

mtn, airtel, card, piaxis_external

USD

US Dollar

card, piaxis_external

EUR

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": {
    // Response data specific to the endpoint
  },
  "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

VALIDATION_ERROR

Request data is invalid or malformed

401

AUTHENTICATION_ERROR

API key is invalid or missing

403

AUTHORIZATION_ERROR

Insufficient permissions for this operation

404

NOT_FOUND

Requested resource does not exist

409

CONFLICT

Request conflicts with current state

429

RATE_LIMIT_EXCEEDED

Too many requests, retry later

500

INTERNAL_ERROR

Server error, contact support

502

PROVIDER_ERROR

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.com

  • Dashboard: https://sandbox-dashboard.gopiaxis.com

  • Test Data: Predefined test phone numbers, cards, and scenarios

Test Credentials: - API Key: pk_test_1234567890abcdef - Client ID: test_096b723a-45c5-4957-94d7-747835136265 - Webhook Secret: whsec_test_abcdef1234567890

Test Data

Test Phone Numbers: - Success: +256700000000 to +256700000050 - Failure: +256700000051 to +256700000099 - Insufficient Funds: +256700001000 - Timeout: +256700002000

Test Card Numbers: - Visa Success: 4111111111111111 - Visa Decline: 4000000000000002 - Mastercard Success: 5555555555554444 - Mastercard 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 requests or httpx library

  • Node.js: Use axios or fetch

  • PHP: Use Guzzle or cURL

  • Ruby: Use HTTParty or Net::HTTP

Development Tools

  • API Reference: Available in this documentation

  • Postman Collection: Contact support for access

  • OpenAPI Spec: /openapi.json endpoint on API server

  • Testing 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

Developer Support

Community & Learning

Emergency Support

For critical production issues:

  • Email: emergency@piaxis.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