LANA SMS API

Send SMS to any network in Uganda and buy SMS credits with MTN or Airtel Mobile Money, straight from your own website, app or system. No need to sign in to LANA to send or to top up.

Quick start

  1. Create a free LANA SMS account, or sign in.
  2. Open API keys and create a key. Copy it: it is shown only once.
  3. Buy credits in the app, or through the API.
  4. Send your first message:
curl -X POST "https://api.lanasms.com/v1/send" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d "phone=0772123456" \
  -d "message=Hello from LANA SMS"

Authentication

Every request carries your API key as a bearer token:

Header
Authorization: Bearer YOUR_API_KEY

Each account can have up to 2 keys. Create and revoke them under API keys in the app. A revoked key stops working immediately.

Keep keys on your server. Never put an API key in a website's JavaScript or a mobile app, where anyone can read it. Call LANA from your backend, and keep the key in an environment variable.

Requests and responses

The base URL for every endpoint is:

Base URL
https://api.lanasms.com/v1
  • Use HTTPS. Send fields as a form (application/x-www-form-urlencoded or multipart/form-data) or as JSON (application/json).
  • Every response is JSON with a status of "success" or "failed" and a human-readable message. The HTTP status code tells you what kind of error it was (see Errors).
  • Every response has an X-Request-Id header. Quote it when you contact support, and we can find the exact request.
  • Amounts are in Uganda shillings (UGX), as whole numbers.

Sending messages

One call sends the same message to one number or to thousands (up to 10,000 per call). Put the numbers in phone, separated by commas.

  • Duplicate numbers are sent once.
  • Numbers you've blacklisted in the app are skipped and not charged.
  • Invalid numbers are left out and listed in invalid in the response. They are not charged.
  • Credits are taken when the message is accepted. If the SMS gateway refuses the message, the credits go straight back and the response is 502.

Send personalised messages (different text per person) as separate calls. Stay within the rate limit.

Buying credits by API

Your system can buy SMS credits with Mobile Money, without anyone signing in to LANA. The payment turns into credits automatically as soon as it is approved.

Get a quoteOptional. GET /packages?amount=20000 shows the rate and the credits that amount buys.
Start the paymentPOST /topup with the payer's phone and the amount. You get an orderId.
Payer approvesThe phone shows a Mobile Money prompt. The payer enters their PIN.
Credits arrivePoll POST /order_status until it is Completed. The credits are already on your account.
The payer always approves on their phone. Payments are processed by Cashmora over MTN and Airtel Mobile Money. Mobile Money never lets anyone, LANA included, take money without the PIN. Use a phone that someone can approve from, such as your finance or admin line.

Mobile Money payments powered by Cashmora Payment System

1. Get a quote (optional)

curl "https://api.lanasms.com/v1/packages?amount=20000" -H "Authorization: Bearer YOUR_API_KEY"
Response
{ "status": "success", "currency": "UGX", "min_topup": 500, "max_topup": 5000000,
  "packages": [ ... ],
  "quote": { "amount": 20000, "rate": 35, "credits": 571 } }

2. Start the payment

curl -X POST "https://api.lanasms.com/v1/topup" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d "phone=+256772123456" \
  -d "amount=20000"
Response
{ "status": "success", "message": "SMS Order Initiated", "orderId": "1761905400123",
  "amount": 20000, "rate": 35, "credits": 571 }

3. Wait for approval

Check the order every 5–10 seconds. Most payments complete within a minute of the PIN being entered. Stop after about 3 minutes and show "still pending": LANA keeps checking in the background and adds the credits whenever the payment completes, up to 3 days later.

$deadline = time() + 180;
do {
    sleep(6);
    $status = lana('order_status', ['orderId' => $orderId]);
} while ($status['statuscode'] === 0 && time() < $deadline);

match ($status['statuscode']) {
    1 => print("Paid: {$status['credits']} credits added, balance {$status['balance']}\n"),
    2 => print("Payment declined or cancelled\n"),
    default => print("Still pending; credits will be added when it completes\n"),
};

