Moneta Developer Documentation

Everything you need to integrate stablecoin payments into your application. Accept payments, send payouts, and manage treasury—all with zero fees.

Overview

The Moneta API enables you to accept stablecoin payments, send payouts globally, and manage multi-currency treasury operations. Built on Sera Protocol, all transactions settle instantly with zero fees.

Instant Settlement

Payments settle in under 1 second. No waiting days for funds to clear.

Zero Fees

No transaction fees, no percentage cuts. Keep 100% of every payment.

Global Coverage

Accept USDT, EURC, xSGD, and 400+ stablecoins from customers worldwide.

Base URL

https://api.moneta.dev/v1Production
https://sandbox.moneta.dev/v1Sandbox (testing)

Quick Start

Get up and running with Moneta in under 5 minutes. Follow these steps to accept your first payment.

1

Create an Account

Sign up at moneta.dev and connect your wallet. This is where you'll receive payments.

2

Get Your API Keys

Navigate to Settings → API Keys in your dashboard. Create a new key pair for your application.

Important: Keep your secret key secure. Never expose it in client-side code.

3

Install the SDK

Install our official SDK for your platform:

# npm
npm install @moneta/sdk

# yarn
yarn add @moneta/sdk

# pnpm
pnpm add @moneta/sdk
4

Create Your First Invoice

Use the SDK to create a payment request:

// Using the Moneta SDK
import { Moneta } from '@moneta/sdk';

const moneta = new Moneta({
  apiKey: process.env.MONETA_API_KEY,
  environment: 'production', // or 'sandbox'
});

// Create an invoice
const invoice = await moneta.invoices.create({
  amount: '100.00',
  currency: 'USDT',
  description: 'Monthly subscription',
  expiresIn: 3600, // 1 hour
  metadata: { plan: 'pro' }
5

Handle the Payment

Redirect your customer to the payment URL, or embed our checkout widget. Set up webhooks to receive payment confirmations.

Authentication

All API requests require authentication using a Bearer token. Include your API key in the Authorization header of every request.

// Include in all API requests
Authorization: Bearer mk_live_xxxxxxxxxxxxxxxxxxxx

API Key Types

Live Keysmk_live_*

Use for production. Real payments, real money.

Test Keysmk_test_*

Use for development. No real transactions.

Invoices API

Create payment requests that customers can pay using stablecoins. Each invoice generates a unique payment URL and QR code.

POST/v1/invoices
Create a new invoice for a customer to pay

Request Body

ParameterTypeRequiredDescription
amountstringPayment amount (e.g., "100.00")
currencystringStablecoin code (USDT, EURC, xSGD, etc.)
descriptionstringDescription shown to customer
customer_emailstringCustomer email for receipt
expires_inintegerExpiration time in seconds (default: 3600)
metadataobjectCustom key-value pairs
// Create an invoice
const response = await fetch('https://api.moneta.dev/v1/invoices', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer mk_live_xxxx',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    amount: '100.00',
    currency: 'USDT',
    description: 'Payment for services',
    customer_email: '[email protected]',
    metadata: {
      order_id: 'ORD-12345',
      customer_name: 'John Doe'
    }
  }),
});

const invoice = await response.json();
// Returns: { id, payment_url, qr_code, status, expires_at }
console.log(invoice.payment_url);

Payments API

Send stablecoin payments to recipients via wallet address or email claim links. Perfect for payroll, contractor payments, and refunds.

POST/v1/payments
Send a payment to a single recipient
// Send a payment
const response = await fetch('https://api.moneta.dev/v1/payments', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer mk_live_xxxx',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    amount: '50.00',
    currency: 'USDT',
    recipient_type: 'email', // or 'wallet'
    recipient: '[email protected]',
    description: 'Freelance payment',
  }),
});

const payment = await response.json();
// Recipient receives claim link via email

Treasury API

Manage your multi-currency treasury. Check balances, convert between stablecoins via Sera Protocol, and view transaction history.

GET/v1/treasury/balances
Get current balances across all stablecoins
const response = await fetch('https://api.moneta.dev/v1/treasury/balances', {
  headers: { 'Authorization': 'Bearer mk_live_xxxx' },
});

const balances = await response.json();
// [
//   { currency: 'USDT', balance: '10000.00', usd_value: '10000.00' },
//   { currency: 'EURC', balance: '5000.00', usd_value: '5400.00' },
//   { currency: 'xSGD', balance: '8000.00', usd_value: '5920.00' }
// ]
POST/v1/treasury/convert
Convert between stablecoins via Sera Protocol (0% fee)
const response = await fetch('https://api.moneta.dev/v1/treasury/convert', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer mk_live_xxxx',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    from_currency: 'USDT',
    to_currency: 'EURC',
    amount: '1000.00'
  }),
});

