Documentation
The Nodela API enables you to create invoices, process payments in cryptocurrency and verify transactions programmatically. Whether you're building and e-commerce platform,subscription service, or any application that needs to accept crypto payments, this API provides the tools you need.
# Getting Started
To get started, you'll first need ti create a Nodela account and generate your API keys from the dashboard. Once your acount is set up, you can immeduately create test API keys (nk_test_) to begin building and testing your integration. However, live API keys (nk_live_) are only available after your KYC/KYB verification has been approved. Before you can process real payments in production,you'll need to complete the KYC/KYB process and await approval, which typically takes 24-48 hours.
Create an Account
Sign up for a Nodela account to get your API keys.
# Authentication
All API endpoints except /health require authentication. Nodela uses API keys to authenticate requests and determine whether to operate in test or live mode.
API Key Types
| Key Type | Prefix | Environment | Description |
|---|---|---|---|
| Test | nk_test_ | Sandbox | For development and testing. No real transactions occur. |
| Live | nk_live_ | Production | For live applications. Real cryptocurrency transactions are processed. |
Your API key carries significant privileges, so keep it secure. Do not share your API key in publicly accessible areas such as GitHub repositories, client-side code, or public forums.
Authentication Methods
Nodela supports two methods for providing your API key. Both methods are equally valid, so choose whichever fits best with your existing codebase or framework.
Method 1: X-API-Key Header
Pass your API key directly using the X-API-Key HTTP header. This is a straightforward approach commonly used in API integrations.
curl -X GET "https://api.nodela.co/v1/transactions" \
-H "X-API-Key: nk_test_abc123..."Method 2: Bearer Token
Pass your API key using the standard Authorization header with the Bearer scheme. This approach follows OAuth 2.0 conventions and may integrate more easily with frameworks that expect Bearer token authentication.
curl -X GET "https://api.nodela.co/v1/transactions" \
-H "Authorization: Bearer nk_test_abc123..."Which Method Should I Use?
Both authentication methods provide identical functionality. Here are some considerations:
- X-API-Key is more explicit and makes it immediately clear that you're using an API key for authentication. It's a good choice for simple integrations or when you want clarity in your codebase.
- Bearer Token follows the widely-adopted OAuth 2.0 convention. If your application already uses Bearer tokens for other services, or if your HTTP client or framework has built-in support for Bearer authentication, this method may fit more naturally into your existing code.
Authentication Errors
If authentication fails, the API returns one of the following errors:
Missing API Key (401)
{
"success": false,
"error": {
"code": "missing_api_key",
"message": "API key is required"
}
}This error occurs when no API key is provided in either the X-API-Key or Authorization header.
Invalid API Key (401)
{
"success": false,
"error": {
"code": "invalid_api_key",
"message": "API key not found, inactive, or malformed"
}
}This error occurs when the provided API key does not exist, has been deactivated, or is incorrectly formatted.
# API Reference
Base URL
https://api.nodela.coHealth Check
Check the API and database health status. Use this endpoint to verify that the API is operational before making other requests.
GET /healthAuthentication: Not required
Request
curl -X GET "https://api.nodela.co/health"Response
Success (200 OK)
{
"status": "healthy"
}Service Unavailable (503)
{
"status": "unhealthy"
}Invoices
The Invoices API allows you to create payment requests and verify their status. When you create an invoice, your customer receives a checkout URL where they can complete their payment in cryptocurrency.
Create Invoice
Create a new invoice for payment processing. The response includes a checkout_url that you should redirect your customer to for payment.
POST /v1/invoicesAuthentication: Required
Request Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
amount | number | Yes | Amount to charge. Must be greater than 0. |
currency | string | Yes | Currency code. Accepts USD or NGN. |
success_url | string | No | URL to redirect the customer after successful payment. |
cancel_url | string | No | URL to redirect the customer if payment is cancelled. |
webhook_url | string | No | URL for payment notifications. Must be pre-registered in your dashboard. |
reference | string | No | Your unique reference for this invoice. Must be unique across all your invoices. |
customer | object | No | Customer information object. |
customer.email | string | Conditional | Customer's email address. Required if customer object is provided. |
customer.name | string | No | Customer's name. |
title | string | No | Invoice title displayed to the customer. |
description | string | No | Invoice description with additional details. |
Request
curl -X POST "https://api.nodela.co/v1/invoices" \
-H "Content-Type: application/json" \
-H "X-API-Key: nk_test_abc123..." \
-d '{
"amount": 50000,
"currency": "NGN",
"success_url": "https://example.com/success",
"cancel_url": "https://example.com/cancel",
"webhook_url": "https://example.com/webhook",
"reference": "order-12345",
"customer": {
"email": "customer@example.com",
"name": "John Doe"
},
"title": "Product Purchase",
"description": "Order #12345"
}'Response
Success (201 Created)
{
"success": true,
"data": {
"id": "6789abcd1234567890abcdef",
"invoice_id": "NOD_INV_1234567890",
"original_amount": 50000,
"original_currency": "NGN",
"amount": 33.33,
"currency": "USD",
"exchange_rate": 1500.0,
"webhook_url": "https://example.com/webhook",
"customer": {
"email": "customer@example.com",
"name": "John Doe"
},
"checkout_url": "https://checkout.nodela.co/checkout?id=6789abcd1234567890abcdef&invoice_id=NOD_INV_1234567890",
"status": "pending",
"created_at": "2026-01-30T12:00:00Z"
}
}Response Fields
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier of the invoice. |
invoice_id | string | Human-readable invoice ID. Format: NOD_INV_* for live mode, NOD_TEST_INV_* for test mode. |
original_amount | number | Amount in the original currency you specified. |
original_currency | string | The currency code you provided in the request. |
amount | number | Amount in USD after conversion (if applicable). |
currency | string | Always USD. |
exchange_rate | number | Exchange rate used for conversion. Only present if currency conversion occurred. |
webhook_url | string | Webhook URL for notifications. Only present if provided in the request. |
customer | object | Customer information. Only present if provided in the request. |
checkout_url | string | URL to redirect your customer to complete payment. |
status | string | Invoice status. One of: pending, paid, cancelled, expired. |
created_at | string | ISO 8601 timestamp of when the invoice was created. |
Currency Conversion
When you create an invoice with currency set to NGN, the amount is automatically converted to USD using real-time exchange rates.
- The
exchange_ratefield in the response shows the NGN per USD rate used - The final
amountis rounded to 2 decimal places
Example Conversion:
| Input | Exchange Rate | Output |
|---|---|---|
| 50,000 NGN | 1,500 NGN/USD | 33.33 USD |
Error Responses
Validation Error (400)
{
"success": false,
"error": {
"code": "validation_error",
"message": "Amount is required; Currency must be one of: NGN USD"
}
}Invalid Webhook (400)
{
"success": false,
"error": {
"code": "invalid_webhook",
"message": "Webhook URL not registered for this user"
}
}Duplicate Reference (409)
{
"success": false,
"error": {
"code": "duplicate_reference",
"message": "duplicate reference: order-12345"
}
}Currency Service Unavailable (503)
{
"success": false,
"error": {
"code": "currency_error",
"message": "Exchange rate service unavailable"
}
}Verify Invoice
Verify the status of an invoice and retrieve payment details. Use this endpoint to confirm that a payment was successful before fulfilling an order.
GET /v1/invoices/{invoice_id}/verifyAuthentication: Required
URL Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
invoice_id | string | Yes | The invoice ID to verify. Format: NOD_INV_* or NOD_TEST_INV_* |
Request
curl -X GET "https://api.nodela.co/v1/invoices/NOD_INV_1234567890/verify" \
-H "X-API-Key: nk_test_abc123..."Response
Success (200 OK)
{
"success": true,
"data": {
"id": "6789abcd1234567890abcdef",
"invoice_id": "NOD_INV_1234567890",
"reference": "order-12345",
"original_amount": 50000,
"original_currency": "NGN",
"amount": 33.33,
"currency": "USD",
"exchange_rate": 1500.0,
"title": "Product Purchase",
"description": "Order #12345",
"status": "paid",
"paid": true,
"customer": {
"email": "customer@example.com",
"name": "John Doe"
},
"created_at": "2026-01-30T12:00:00Z",
"payment": {
"id": "abc123def456789012345678",
"network": "ethereum",
"token": "USDT",
"address": "0x1234567890abcdef...",
"amount": 33.33,
"status": "completed",
"tx_hash": ["0xabc123..."],
"transaction_type": "credit",
"payer_email": "customer@example.com",
"created_at": "2026-01-30T12:05:00Z"
}
}
}Response Fields
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier of the invoice. |
invoice_id | string | Human-readable invoice ID. |
reference | string | Your reference provided during creation. Only present if provided. |
original_amount | number | Amount in the original currency. |
original_currency | string | The original currency code. |
amount | number | Amount in USD. |
currency | string | Always USD. |
exchange_rate | number | Exchange rate used. Only present if conversion occurred. |
title | string | Invoice title. Only present if provided. |
description | string | Invoice description. Only present if provided. |
status | string | Invoice status. One of: pending, paid, cancelled, expired. |
paid | boolean | Whether the invoice has been paid. |
customer | object | Customer information. Only present if provided. |
created_at | string | ISO 8601 timestamp of invoice creation. |
payment | object | Payment details. Only present if a payment exists. |
Payment Object Fields
| Field | Type | Description |
|---|---|---|
id | string | Unique payment ID. |
network | string | Blockchain network used. Examples: ethereum, polygon. |
token | string | Token used for payment. Examples: USDT, USDC. |
address | string | Wallet address that received the payment. |
amount | number | Amount received in USD. |
status | string | Payment status. |
tx_hash | array | Array of transaction hashes on the blockchain. |
transaction_type | string | Always credit for deposits. |
payer_email | string | Payer's email address. Only present if provided. |
created_at | string | ISO 8601 timestamp of the payment. |
Verifying Payment Success
To confirm a payment was successful, check both conditions:
statusequalspaidpaidequalstrue
if (data.data.status === "paid" && data.data.paid === true) {
// Payment confirmed - fulfill the order
}Important Notes
- The
paymentobject is only included when a payment has been made - Test API keys can only verify test invoices (
NOD_TEST_INV_*) - Live API keys can only verify live invoices (
NOD_INV_*) - The invoice must belong to the authenticated user
Error Responses
Invoice Not Found (404)
{
"success": false,
"error": {
"code": "invoice_not_found",
"message": "Invoice not found"
}
}Transactions
The Transactions API allows you to list all payments made through your API integration with pagination support.
List Transactions
Retrieve a paginated list of all transactions made through your API integration. This endpoint returns invoices created via the API, not payment links.
GET /v1/transactionsAuthentication: Required
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
page | integer | 1 | Page number (1-indexed). |
limit | integer | 20 | Number of items per page. Maximum: 100. |
Request
# Get first page with default limit
curl -X GET "https://api.nodela.co/v1/transactions" \
-H "X-API-Key: nk_test_abc123..."
# Get page 2 with 50 items per page
curl -X GET "https://api.nodela.co/v1/transactions?page=2&limit=50" \
-H "X-API-Key: nk_test_abc123..."Response
Success (200 OK)
{
"success": true,
"data": {
"transactions": [
{
"id": "6789abcd1234567890abcdef",
"invoice_id": "NOD_INV_1234567890",
"reference": "order-12345",
"original_amount": 50000,
"original_currency": "NGN",
"amount": 33.33,
"currency": "USD",
"exchange_rate": 1500.0,
"title": "Product Purchase",
"description": "Order #12345",
"status": "paid",
"paid": true,
"customer": {
"email": "customer@example.com",
"name": "John Doe"
},
"created_at": "2026-01-30T12:00:00Z",
"payment": {
"id": "abc123def456789012345678",
"network": "ethereum",
"token": "USDT",
"address": "0x1234567890abcdef...",
"amount": 33.33,
"status": "completed",
"tx_hash": ["0xabc123..."],
"transaction_type": "credit",
"payer_email": "customer@example.com",
"created_at": "2026-01-30T12:05:00Z"
}
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 45,
"total_pages": 3,
"has_more": true
}
}
}Pagination Object
| Field | Type | Description |
|---|---|---|
page | integer | Current page number. |
limit | integer | Items per page. |
total | integer | Total number of transactions. |
total_pages | integer | Total number of pages. |
has_more | boolean | Whether more pages exist after the current page. |
Pagination Example
Here's how to iterate through all transactions:
async function getAllTransactions() {
const allTransactions = [];
let page = 1;
let hasMore = true;
while (hasMore) {
const response = await fetch(`https://api.nodela.co/v1/transactions?page=${page}&limit=100`, {
method: "GET",
headers: {
"X-API-Key": "nk_test_abc123..."
}
});
const data = await response.json();
allTransactions.push(...data.data.transactions);
hasMore = data.data.pagination.has_more;
page++;
}
return allTransactions;
}Important Notes
- Only returns invoices created via API integration (not payment links)
- Transactions are sorted by creation date, newest first
- The
paymentobject contains only the credit (deposit) payment - Test API keys return test transactions; live keys return live transactions
- The maximum
limitis 100; values above this are automatically capped
Errors
All API errors follow a consistent format to make error handling straightforward in your application.
Error Response Format
{
"success": false,
"error": {
"code": "error_code",
"message": "Human-readable error message"
}
}Error Codes Reference
| HTTP Status | Code | Description |
|---|---|---|
| 400 | invalid_request | Malformed JSON or invalid request format. |
| 400 | validation_error | Required fields missing or invalid values provided. |
| 400 | invalid_webhook | Webhook URL has not been registered for this user. |
| 401 | missing_api_key | No API key was provided in the request headers. |
| 401 | invalid_api_key | API key not found, inactive, or incorrectly formatted. |
| 404 | invoice_not_found | Invoice does not exist or does not belong to the authenticated user. |
| 409 | duplicate_reference | The reference has already been used for another invoice. |
| 500 | internal_error | An unexpected server error occurred. |
| 503 | currency_error | Exchange rate service is temporarily unavailable. |
Error Handling Example
const response = await fetch("https://api.nodela.co/v1/invoices", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-API-Key": "nk_test_abc123..."
},
body: JSON.stringify({
amount: 50000,
currency: "NGN"
})
});
const data = await response.json();
if (!data.success) {
switch (data.error.code) {
case "validation_error":
console.error("Invalid request:", data.error.message);
break;
case "duplicate_reference":
console.error("Reference already exists:", data.error.message);
break;
case "invalid_api_key":
console.error("Authentication failed:", data.error.message);
break;
case "currency_error":
console.error("Try again later:", data.error.message);
break;
default:
console.error("Error:", data.error.message);
}
} else {
// Success - process the invoice
console.log("Invoice created:", data.data.invoice_id);
}# Webhooks
Set up webhooks to receive real-time notifications about events in your account.
# Integrations
Connect Nodela with your favorite tools and platforms.
# Security
Nodela implements several security measures to protect your account and transactions. This section covers the built-in security features and best practices for keeping your integration secure.
Built-in Security Features
API Key Isolation
Test and live environments are completely isolated from each other. Test API keys (nk_test_) can only access test data, and live API keys (nk_live_) can only access production data. This separation ensures that development and testing activities never interfere with real transactions or customer data.
Webhook URL Verification
To prevent unauthorized parties from receiving your payment notifications, webhook URLs must be pre-registered in your dashboard before they can be used. When you create an invoice with a webhook_url, the API verifies that the URL has been registered to your account. If the URL is not registered, the request is rejected with an invalid_webhook error.
User Isolation
All invoices and transactions are scoped to the authenticated user. You can only access, verify, or list invoices that belong to your account. Attempting to access another user's invoice returns an invoice_not_found error, preventing any data leakage between accounts.
Keeping Your API Keys Safe
Your API keys grant access to your Nodela account and should be treated like passwords. Follow these best practices to keep them secure:
Never expose keys in client-side code. API keys should only be used in server-side code. Never include them in JavaScript that runs in the browser, mobile app source code, or any code that end users can access.
Use environment variables. Store your API keys in environment variables rather than hardcoding them in your source code. This prevents accidental exposure through version control systems.
# .env file (never commit this to version control)
NODELA_API_KEY=nk_live_abc123...Add sensitive files to .gitignore. Ensure that files containing API keys (like .env) are listed in your .gitignore file to prevent them from being committed to your repository.
# .gitignore
.env
.env.local
.env.productionUse different keys for different environments. Use test keys for development and staging environments, and reserve live keys for production only. This limits exposure and makes it easier to rotate keys if needed.
Limit access within your team. Only share API keys with team members who need them. Use your dashboard's team management features to control access rather than sharing keys directly.
Monitor your API usage. Regularly review your transaction history and API logs in the dashboard. Unusual activity could indicate that your keys have been compromised.
Regenerating API Keys
If you suspect your API key has been compromised, or as part of routine security practices, you should regenerate your keys immediately.
To regenerate an API key:
- Log in to your Nodela dashboard
- Navigate to the API keys section
- Click Regenerate next to the key you want to replace
- Copy the new key immediately
Important: Your new API key is only displayed once at the time of generation. Make sure to copy it and store it securely before leaving the page. Once you navigate away, you will not be able to view the full key again.
After regenerating a key, the old key is immediately invalidated. Any requests using the old key will fail with an invalid_api_key error. Be prepared to update your applications with the new key to avoid service interruptions.
# SDKs & Libraries
Official SDKs and community libraries to help you integrate faster.
# Frequently Asked Questions
Find answers to common questions about Nodela.
General
What is Nodela?
Nodela is a cryptocurrency payment processing API that allows you to accept crypto payments in your application. You create invoices, redirect your customers to a checkout page, and receive payments in cryptocurrency.
What currencies can I accept?
You can create invoices in USD or NGN. All payments are ultimately processed in cryptocurrency (such as USDT or USDC) on supported blockchain networks. When you create an invoice in NGN, the amount is automatically converted to USD using real-time exchange rates.
Which blockchain networks are supported?
Nodela supports payments on multiple blockchain networks including Ethereum and Polygon. The available networks are presented to your customers at checkout.
Which tokens can customers pay with?
Customers can pay using stablecoins such as USDT and USDC. The available tokens are displayed on the checkout page.
Account & API Keys
How do I get my API keys?
After creating a Nodela account, you can generate API keys from your dashboard. Navigate to the API keys section and create a new key. Test keys are available immediately, while live keys require KYC approval.
What's the difference between test and live keys?
Test keys (nk_test_) are for development and testing. They operate in a sandbox environment where no real transactions occur. Live keys (nk_live_) are for production and process real cryptocurrency payments. Data between the two environments is completely isolated.
Why can't I create a live API key?
Live API keys are only available after your KYC verification has been approved. Complete the KYC process in your dashboard and wait for approval, which typically takes 24 to 48 hours.
Can I have multiple API keys?
Yes, you can create multiple API keys for different applications or environments. Each key can be independently regenerated or revoked without affecting the others.
What happens if I regenerate my API key?
When you regenerate an API key, the old key is immediately invalidated and a new key is generated. Any requests using the old key will fail. Make sure to copy your new key immediately as it is only displayed once.
Invoices & Payments
How do I create an invoice?
Send a POST request to /v1/invoices with the amount, currency, and any optional fields like customer information or redirect URLs. The response includes a checkout_url that you redirect your customer to for payment.
How long is an invoice valid?
Invoices have an expiration period after which they can no longer be paid. The status changes to expired once this period passes. Check your dashboard for the specific expiration settings.
Can I cancel an invoice?
Invoice cancellation is managed through your dashboard. Once cancelled, the invoice status changes to cancelled and the checkout URL will no longer accept payments.
How do I know when a payment is complete?
You have two options. First, you can use the verify endpoint (GET /v1/invoices/{invoice_id}/verify) to check the invoice status. A successful payment shows status: "paid" and paid: true. Second, you can register a webhook URL to receive real-time notifications when payment status changes.
What does the exchange rate field mean?
When you create an invoice in NGN, Nodela converts the amount to USD using real-time exchange rates. The exchange_rate field shows the NGN per USD rate that was used. For example, if you create an invoice for 50,000 NGN and the exchange rate is 1,500, the final amount is 33.33 USD.
Can customers make partial payments?
The payment must match the invoice amount. Partial payments are not supported.
What happens if a customer overpays?
The checkout system is designed to request the exact invoice amount. Overpayment handling depends on the specific token and network. Contact support if this situation occurs.
Webhooks
What are webhooks?
Webhooks are HTTP callbacks that notify your server when events occur, such as when a payment is completed. Instead of polling the API to check payment status, you receive a notification automatically.
How do I set up webhooks?
Register your webhook URL in your Nodela dashboard before using it. Once registered, you can include the URL in your invoice creation requests using the webhook_url parameter.
Why is my webhook URL being rejected?
Webhook URLs must be pre-registered in your dashboard before they can be used. If you receive an invalid_webhook error, check that the URL is correctly registered and matches exactly what you're sending in the request.
Are webhook deliveries retried if my server is down?
Webhook retry policies ensure that notifications are delivered even if your server is temporarily unavailable. Check the webhook documentation for specific retry intervals and limits.
Errors & Troubleshooting
Why am I getting a "missing_api_key" error?
This error means no API key was provided in your request. Include your API key in either the X-API-Key header or the Authorization: Bearer header.
Why am I getting an "invalid_api_key" error?
This error occurs when the API key is not found, has been deactivated, or is malformed. Verify that you're using the correct key and that it hasn't been regenerated. Also ensure you're using a test key for test endpoints and a live key for production.
Why am I getting a "duplicate_reference" error?
Each invoice reference must be unique within your account. If you're receiving this error, you've already created an invoice with the same reference. Use a different reference or check your existing invoices.
Why am I getting a "currency_error" error?
This error occurs when the exchange rate service is temporarily unavailable. This is usually a temporary issue. Wait a few moments and retry your request.
Why can't I find my invoice when verifying?
The invoice_not_found error can occur for several reasons. Ensure you're using the correct invoice_id (not the MongoDB id). Verify that you're using the right API key type—test keys can only access test invoices, and live keys can only access live invoices. Also confirm that the invoice belongs to your account.
My payment shows as completed but the invoice is still pending. What happened?
There may be a slight delay between payment confirmation on the blockchain and invoice status update. If the issue persists for more than a few minutes, contact support with your invoice ID and transaction hash.
Testing
How do I test my integration?
Use test API keys (nk_test_) to create invoices in the sandbox environment. Test invoices have IDs prefixed with NOD_TEST_INV_ and no real transactions occur.
Can I simulate a successful payment in test mode?
Check your dashboard for test mode simulation options, or contact support for information on how to trigger test payments.
How do I switch from test to live mode?
Once your KYC is approved, create a live API key from your dashboard. Update your application to use the live key (nk_live_) and the production base URL. Ensure you've thoroughly tested your integration before going live.
Support
How do I contact support?
You can reach the Nodela support team through your dashboard or by emailing the support address provided in your account settings.
Where can I report a bug or request a feature?
Use the support channels in your dashboard to report bugs or submit feature requests. Include as much detail as possible, including request IDs and timestamps when reporting issues.
Need Help?
Can't find what you're looking for? Our support team is here to help.
