Skip to main content

Overview

This guide will walk you through making your first API call to Monei infrastructure. By the end, you’ll have executed a complete crypto-to-fiat transaction. What you’ll learn:
  • Setting up authentication
  • Making your first API call
  • Executing an offramp transaction
  • Handling responses and errors
Time to complete: 5 minutes

Prerequisites

Before you begin, make sure you have:
Sign up for a free account at monei.ccYou’ll receive:
  • API credentials
  • Access to sandbox environment
  • Dashboard for monitoring transactions
You’ll need one of the following:
  • Node.js (v16 or higher)
  • Python (v3.8 or higher)
  • cURL (for command-line testing)
For testing, you can use sandbox mode which doesn’t require real crypto or bank accounts.Get sandbox credentials from your dashboard.

Step 1: Get Your API Key

1

Login to Dashboard

Navigate to monei.cc and sign in
2

Generate API Key

Go to API KeysCreate New Key
Save your API key securely. It won’t be shown again after creation.
3

Choose Environment

Select either:
  • Sandbox - For testing with fake money
  • Production - For real transactions
Start with sandbox to avoid any real funds during development.

Step 2: Install SDK

Choose your preferred language and install the Monei SDK:

Step 3: Initialize Client

Set up your Monei client with your API credentials:
Always use environment variables for API keys. Never hardcode them in your source code.

Step 4: Your First API Call

Let’s fetch your account information to verify everything is working:
Expected Response:

Step 5: Complete Transaction Flow

Now let’s execute a complete offramp transaction. selling crypto for Naira:

5.1 Get Available Banks

5.2 Verify Bank Account

5.3 Get Exchange Quote

5.4 Execute Swap


Complete Example

Here’s the complete flow in one script:

Error Handling

Always implement proper error handling in production:

Next Steps

Congratulations! You’ve successfully completed your first Monei transaction. Here’s what to explore next:

Authentication

Learn about different auth methods and security best practices

Core Concepts

Understand wallets, transactions, and network management

API Reference

Explore all available endpoints and parameters

Webhooks

Set up real-time notifications for transaction events

Common Issues

Problem: API returns 401 UnauthorizedSolutions:
  • Verify your API key is correct
  • Check you’re using the right environment (sandbox vs production)
  • Ensure API key hasn’t expired
  • Confirm API key has necessary permissions
Problem: Error about unsupported networkSolutions:
  • Check supported networks
  • Verify network name is lowercase and hyphenated (e.g., bnb-smart-chain)
  • Ensure token is available on specified network
Problem: 429 Too Many RequestsSolutions:
  • Implement exponential backoff
  • Check your plan’s rate limits
  • Consider upgrading your plan
  • Cache responses when possible
Problem: Transaction stuck in pending stateSolutions:
  • Network congestion may cause delays
  • Check transaction on blockchain explorer
  • Contact support if pending for over 1 hour
  • Monitor via webhook for automatic updates

Support

Need help? We’re here for you:

Documentation

Browse our comprehensive guides

Discord Community

Ask questions and share knowledge

Email Support

Get help from our team