Good to know

  • Credits are added once per payment, however many times you check the order.
  • A failed or cancelled payment costs nothing. Start a new /topup to try again.
  • Only orders created with your account's keys are visible to you.
  • Payments made by API also appear under Credits in the app.

Automatic top-up

Check your credits on a schedule (for example every hour, or before a big send). When they fall below a level you choose, start a top-up from your company's Mobile Money number. Whoever holds that phone just approves the prompt.

// Run hourly from cron. Uses lana() from the top-up guide above.
const MIN_CREDITS = 500;      // top up when we drop below this
const TOPUP_AMOUNT = 50000;   // UGX
const PAYER_PHONE = '+256772123456';

$info = lana('info');
if ($info['credits'] < MIN_CREDITS && !file_exists('/tmp/lana-topup.lock')) {
    touch('/tmp/lana-topup.lock'); // don't ask the payer twice
    $order = lana('topup', ['phone' => PAYER_PHONE, 'amount' => TOPUP_AMOUNT]);
    // Notify your team: "Approve the LANA SMS payment on PAYER_PHONE"
    // ...then poll order_status as shown above, and delete the lock when done.
}
Keep a single top-up in flight at a time, so the payer isn't sent several prompts at once.

Message length and credits

One credit sends one SMS part to one number. How many parts a message needs depends on its characters:

Message uses1 partLonger messages (per part)
Plain text (A–Z, 0–9, common punctuation)up to 160 characters153 characters
Emoji or other special charactersup to 70 characters67 characters

A few symbols count as two characters in plain text: ^ { } \ [ ] ~ | €. Messages can be up to 1,530 characters. The send response tells you credits per recipient and total_credits charged.

Prices

PackageWhen you payPrice per SMS
StarterUGX 35 – 350,000UGX 35
BasicUGX 300,030 – 1,500,000UGX 30
StandardUGX 1,350,027 – 2,700,000UGX 27
PremiumUGX 2,500,025 – 7,500,000UGX 25
Premium 2UGX 6,000,020 – 10,000,000UGX 20
EnterpriseUGX 7,500,015 – 15,000,000UGX 15
Large EnterpriseUGX 10,000,010 – 100,000,000UGX 10

Live prices. Your system can read them with GET /packages.

Send SMS

POSThttps://api.lanasms.com/v1/send
FieldDescription
phonerequiredOne or more numbers, comma separated. Up to 10,000. See formats.
messagerequiredText, up to 1,530 characters.
200 OK
{
  "status": "success",
  "message": "Message sent successfully",
  "credits": 1,               // credits per recipient
  "total_credits": 2,         // credits charged for this call
  "recipients": 2,
  "balance": 498,             // credits left
  "batch": "A2610311215304F2A9C",
  "invalid": ["0123"],        // numbers left out (not charged)
  "skipped_blacklisted": 0
}

Errors: 400 missing or invalid fields, 402 not enough credits, 502 the gateway refused the message (credits refunded).

Account info

GEThttps://api.lanasms.com/v1/info

Your remaining credits. Use it to show a balance, or to decide when to top up.

200 OK
{ "status": "success", "credits": 498, "balance": 0, "api_keys": 1, "message": "Fetched Successfully" }

balance is always 0. It is kept for older integrations, because payments now turn straight into credits.

Packages and quote

To show the price list on a public page, use GET /pricing. It returns the same list without the quote and needs no API key. Tiers can overlap, so use from_amount and to_amount for the amounts that really get each rate. If your account has a fixed price, /packages also returns it as your_rate, and quotes and top-ups use it.

GEThttps://api.lanasms.com/v1/packages
FieldDescription
amountoptionalUGX. Adds a quote with the rate and the credits that amount buys.
200 OK
{
  "status": "success",
  "currency": "UGX",
  "min_topup": 500,
  "max_topup": 5000000,
  "packages": [
    { "name": "Starter", "rate": 35, "min_sms": 1, "max_sms": 10000, "min_amount": 35, "max_amount": 350000 },
    ...
  ],
  "quote": { "amount": 20000, "rate": 35, "credits": 571 }
}

Top up

