// API XoniPay v1

Mobile money payment API: integrate in an afternoon. Then sleep soundly.

A REST API for Orange Money and MTN MoMo, test keys, clear code samples and webhooks that actually arrive. Every call is idempotent: a double click never charges twice.

# Request an Orange Money paymentcurl https://api.xonipay.com/v1/payments \  -H "Authorization: Bearer sk_test_••••" \  -H "Idempotency-Key: cmd-48213" \  -d amount=12500 \  -d currency=XAF \  -d operator=orange_money \  -d phone=+23769000041 \  -d callback_url=https://boutique.cm/webhook

201 Created · sample responseIdempotency-Key required

4 languages of samples ready to copy
100% of calls are idempotent
< 5 s webhook delivery target
24/7 public status page

What makes the difference in production

The details that spare you unhappy customer calls at 10 p.m.

IDEMPOTENCY

Zero double charges

Replay a call as often as needed with the same key: the customer is only charged once.

RETRY

Automatic USSD retry

If the confirmation prompt does not arrive, XoniPay sends it again, then switches to another channel.

SANDBOX

Complete test environment

Simulate success, refusal, timeout and insufficient balance with test numbers.

STATUS

Public status page

Success rates and incidents published by operator, with email alerts on subscription.

Webhooks

Missed an event? We replay it for you.

Each event is signed (HMAC-SHA256), timestamped and resent with increasing delays until your server responds 2xx. You can also replay it by hand from the dashboard.

Event logSample

  • 200 payment.succeeded 2 s ago · 1st attempt
  • 200 payout.paid 14 s ago
  • 503 payment.succeeded next attempt in 30 s
  • 200 payment.pending 41 s ago
  • 200 refund.created 2 min ago

From test account to first real payment

  1. 1

    Create your account

    Your test keys are available right away, with no need to wait for verification.

    sk_test_••••
  2. 2

    Make a first call

    Create a test payment with a sandbox number.

    POST /v1/payments
  3. 3

    Connect your webhooks

    Enter the URL that will receive status changes.

    payment.succeeded
  4. 4

    Go live

    Once your KYC file is approved, replace the test key.

    sk_live_••••

Statuses

The life cycle of a mobile money payment

created

Created

Your server has requested the payment.

pending

Pending

The customer has received the USSD request on their phone.

succeeded

Succeeded

The operator has confirmed. The funds move on to payout.

failed

Failed

Insufficient balance or code refused. Never billed.

expired

Expired

No response from the customer within the time limit.

A webhook is sent on every status change. A "pending" payment is rechecked automatically until it is resolved.

Test numbers

With an sk_test_ key, each number simulates a scenario.

NumberSimulated result
+237 690 000 001 Succeeded
+237 690 000 002 Insufficient balance
+237 690 000 003 Secret code refused
+237 670 000 004 Late confirmation (3 min)
+237 670 000 005 Expired, no response

Verify a webhook signature

// Node.jsconst received = Buffer.from(req.headers["xonipay-signature"] ?? "");const expected = Buffer.from(crypto  .createHmac("sha256", process.env.WEBHOOK_SECRET)  .update(req.rawBody).digest("hex"));if (received.length !== expected.length  || !crypto.timingSafeEqual(received, expected)) {  return res.sendStatus(401);}res.sendStatus(200); // XoniPay stops replaying

Plugins and libraries

WordPress

Available

WooCommerce

Available

Shopify

Available

PrestaShop

Available

Node.js

SDK

PHP

SDK

Python

SDK

Flutter

Coming soon

Choisissez votre langue

Choose your language

Français Continuer en français English Continue in English