Developers

Build payments into your product.

Guides and reference for the LBPay API: collections, payouts, payment links, and sandbox behavior in XAF.

On this page

Authentication

Send your secret key as a Bearer token. Test keys start with sk_test_. Live keys start with sk_live_.

Header

Authorization: Bearer sk_test_...
Apply from Profile. Sandbox and live keys appear in the Developer Portal after approval. Live payouts also need verified developer KYC.

Wallet transfer vs disbursement

LBPay to LBPay is an internal ledger move. The sender’s wallet balance drops and the recipient’s wallet balance rises. No Mobile Money rail is involved. The recipient can withdraw later.

POST /api/wallet/transfer

POST /api/wallet/transfer
{ "to": "@handle", "amount": 5000, "pin": "1234", "note": "Lunch" }

Withdrawals and “send to MTN / Orange” are payouts: money leaves LBPay to a Cameroon MTN or Orange number (237 + 9 digits). Minimum withdrawal is 1,000 XAF.

POST /api/wallet/disburse

POST /api/wallet/disburse
{ "amount": 10000, "phone": "670112233", "network": "mtn", "pin": "1234" }

Deposits collect from MTN, Orange, or card and credit the wallet the moment the network confirms. See pricing for every fee.

Create a payment

POST /api/v1/payments collects XAF. Use method mobile_money, mtn, orange, card, or wallet.

Fee: 2.5% on MTN, Orange and card payments, taken from what you receive. A 10,000 XAF payment lands as 9,750 XAF in your wallet. Payments from an LBPay wallet are free.

cURL

curl https://lbpay.loopingbinary.com/api/v1/payments \
  -H "Authorization: Bearer sk_test_YOUR_SECRET" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 5000,
    "currency": "XAF",
    "customer": { "phone": "670112233" },
    "method": "mobile_money"
  }'

Check payment status

GET /api/v1/payments/:id returns the current status of any collection on your account by its LBPay transaction ID (TXN_...) or gateway reference. If a live payment is still pending, LBPay automatically re-verifies with the mobile money network before returning.

GET /api/v1/payments/:id

curl https://lbpay.loopingbinary.com/api/v1/payments/TXN_t60oaw75ox \
  -H "Authorization: Bearer sk_live_YOUR_SECRET"

You can also list recent collections with GET /api/v1/payments?limit=20, or check a payout with GET /api/v1/payouts/:id.

Webhooks

Register an HTTPS URL in the Developer Portal (/developers/webhooks) or via POST /api/v1/webhooks. LBPay sends a signed POST request whenever a collection or API payout settles:

  • payment.succeeded — a collection (API payment, payment link, or QR checkout) succeeded and credited your wallet.
  • payment.failed — a collection failed, expired, or was cancelled.
  • payout.succeeded / payout.failed — an API disbursement completed or failed.

Webhook JSON payload

{
  "id": "evt_TXN_t60oaw75ox_payment_succeeded",
  "object": "event",
  "type": "payment.succeeded",
  "createdAt": "2026-11-25T11:30:00.000Z",
  "environment": "live",
  "data": {
    "id": "TXN_t60oaw75ox",
    "object": "payment",
    "amount": 100,
    "fee": 2,
    "net": 100,
    "currency": "XAF",
    "status": "success",
    "method": "mtn",
    "reference": "MT12345678AB",
    "rail": "payunit",
    "environment": "live",
    "description": "Collection",
    "linkSlug": null,
    "customer": { "phone": "670112233" },
    "createdAt": "2026-11-25T11:29:10.000Z"
  }
}

Every request includes X-LBPay-Event, X-LBPay-Event-Id, X-LBPay-Timestamp, and X-LBPay-Signature (t=...,v1=...) signed with your endpoint’s whsec_... secret using HMAC-SHA256 over ${timestamp}.${rawBody}:

Verify signature (Node.js)

import crypto from "node:crypto";

function verifyLbpayWebhook(rawBody, sigHeader, secret) {
  const parts = Object.fromEntries(sigHeader.split(",").map((p) => p.split("=")));
  const expected = crypto
    .createHmac("sha256", secret)
    .update(`${parts.t}.${rawBody}`)
    .digest("hex");
  return crypto.timingSafeEqual(Buffer.from(parts.v1 || ""), Buffer.from(expected));
}
Need to replay an event? Call POST /api/v1/payments/:id/resend or use the Resend tool in /developers/webhooks. Webhook delivery requires no extra personal or business KYC once your Developer Portal access is approved.

Create a payout

POST /api/v1/payouts sends XAF to a Cameroon phone on MTN or Orange. The merchant wallet is debited, plus the 2.5% withdrawal fee.

cURL

curl https://lbpay.loopingbinary.com/api/v1/payouts \
  -H "Authorization: Bearer sk_test_YOUR_SECRET" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 10000,
    "phone": "670112233",
    "network": "mtn"
  }'

Balance

GET /api/v1/balance returns available XAF for the authenticated merchant.

GET /api/v1/balance

curl https://lbpay.loopingbinary.com/api/v1/balance \
  -H "Authorization: Bearer sk_test_YOUR_SECRET"

Sandbox amounts

Test keys never move live money. Use the amount to drive the rail result:

Amount ruleStatus
ending in 00SUCCESS
ending in 13FAILED
ending in 77PENDING

Account security

  • Signup sends a 6-digit email OTP (Nodemailer / SMTP).
  • After OTP, the user sets a 4-digit PIN.
  • Login is email + password, then PIN.
  • Sends, withdrawals, and deposits require the PIN on a confirmation sheet.
  • Mobile: the session lasts; returning to the app after it was inactive asks for the PIN again.
  • Web: no PIN lock overlay. Idle for about 18 minutes signs the user out.

Roles

  • Personal: wallet. Verify your account from Profile when you want business benefits.
  • Business: merchant console. Available after your account is verified.
  • Developer: apply from Profile. Portal, sandbox keys, and live keys unlock after approval.
  • Admin: platform operators. Entering /admin asks for an email OTP. That operator session lasts about 8 hours.

SDKs

Official libraries are planned. Until then, call the HTTP API directly.

npm i @lbpay/node · pip install lbpay · Flutter / React Native

LBPay is a product of Looping Binary, built in Cameroon. Mobile Money payments run on the MTN Mobile Money and Orange Money networks through our payment processing partner. LBPay is not a bank. MTN and Orange are trademarks of their respective owners.

Get API keys