POSThttps://api.lanasms.com/v1/topup

Sends a Mobile Money payment prompt to phone. When the payer approves, the amount becomes credits on your account. See the guide.

FieldDescription
phonerequiredMTN or Airtel Uganda number that pays, e.g. +256772123456 or 0772123456.
amountrequiredUGX, whole number, 500 – 5,000,000.
200 OK
{ "status": "success", "message": "SMS Order Initiated", "orderId": "1761905400123", "amount": 20000, "rate": 35, "credits": 571 }

credits is what the payment will add once completed.

Order status

POSThttps://api.lanasms.com/v1/order_status
FieldDescription
orderIdrequiredThe orderId from /topup.
200 OK
{ "status": "success", "message": "Completed", "statuscode": 1, "credits": 571, "amount": 20000, "balance": 1069, "reason": null }
statuscodemessageMeaning
0PendingWaiting for the payer to approve.
1CompletedPaid. credits were added and balance is your new total.
2FailedDeclined, not enough money, or not registered. Nothing was charged. reason says why.

Verify phone

POSThttps://api.lanasms.com/v1/verifyphone

Looks up the registered name of a Mobile Money number before you charge it, so you can show "Pay as JOHN DOE?" to your user.

FieldDescription
phonerequiredMTN or Airtel Uganda number.
200 OK
{
  "status": "success",
  "phone": "+256772123456",
  "valid": true,
  "network": "MTN",
  "can_pay": true,                 // that network is taking payments right now
  "registered_name": "Jane Namuli", // null when the name is not known
  "notice": null                    // e.g. a maintenance message for the network
}

A 503 means the lookup is unavailable right now; you can still use the number.

Errors

Every error looks like
{ "status": "failed", "message": "Not enough credits: this send needs 11, you have 2." }
HTTPMeaningWhat to do
400A field is missing or invalidShow message to your user, or fix the request.
401No API key sentAdd the Authorization: Bearer header.
403Key is wrong or revoked, or the account is lockedCheck the key in the app; contact support if the account is locked.
402Not enough creditsTop up, then retry. The message also waits under Failed messages in the app for 24 hours; a retry from either place removes it there, so it isn't sent twice.
404Unknown endpoint or orderCheck the URL or the orderId.
429Rate limit reachedWait for the number of seconds in Retry-After, then retry.
500Server errorRetry later. Quote the X-Request-Id to support.
502 / 503SMS gateway or lookup service unavailableRetry after a short wait. Credits for refused messages are refunded automatically.

Rate limits

Each account can make 120 requests per minute across all its keys. Over the limit you get 429 with a Retry-After header. To reach many people, send one message to many numbers in a single /send call instead of one call per number.

Your recent requests, their status and timing are listed under API keys in the app.

Phone number formats

All of these mean the same number:

Accepted
0772123456
772123456
256772123456
+256 772 123 456

Ugandan numbers must start with 7 or 3 after the country code. Numbers in other countries must be written in full international format.

OpenAPI specification

A machine-readable description of the API, for Postman, code generators and AI assistants:

OpenAPI 3.0
https://docs.lanasms.com/openapi.json

Changelog

October 2026

  • New GET /packages with an optional quote for an amount.
  • Mobile Money payments move to Cashmora. /topup returns amount, rate and credits; /order_status returns amount, the new balance and a reason when a payment fails.
  • /verifyphone returns a fixed shape: valid, network, can_pay, registered_name.
  • /send returns total_credits, recipients, batch and invalid. It accepts JSON bodies and up to 10,000 numbers.
  • Payments turn straight into credits. balance in /info is always 0.
  • Clear HTTP status codes (402, 429, 502), an X-Request-Id on every response, and a request log in the app.
  • SMS parts are counted per carrier rules (153 characters per part for long plain messages; 70/67 with emoji).

Support

WhatsApp +256 778 948 580 · Call +256 768 308 854 · Email support@lanasms.com

Include the X-Request-Id of the request you're asking about.

© 2026 LANA SMS · A product of Pearl Tech Solutions · Payments by Cashmora · lanasms.com