Skip to main content

Overview

The Monei sandbox environment allows you to test your integration without using real money or affecting production data. Test all features in a safe, isolated environment. What you’ll learn:
  • Accessing the sandbox
  • Test credentials
  • Simulating transactions
  • Test data
  • Limitations
  • Moving to production

Sandbox vs Production

FeatureSandboxProduction
API Base URLhttps://api.dev.monei.cchttps://api.monei.cc
API Key Prefixsk_test_...sk_live_...
Real MoneyNoYes
Real Bank TransfersNoYes
Real Bill PaymentsNoYes
BlockchainTestnetMainnet
Data PersistenceTemporaryPermanent

Getting Started

1. Get Sandbox API Key

1

Sign Up

Create a Monei account at monei.cc
2

Access Dashboard

Log in to your dashboard
3

Navigate to API Keys

Go to Settings → API Keys → Sandbox
4

Copy Test Key

Copy your sandbox API key (starts with sk_test_)

2. Configure SDK

import MoneiSDK from 'monei-sdk';

// Sandbox configuration
const monei = new MoneiSDK({
  apiKey: process.env.MONEI_SANDBOX_API_KEY, // sk_test_...
  baseUrl: 'https://api.dev.monei.cc',
});

// Verify sandbox mode
console.log('base url:', monei.baseUrl); // 'sandbox'

Test Credentials

Test Bank Accounts

Use these test bank accounts for payouts and verification:
BankAccount NumberAccount NameStatus
Access Bank0690000031TEST USERSuccess
Zenith Bank1111111111FAILED ACCOUNTFails

Test Cards

Use these test cards for deposits:
Card NumberExpiryCVVOutcome
553188665214295009/32564Success
543889801456022910/32123Requires PIN
418742741556424609/32828Requires OTP
424242424242424212/25100Declined

Test Phone Numbers

Use these for airtime/data testing:
Phone NumberNetworkOutcome
08012345678MTNSuccess
08098765432AirtelSuccess
08011111111GloFailed
080222222229mobilePending

Test Meter Numbers

For electricity testing:
Meter NumberDiscoOutcome
12345678901IKEDCSuccess (returns token)
98765432109EKEDCSuccess (returns token)
11111111111AEDCFailed
22222222222PHEDInvalid meter

Testing Workflows

Test Naira Deposit

// Test card deposit
const deposit = await monei.wallet.depositWithCard({
  amount: 10000,
  reference: 'TEST-DEP-' + Date.now(),
  currency: 'NGN',
  card: {
    cardNumber: '5531886652142950',
    cvv: '564',
    expiryMonth: '09',
    expiryYear: '32',
    cardHolderName: 'TEST USER'
  },
  narration: 'Test deposit'
});

console.log('Deposit Reference:', deposit.reference);
console.log('Status:', deposit.status);

// Handle next action if needed
if (deposit.nextAction) {
  console.log('Action required:', deposit.nextAction.type);
  // In sandbox, you can use test PIN: 1234
}

Test Bill Payment

// Test MTN airtime purchase
const payment = await monei.bills.pay({
  billerId: 'mtn-ng',
  customerId: '08012345678', // Test number
  amount: 100,
  type: 'PREPAID',
  reference: 'TEST-BILL-' + Date.now()
});

console.log('Payment Reference:', payment.reference);
console.log('Status:', payment.status);
// In sandbox, status will be 'successful' immediately

Test Offramp

// Test crypto to fiat
const offramp = await monei.offramp.initiateSwap({
  amount: 100,
  token: 'USDT',
  network: 'base',
  fiatCurrency: 'NGN',
  bankCode: '058',
  accountNumber: '0123456789', // Test account
  accountName: 'TEST ACCOUNT'
});

console.log('Order Reference:', offramp.reference);
console.log('Deposit Address:', offramp.onChain.depositAddress);
console.log('Expected Amount:', offramp.onChain.expectedAmount);

// In sandbox, you can simulate crypto deposit
// The address will be a test address on testnet

Test EVM Transaction

// Test sending on EVM testnet
const tx = await monei.evm.sendNativeToken({
  to: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e',
  amount: '0.01',
  chainId: 84532 // Base Sepolia testnet
});

console.log('Transaction Hash:', tx.txHash);
console.log('View on Explorer:', `https://sepolia.basescan.org/tx/${tx.txHash}`);

Sandbox Limitations

Limitation: Sandbox uses test money, not real currencyImpact:
  • No actual bank transfers
  • No real bill payments
  • Crypto uses testnets
Testing:
  • Use test credentials
  • Simulate all scenarios
  • Verify integration logic
