DOCS

API Reference

Integrate with the billing system using our REST API for custom applications and automation.

API Access
API access requires authentication. Contact support to get your API credentials.

Authentication

All API requests require a Bearer token in the Authorization header:

Authorization: Bearer your-api-token

Base URL

https://sopraent.com/api/v1

Endpoints

Customers

List Customers

GET /customers

Returns a paginated list of customers.

Get Customer

GET /customers/{id}

Returns details of a specific customer.

Create Customer

POST /customers
{
    "full_name": "John Doe",
    "phone": "+256700000000",
    "email": "john@example.com",
    "package_id": 1,
    "service_type": "hotspot"
}

Update Customer

PUT /customers/{id}

Delete Customer

DELETE /customers/{id}

Packages

List Packages

GET /packages

Get Package

GET /packages/{id}

Payments

List Payments

GET /payments

Get Payment

GET /payments/{id}

Record Payment

POST /payments
{
    "customer_id": 1,
    "package_id": 1,
    "amount": 10000,
    "payment_method": "cash",
    "reference": "CASH-001"
}

Vouchers

Generate Vouchers

POST /vouchers/generate
{
    "package_id": 1,
    "quantity": 10
}

Activate Voucher

POST /vouchers/activate
{
    "code": "ABC123XY",
    "phone": "+256700000000"
}

Response Format

All responses are in JSON format:

Success Response

{
    "success": true,
    "data": { ... },
    "message": "Operation successful"
}

Error Response

{
    "success": false,
    "error": {
        "code": "VALIDATION_ERROR",
        "message": "The given data was invalid.",
        "details": { ... }
    }
}

Rate Limiting

API requests are limited to:

  • 60 requests per minute for standard endpoints
  • 10 requests per minute for resource-intensive operations

Webhooks

Configure webhooks to receive real-time notifications:

  • payment.completed - When a payment is confirmed
  • customer.created - When a new customer is registered
  • customer.expired - When a subscription expires
  • voucher.activated - When a voucher is used

SDKs & Libraries

Coming Soon
We're working on official SDKs for PHP, JavaScript/Node.js, and Python. Check back for updates.