const conversion = await response.json();
// { from_amount: '1000.00', to_amount: '925.93', rate: '0.92593' }

Webhooks

Receive real-time notifications when payment events occur. Webhooks are essential for automating order fulfillment and keeping your systems in sync.

Webhook Events
Events you can subscribe to
EventDescription
invoice.createdInvoice was created
invoice.paidInvoice was paid successfully
invoice.expiredInvoice expired without payment
payment.createdOutgoing payment was initiated
payment.completedPayment was claimed/completed
payment.failedPayment failed or was rejected
Webhook Handler Example
Verify signatures and handle events securely
// Webhook handler (Express.js example)
import crypto from 'crypto';

app.post('/webhooks/moneta', express.json(), (req, res) => {
  const signature = req.headers['x-moneta-signature'];
  const timestamp = req.headers['x-moneta-timestamp'];
  
  // Verify webhook signature
  const payload = timestamp + '.' + JSON.stringify(req.body);
  const expectedSig = crypto
    .createHmac('sha256', process.env.WEBHOOK_SECRET)
    .update(payload)
    .digest('hex');
  
  if (signature !== expectedSig) {
    return res.status(401).send('Invalid signature');
  }
  
  const event = req.body;
  
  switch (event.type) {
    case 'invoice.paid':
      // Handle successful payment
      await fulfillOrder(event.data.metadata.order_id);
      break;
    case 'invoice.expired':
      // Handle expired invoice
      await cancelOrder(event.data.metadata.order_id);
      break;
    case 'payment.completed':
      // Handle completed payout
      await notifyRecipient(event.data.recipient);
      break;
    case 'payment.failed':
      // Handle failed payout
      await retryPayment(event.data.id);
      break;
  }
  
  res.status(200).send('OK');
});

SDK Reference

Our official SDK provides a type-safe, intuitive interface for the Moneta API. Available for JavaScript/TypeScript with Python and Go coming soon.

Full SDK Example
Common operations using the Moneta SDK
// Using the Moneta SDK
import { Moneta } from '@moneta/sdk';

const moneta = new Moneta({
  apiKey: process.env.MONETA_API_KEY,
  environment: 'production', // or 'sandbox'
});

// Create an invoice
const invoice = await moneta.invoices.create({
  amount: '100.00',
  currency: 'USDT',
  description: 'Monthly subscription',
  expiresIn: 3600, // 1 hour
  metadata: { plan: 'pro' }
});

// Send a payment
const payment = await moneta.payments.send({
  amount: '50.00',
  currency: 'USDT',
  recipientEmail: '[email protected]',
  message: 'Payment for January work'
});

// Get treasury balances
const balances = await moneta.treasury.getBalances();
console.log(balances);
// [{ currency: 'USDT', balance: '10000.00' }, ...]

// Convert currencies via Sera Protocol
const conversion = await moneta.treasury.convert({
  from: 'USDT',
  to: 'EURC',
  amount: '1000.00'
});

Checkout Widgets

Embed a pre-built checkout experience directly in your website. No need to build payment UI from scratch.

React Checkout Widget
Drop-in checkout component for React applications
// React Payment Widget
import { MonetaCheckout } from '@moneta/react';

function CheckoutPage({ orderId, amount }) {
  return (
    <MonetaCheckout
      apiKey="mk_live_xxxx"
      amount={amount}
      currency="USDT"
      metadata={{ orderId }}
      onSuccess={(payment) => {
        console.log('Payment successful:', payment.id);
        router.push('/thank-you');
      }}
      onError={(error) => {
        console.error('Payment failed:', error);
        toast.error('Payment failed. Please try again.');
      }}
      theme={{
        primaryColor: '#10b981',
        borderRadius: '12px'
      }}
    />
  );
}

Error Handling

The API uses standard HTTP status codes and returns detailed error messages to help you debug issues quickly.

Error Response Format
{
  "error": {
    "code": "invalid_amount",
    "message": "Amount must be a positive number",
    "param": "amount",
    "doc_url": "https://docs.moneta.dev/errors/invalid_amount"
  }
}
Status CodeMeaning
200Success
400Bad request (invalid parameters)
401Unauthorized (invalid API key)
404Resource not found
429Rate limit exceeded
500Server error

Need Help?

Join our developer community on Discord or Telegram for support, feature requests, and to connect with other builders.