Mpayng Mpayng API v1
Set API Keys Home Support Dashboard →

Mpayng API Reference

Integrate automated Nigerian virtual bank accounts, hosted checkout links, instant bank payouts, and real-time webhook notifications into your application using simple REST JSON endpoints.

Base URL
https://mpayng.com/api/v1
Standard Response Statuses
successful

Request or transaction completed successfully.

failed

Validation error, insufficient balance, or provider declined the request.

processing

Transaction is still processing. Wait for your webhook or query GET /transaction/{id}.

Quick Start Headers
Content-Type: application/json
Accept: application/json
Apikey: YOUR_LIVE_OR_TESTBOX_API_KEY
Authkey: YOUR_LIVE_OR_TESTBOX_AUTH_KEY
Environment Auto-DetectionAutomatic
// Use Testbox keys  → Sandbox mode (zero real money)
// Use Live keys     → Production mode (live transactions)

Authentication

Every API request must include both your Apikey and Authkey in the HTTP headers. Grab your keys from Dashboard → API Access.

Apikeyheaderrequired

Your Live or Testbox API key. Automatically selects Live or Testbox environment.

Authkeyheaderrequired

Your Live or Testbox Authenticator key (case-insensitive).

Business Accounts Only: API access is restricted to Unregistered Business and Registered Business accounts. Live calls require an active business account.
Set Your API Keys Once (Applies Everywhere)

Paste your keys below to automatically populate every code snippet and Try It request across this documentation. Keys are kept only in your current browser tab session.

Security Notice: Strictly use your Testbox (Sandbox) keys when testing here. Using Live keys in browser docs is not recommended. If you ever enter Live keys here, click Clear / Remove Keys immediately after testing or regenerate your keys in Dashboard → API Access.
Example Request (cURL)
curl -X POST "https://mpayng.com/api/v1/account-details" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -H "Apikey: YOUR_API_KEY" \
  -H "Authkey: YOUR_AUTH_KEY"

Testbox Sandbox Guide

Test your entire integration end-to-end without touching production data or spending real money.

Testbox Bank Code098765

Use 098765 (Testbox Bank) for bank validation and payouts in Testbox mode.

Testbox Account Number0123456789

Use 0123456789 for POST /payout/validate-account and POST /payout.

Hosted Checkout Simulation

Create a Testbox onetime_account, open its checkout_url, then call POST /webhook/testbox-deposit-simulator with that account_number. The checkout page automatically marks as Paid and fires your webhook.

Testbox Credentials
{
  "bank_code": "098765",
  "bank_name": "Testbox Bank",
  "account_number": "0123456789",
  "account_name": "Simulated Name"
}

Webhooks & HMAC-SHA512 Verification

Whenever a customer transfers funds to a virtual account (or when you run the Testbox Deposit Simulator), Mpayng sends an HTTP POST JSON request to your configured Webhook URL.

Incoming Webhook HTTP Headers
x-signatureHTTP Headerverify

HMAC-SHA512 hex digest of the raw JSON request body signed using your Authkey. Read this from the HTTP request headers (e.g. $_SERVER['HTTP_X_SIGNATURE'] in PHP, $request->header('x-signature') in Laravel, or req.headers['x-signature'] in Node.js).

Content-TypeHTTP Header

Always application/json.

Delivery & Best Practices
1. Verify x-signature First

Always validate the x-signature HTTP header before trusting or processing any webhook payload.

2. Acknowledge with HTTP 200 OK

Return an HTTP 200 OK response promptly once received. Any non-2xx response triggers automatic retries (up to 5 attempts).

3. Idempotency (ref_id & session_id)

Both ref_id and session_id are unique per payment. Always store both in your database and check against existing records before crediting a user so retried webhooks never double-credit.

4. Order Matching via request_ref_id

For onetime_account payments, request_ref_id returns the exact ref_id you passed when creating the one-time virtual account, letting you immediately locate and mark the corresponding order as paid.

5. Optional Status Re-Queryoptional

For an extra layer of security on high-value orders, you may optionally call GET /transaction/{ref_id} to re-confirm the transaction status directly from our API before fulfillment.

One-Time vs Permanent Payload

For permanent_account deposits, sender_details is included. For onetime_account deposits, sender_details is omitted.

// Incoming Header:
// x-signature: <hmac_sha512_hex_signature>

{
  "status": "successful",
  "event_type": "PAYMENT_COLLECTION",
  "ref_id": "DEP_8F92A1BC34D0",
  "request_ref_id": "ORD_100234",
  "business_name": "Acme Ventures",
  "customer_email": "customer@example.com",
  "receiver_details": {
    "bank_name": "SafeHaven MFB",
    "bank_code": "safehaven",
    "account_type": "permanent_account",
    "account_number": "9012345678",
    "account_name": "Acme / John Doe"
  },
  "sender_details": {
    "account_number": "0123456789",
    "bank_name": "Access Bank",
    "account_name": "JOHN DOE"
  },
  "currency": "NGN",
  "payment_method": "SafeHaven MFB Virtual Account",
  "amount_paid": 5000,
  "settlement_fee": 50,
  "settlement_amount": 4950,
  "narration": "Payment for Order #100234",
  "session_id": "000013261128143000123456",
  "date_time": "2026-11-28 14:30:00"
}

Error Codes & Rate Limits

All API responses return JSON containing a top-level status field (successful, processing, or failed) and a descriptive message.

Important: Do Not Rely on HTTP 200 Alone. An HTTP 200 OK response only confirms that our server received and processed your request. Always inspect the JSON status field in the response body to decide whether the transaction is successful, processing, or failed before crediting or fulfilling any order.
HTTP Status Codes
200 OK

Request reached our server and was evaluated. Always check the response JSON status: successful (proceed/fulfill), processing (wait for webhook or re-query), or failed (do not fulfill; inspect message).

403 Forbidden

Action not allowed in the current environment (e.g. calling Testbox Deposit Simulator with Live keys).

429 Too Many Requests

Rate limit exceeded (e.g. 20–60 req/min on sensitive endpoints). Back off and retry after 60 seconds.

Standard Failed Response
{
  "status": "failed",
  "message": "Invalid Apikey, please ensure your API key is correct."
}