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/v1Productionhttps://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.
Create an Account
Sign up at moneta.dev and connect your wallet. This is where you'll receive payments.
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.
Install the SDK
Install our official SDK for your platform:
# npm
npm install @moneta/sdk
# yarn
yarn add @moneta/sdk
# pnpm
pnpm add @moneta/sdkCreate 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' }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_xxxxxxxxxxxxxxxxxxxxAPI Key Types
mk_live_*Use for production. Real payments, real money.
mk_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.
/v1/invoicesRequest Body
| Parameter | Type | Required | Description |
|---|---|---|---|
amount | string | Payment amount (e.g., "100.00") | |
currency | string | Stablecoin code (USDT, EURC, xSGD, etc.) | |
description | string | Description shown to customer | |
customer_email | string | Customer email for receipt | |
expires_in | integer | Expiration time in seconds (default: 3600) | |
metadata | object | Custom 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.
/v1/payments// 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 emailTreasury API
Manage your multi-currency treasury. Check balances, convert between stablecoins via Sera Protocol, and view transaction history.
/v1/treasury/balancesconst 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' }
// ]/v1/treasury/convertconst 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.
| Event | Description |
|---|---|
invoice.created | Invoice was created |
invoice.paid | Invoice was paid successfully |
invoice.expired | Invoice expired without payment |
payment.created | Outgoing payment was initiated |
payment.completed | Payment was claimed/completed |
payment.failed | Payment failed or was rejected |
// 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.
// 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 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": {
"code": "invalid_amount",
"message": "Amount must be a positive number",
"param": "amount",
"doc_url": "https://docs.moneta.dev/errors/invalid_amount"
}
}| Status Code | Meaning |
|---|---|
200 | Success |
400 | Bad request (invalid parameters) |
401 | Unauthorized (invalid API key) |
404 | Resource not found |
429 | Rate limit exceeded |
500 | Server error |
Need Help?
Join our developer community on Discord or Telegram for support, feature requests, and to connect with other builders.