Live Pay

LivePay

Collect Money API

Receive payments from mobile money users instantly

Overview

The Collect Money API allows you to receive payments from mobile money users. Funds are added to your balance when the transaction is successful.

Endpoint

https://livepay.me/api/collect-money

Method: POST

Quick Start

Request Example

Terminal
curl "https://livepay.me/api/collect-money" \
  -X POST \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <Your API Key>" \
  -d '{
    "accountNumber": "LP2305443309",
    "phoneNumber": "0777123456",
    "amount": 50000,
    "currency": "UGX",
    "reference": "INVOICE123456789",
    "description": "Payment for invoice"
  }'

Note: For non-UGX currencies, you must include the "network" field in the request body.

Authentication

All API requests require Bearer token authentication using your API key in the Authorization header.

Headers

Authorization

Bearer <Your API Key>

Content-Type

application/json

API Key Format

Your API key is provided in your dashboard. Use it directly in the Authorization header as shown above.

Request Parameters

Parameter Type Required Description
accountNumber String Yes Your account number
phoneNumber String Yes Customer's phone number (any format accepted)
amount Number Yes Amount to collect (subject to min/max per account)
currency String Yes Currency code (e.g., UGX, USD, KES)
reference String Yes Unique reference ID (no spaces, max 30 characters)
description String Yes Transaction description or reason
network String Conditional Required for non-UGX currencies

Response Format

Success Response (200 OK)

success.json
{
  "success": true,
  "message": "Collection request sent successfully",
  "reference": "INVOICE123456789",
  "internal_reference": "550e8400-e29b-41d4-a716-446655440000",
  "network": "MTN"
}

Error Responses

Status Code Error Message Description
400 Missing required fields Required field missing
400 Invalid amount Amount is not a valid number
400 Amount must be at least X UGX Amount below minimum allowed
400 Collection amount must not exceed X UGX Amount above maximum allowed
400 Reference already used for this account Duplicate reference ID
400 Reference must not contain spaces Reference has spaces
400 Reference must be at most 30 characters Reference too long
400 Network is required for non-UGX currencies Network field missing for non-UGX
401 Authorization required Missing Authorization header
401 Invalid API key Invalid API key format or value
403 Account number does not match API key owner Account number mismatch
429 Too many requests. Please try again later. Rate limit exceeded (50 per 15 minutes)
500 Internal server error Server error
504 Payment service timeout. Please try again. Payment service timeout

Code Examples

javascript.js
async function collectMoney(apiKey, data) {
    const response = await fetch('https://livepay.me/api/collect-money', {
        method: 'POST',
        headers: {
            'Content-Type': 'application/json',
            'Authorization': `Bearer ${apiKey}`
        },
        body: JSON.stringify({
            accountNumber: data.accountNumber,
            phoneNumber: data.phoneNumber,
            amount: data.amount,
            currency: data.currency,
            reference: data.reference,
            description: data.description
        })
    });
    
    if (!response.ok) {
        const error = await response.json();
        throw new Error(error.error || 'Request failed');
    }
    
    return await response.json();
}