Building a Wallet Service with Monnify

By Oreoluwa Somuyiwa 19th Oct, 2025

Wallet services are no longer just a fintech feature, they’ve become a foundational layer across industries. From ride-hailing and e-commerce to travel and lifestyle platforms, businesses use wallets to streamline payments, store user balances, and deliver flexible financial experiences. Whether you're building a savings app, a lending platform, or a marketplace, integrating a wallet system allows you to manage customer funds securely and efficiently.

Monnify makes it easy to implement wallet functionality using its Customer Reserved Account API (for deposits) and Disbursement API (for withdrawals).

In this article, we’ll walk through how to build a basic wallet service using Monnify, the key APIs you’ll need, and best practices for ensuring your system is robust and secure.

What You’ll Need

  1. An Account on Monnify:
    If you haven't already, sign up for a Monnify account here Then, navigate to Developer > API Keys & Contracts to retrieve the following necessary API credentials:
    • API Key
    • Secret Key
    • Contract Code
    • Wallet Account Number
  2. Customer Reserved Account API: For assigning dedicated virtual accounts to customers so they can fund their wallets.
  3. Disbursement API: For initiating withdrawals directly to customers’ bank accounts.

Wallet System Architecture Overview

The wallet system consists of two key flows:
  1. Deposits (via virtual accounts)
  2. Withdrawals (via bank accounts)

Customer Reserved Accounts

Each customer gets a unique virtual account number (e.g., 6123456789). When they fund this account, Monnify notifies your system, and you credit the customer’s wallet balance.


Disbursement API

Each customer gets a unique virtual account number (e.g., 6123456789). When they fund this account, Monnify notifies your system, and you credit the customer’s wallet balance.

Sample Transaction Flow

sample transaction flow
  1. Customer A signs up and is assigned a reserved account.
  2. They transfer ₦10,000 to their virtual account.
  3. Monnify sends a webhook to your backend notifying you of the deposit.
  4. Your system credits Customer A's wallet balance.
  5. Later, Customer A requests a ₦5,000 withdrawal.
  6. You debit the wallet and initiate a disbursement via Monnify.
  7. Monnify processes the transaction and returns a status update.

How Deposits Work

  1. On signup, call the Create Reserved Account API. Include the customer's BVN or NIN. This is mandatory for compliance.
  2. When a transfer hits the virtual account, Monnify sends a webhook notification.
  3. Validate the incoming webhook:
    1. Check the IP address (only allow Monnify’s known IPs).
    2. Compute and verify the monnify-signature
    3. Confirm the account reference and amount.
  4. Credit the customer’s wallet balance.
  5. Log the transaction and return a success response.

How Withdrawals Work

how withdrawals work
  1. The customer initiates a withdrawal request.
  2. Your system verifies the wallet has sufficient balance.
  3. Debit the wallet.
  4. Initiate a disbursement using the Disbursement API
  5. Track the transaction status via:
    1. API response,
    2. Webhook,
    3. And periodic reconciliation.

Pro Tips for a Smooth System

  1. Use unique references: For every withdrawal to prevent duplicates.
  2. Cache: The customer’s reserved account details.
  3. Validate webhook IPs: Only process Monnify-initiated callbacks.
  4. Make webhook handlers idempotent: Handle retries gracefully.
  5. Implement error handling: For failed or pending transactions.
  6. Reconcile regularly Cross-check wallet balances with transaction logs.
  7. Secure PII: Especially BVNs, account numbers, and NINs.
  8. Lock during balance updates: To prevent race conditions in concurrent withdrawals.
  9. Test in sandbox: Simulate deposits and disbursements before going live.

Notes for Engineers

  1. This guide is language-agnostic, so you need to adapt it to your stack (Spring Boot, Laravel, Node.js, etc.).
  2. The flow is always:
    1. Validate the request
    2. Process the business logic
    3. Record the transaction
    4. Update balances
  3. Ensure atomicity: a failed disbursement should roll back any wallet deductions.
  4. Logs and metrics matter for audit trails and debugging

In Summary

Building a wallet system with Monnify is straightforward when you understand the architecture and transaction flow. With proper implementation of virtual accounts, webhook handling, and disbursement logic, you can offer customers a smooth wallet experience that is secure, auditable, and scalable.

You can check out a Spring boot implementation of the Monnify Wallet.

Copyright © 2025 Monnify
instagramfacebookicon