Limitation: Sandbox data may be reset periodicallyImpact:
  • Test data cleared monthly
  • Transaction history temporary
  • Don’t rely on long-term storage
Best Practice:
  • Export important test data
  • Document test scenarios
  • Use production for real data
Limitation: Instant processing in sandboxImpact:
  • No real delays
  • Instant confirmations
  • Can’t test timeout handling
Testing:
  • Manually simulate delays
  • Test timeout logic separately
  • Use production for real timing
Limitation: Uses testnets onlyNetworks:
  • Base Sepolia (not Base mainnet)
  • Polygon Mumbai (not Polygon mainnet)
  • Solana Devnet (not mainnet-beta)
Testing:
  • Get testnet tokens from faucets
  • Use testnet explorers
  • Verify on testnet first
Limitation: Webhook behavior may differImpact:
  • Faster delivery
  • May skip some retries
  • Different timing
Testing:
  • Test webhook handling
  • Verify signature validation
  • Check idempotency

Test Scenarios

Successful Flow

// Complete successful deposit flow
async function testSuccessfulDeposit() {
  console.log('Testing successful deposit...\n');
  
  // 1. Get wallet balance before
  const walletBefore = await monei.wallet.me();
  const balanceBefore = parseFloat(walletBefore.nairaBalance);
  console.log('Balance before:', balanceBefore);
  
  // 2. Make deposit
  const deposit = await monei.wallet.depositWithCard({
    amount: 5000,
    reference: 'TEST-SUCCESS-' + Date.now(),
    card: {
      cardNumber: '5531886652142950',
      cvv: '564',
      expiryMonth: '09',
      expiryYear: '32',
      cardHolderName: 'TEST USER'
    }
  });
  
  console.log('Deposit initiated:', deposit.reference);
  
  // 3. Wait a bit (in sandbox, instant)
  await new Promise(resolve => setTimeout(resolve, 1000));
  
  // 4. Check balance after
  const walletAfter = await monei.wallet.me();
  const balanceAfter = parseFloat(walletAfter.nairaBalance);
  console.log('Balance after:', balanceAfter);
  console.log('Difference:', balanceAfter - balanceBefore);
  
  // 5. Verify
  if (balanceAfter === balanceBefore + 5000) {
    console.log('✓ Test passed!');
  } else {
    console.log('✗ Test failed!');
  }
}

await testSuccessfulDeposit();

Failed Flow

// Test failed payment
async function testFailedPayment() {
  console.log('Testing failed payment...\n');
  
  try {
    // Use test account that fails
    const payment = await monei.bills.pay({
      billerId: 'mtn-ng',
      customerId: '08011111111', // Test number that fails
      amount: 100,
      type: 'PREPAID'
    });
    
    console.log('✗ Should have failed!');
  } catch (error) {
    console.log('✓ Failed as expected');
    console.log('Error:', error.message);
  }
}

await testFailedPayment();

Testing Checklist

Deposits

Card deposit success
Card deposit with PIN
Card deposit with OTP
Card declined
Bank transfer
USSD deposit

Payouts

Bank transfer success
Bank transfer failed
P2P transfer
Insufficient balance
Invalid account

Bill Payments

Airtime success
Data bundle
Cable TV
Electricity
Payment failed
Invalid customer

Offramp

Initiate swap
Crypto deposit
Fiat transfer
Order tracking
Failed conversion

Crypto

EVM transactions
Solana transactions
Token swaps
Portfolio tracking
Balance checks

Webhooks

Signature verification
Event handling
Retry logic
Idempotency
Error handling

Moving to Production

When ready to go live:
1

Complete Testing

  • Test all workflows
  • Verify error handling
  • Check edge cases
  • Document test results
2

Get Production API Key

  • Generate live API key (sk_live_…)
  • Store securely
  • Never commit to git
3

Update Configuration

  • Change base URL to production
  • Use production API key
  • Update environment variables
4

Security Review

  • Enable HTTPS
  • Verify webhook signatures
  • Implement rate limiting
  • Review access controls
5

Monitoring Setup

  • Configure alerts
  • Set up logging
  • Enable error tracking
  • Monitor transactions
6

Start Small

  • Test with small amounts
  • Monitor closely
  • Gradually increase
  • Keep sandbox for testing

Best Practices

Test Thoroughly

Test all scenarios before production

Use Test Data

Always use provided test credentials

Document Tests

Keep record of test scenarios and results

Automate Testing

Create automated test suites

Keep Sandbox

Use sandbox for ongoing development

Monitor Both

Monitor sandbox and production separately

Next Steps

Testing Tools

Tools for testing your integration

Security

Security best practices

Error Handling

Handle errors properly

Webhooks

Test webhook integration