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.
Request or transaction completed successfully.
Validation error, insufficient balance, or provider declined the request.
Transaction is still processing. Wait for your webhook or query GET /transaction/{id}.
Content-Type: application/json Accept: application/json Apikey: YOUR_LIVE_OR_TESTBOX_API_KEY Authkey: YOUR_LIVE_OR_TESTBOX_AUTH_KEY
// 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.
Your Live or Testbox API key. Automatically selects Live or Testbox environment.
Your Live or Testbox Authenticator key (case-insensitive).
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.
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.
Use 098765 (Testbox Bank) for bank validation and payouts in Testbox mode.
Use 0123456789 for POST /payout/validate-account and POST /payout.
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.
{
"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.
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).
Always application/json.
Always validate the x-signature HTTP header before trusting or processing any webhook payload.
Return an HTTP 200 OK response promptly once received. Any non-2xx response triggers automatic retries (up to 5 attempts).
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.
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.
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.
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.
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.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).
Action not allowed in the current environment (e.g. calling Testbox Deposit Simulator with Live keys).
Rate limit exceeded (e.g. 20–60 req/min on sensitive endpoints). Back off and retry after 60 seconds.
{
"status": "failed",
"message": "Invalid Apikey, please ensure your API key is correct."
}