Yolliepay API Documentation

Integrate mobile money payments & payouts into your applications

Getting Started

  1. Sign up on Yolliepay and log in to your dashboard
  2. Generate an API Key & Secret in the API Keys section
  3. Use the API to collect payments (STK push) or disburse payouts (send money)
  4. Pass a webhook_url in each request to receive real-time transaction updates
Base URL: https://pay.yollie.live/api

Authentication & Origin Lock

All API requests require both your API key and API secret in headers:

x-api-key: ypk_your_api_key_here
x-api-secret: yps_your_api_secret_here
🔒 Allowed Website (Origin Lock): Every API key is bound to a single website (e.g. mystore.com) chosen when you created the key. Yolliepay inspects the Origin / Referer header on each request and rejects with 403 if it does not match. This protects you even if your keys leak — an attacker cannot use them from a different domain.
Rate limiting: Max 30 requests / minute / key. Identical request bodies sent within 30s are rejected as duplicates (HTTP 409) to prevent double-charging.
Security: Never expose credentials in client-side code. Make API calls from your server only. The Origin header from a server-to-server call should be set to your website's domain.

Collect Payment (STK Push)

POST /api/api-create-payment

Initiate a payment collection from a customer's mobile money account.

Request Body

{
  "amount": 5000,
  "phone_number": "0712345678",
  "provider": "mtn",
  "note": "Payment for order #123",
  "webhook_url": "https://your-server.com/webhook"
}

Parameters

ParameterTypeRequiredDescription
amountnumberYesAmount in UGX (min: 500)
phone_numberstringYesUganda phone number
providerstringYes"mtn" or "airtel"
notestringNoPayment description
webhook_urlstringNoURL to receive status callbacks

Success Response (200)

{
  "success": true,
  "message": "Payment initiated successfully",
  "transaction_id": "uuid",
  "reference": "API_COL_...",
  "amount": 5000,
  "phone_number": "256712345678"
}

JavaScript Example

const response = await fetch('https://pay.yollie.live/api/api-create-payment', {
  method: 'POST',
  headers: {
    'x-api-key': 'ypk_your_api_key_here',
    'x-api-secret': 'yps_your_api_secret_here',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    amount: 50000,
    phone_number: '0712345678',
    provider: 'mtn',
    note: 'Payment for services',
    webhook_url: 'https://your-server.com/webhook'
  })
});
const data = await response.json();
console.log('Transaction ID:', data.transaction_id);

Payout / Disburse (Send Money)

POST /api/api-disburse

Send money to a mobile money number. Funds are deducted from your Yolliepay wallet.

Request Body

{
  "amount": 10000,
  "phone_number": "0712345678",
  "provider": "mtn",
  "recipient_name": "John Doe",
  "note": "Salary payment",
  "webhook_url": "https://your-server.com/webhook"
}

Parameters

ParameterTypeRequiredDescription
amountnumberYesAmount in UGX (min: 1000)
phone_numberstringYesRecipient phone number
providerstringYes"mtn" or "airtel"
recipient_namestringNoRecipient's name
notestringNoPayout description
webhook_urlstringNoURL to receive status callbacks

Success Response (200)

{
  "success": true,
  "message": "Payout initiated successfully",
  "transaction_id": "uuid",
  "reference": "...",
  "amount": 10000,
  "phone_number": "256712345678"
}

JavaScript Example

const response = await fetch('https://pay.yollie.live/api/api-disburse', {
  method: 'POST',
  headers: {
    'x-api-key': 'ypk_your_api_key_here',
    'x-api-secret': 'yps_your_api_secret_here',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    amount: 10000,
    phone_number: '0712345678',
    provider: 'mtn',
    recipient_name: 'John Doe',
    note: 'Salary payment',
    webhook_url: 'https://your-server.com/webhook'
  })
});
const data = await response.json();
console.log('Payout ID:', data.transaction_id);

cURL Example

curl -X POST "https://pay.yollie.live/api/api-disburse" \
  -H "x-api-key: ypk_your_api_key_here" \
  -H "x-api-secret: yps_your_api_secret_here" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 10000,
    "phone_number": "0712345678",
    "provider": "mtn",
    "recipient_name": "John Doe",
    "note": "Payout"
  }'

Webhooks

Pass a webhook_url in each API request to receive transaction status updates at that URL.

Webhook Payload

{
  "id": "evt_abc12345",
  "type": "transaction.completed",
  "created": 1642000000,
  "data": {
    "id": "transaction-uuid",
    "type": "deposit",
    "amount": 50000,
    "currency": "UGX",
    "status": "completed",
    "description": "Payment for services",
    "recipient_phone": "256712345678",
    "recipient_name": "John Doe",
    "created_at": "2026-01-12T10:30:00Z"
  },
  "api_version": "2025-01"
}

Webhook Headers

User-Agent: Yolliepay-Webhooks/1.0
Content-Type: application/json
X-Yolliepay-Event: transaction.completed
X-Yolliepay-Timestamp: 1642000000

Available Events

EventDescription
transaction.completedPayment/payout successfully processed
transaction.failedPayment/payout failed or cancelled
transaction.pendingPayment initiated, awaiting approval
payout.completedPayout successfully sent
payout.failedPayout failed

Fee Structure

Deposits (Collections)

TypeFee
All deposits (including API)3%

Payouts (Withdrawals & Send Money)

Amount Range (UGX)Fee (UGX)
1,000 – 10,000600
10,001 – 50,0001,500
50,001 – 100,0002,500
100,001 – 500,0005,000
500,001 – 1,000,00010,000

Yolliepay-to-Yolliepay Transfers

TypeFee
Internal transfers5%

Daily Withdrawal Limits

Account TypeLimit
PersonalUGX 500,000/day
BusinessUGX 5,000,000/day
Sandbox (unverified)Withdrawals disabled

Error Codes

CodeDescription
400Bad Request — missing or invalid parameters (validation details in response)
401Unauthorized — invalid or missing API credentials
403Forbidden — key deactivated, deposits/withdrawals disabled, or origin not allowed
409Duplicate — identical request received recently. Wait before retrying.
429Rate limit exceeded — slow down (max 30 req/min/key)
500Server error — internal processing error