Payment Infrastructure for AI Agents

Give your agents
a financial brain

DainoPay is a standalone payment API built for autonomous AI agents. Wallets, double-entry ledger, policy engine, fraud detection — all behind a single API key.

Built for agentic commerce

Everything AI agents need to handle money safely and autonomously.

💰

Multi-Agent Wallets

Each agent gets its own wallet with independent balance tracking, spending limits, and freeze controls. Isolate funds per agent type.

📝

Double-Entry Ledger

Every transaction creates immutable debit + credit entries. The ledger is the source of truth — wallet balances are a verified cache.

Atomic Transactions

Transfers, deposits, and withdrawals execute inside PostgreSQL functions with row-level locks. No double-spending, ever.

🛡

Policy Engine

Define per-agent spending rules: daily limits, per-transaction caps, required approval thresholds. Policies are evaluated before every payment.

🔎

Fraud Detection

5-rule scoring engine: unusual amounts, velocity spikes, new counterparties, off-hours activity, round numbers. High-risk payments are auto-blocked.

🔌

Webhooks & Events

Subscribe to payment events with HMAC-signed webhooks. Exponential backoff retry with 5 attempts. Filter by event type.

Up and running in 5 minutes

A Stripe-like SDK that feels familiar from day one.

Install
Create Wallet
Transfer
Webhooks
// 1. Get your API key
curl -X POST https://your-dainopay.onrender.com/v1/api-keys \
  -H "Authorization: Bearer YOUR_BOOTSTRAP_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"client_name": "my-app", "environment": "live"}'

// Response: { "data": { "key": "dp_live_abc123...", ... } }

// 2. Download the SDK (single file, zero dependencies except axios)
curl -o DainoPayClient.js https://your-dainopay.onrender.com/sdk
npm install axios

// 3. Use it
const DainoPayClient = require('./DainoPayClient');
const dp = new DainoPayClient('dp_live_abc123...', {
  baseUrl: 'https://your-dainopay.onrender.com'
});
// Create a wallet for your order fulfillment agent
const wallet = await dp.createWallet({
  type: 'agent',
  agentType: 'order_fulfillment',
  label: 'Order Fulfillment Agent',
  currency: 'USD'
});

// Fund the wallet
await dp.deposit(wallet.id, {
  amount: 5000,
  description: 'Initial agent funding'
});

// Check balance
const balance = await dp.getWallet(wallet.id);
console.log(balance); // { balance: 5000, held_balance: 0 }
// Transfer between agent wallets
// Policy engine + fraud detection run automatically
const txn = await dp.createTransfer({
  fromWalletId: orderAgent.id,
  toWalletId: supplierWallet.id,
  amount: 149.99,
  description: 'Pay supplier for order #1042',
  category: 'supplier_payment',
  initiatedBy: 'order_fulfillment'
});

// If policy requires approval:
// txn.status === 'pending_approval'
// Your webhook gets a payment.requires_approval event

// Approve it:
await dp.approveTransaction(txn.id);
// Register a webhook endpoint
await dp.createWebhook({
  url: 'https://myapp.com/api/webhooks/dainopay',
  events: ['payment.completed', 'payment.requires_approval', 'fraud.alert']
});

// Verify incoming webhooks (Express example)
app.post('/api/webhooks/dainopay', (req, res) => {
  const signature = req.headers['dainopay-signature'];
  const valid = DainoPayClient.verifyWebhookSignature(
    req.body, signature, 'your_webhook_secret'
  );
  if (!valid) return res.status(401).send('Invalid signature');

  const { type, data } = req.body;
  console.log(`Event: ${type}`, data);
  res.json({ received: true });
});

API Reference

RESTful endpoints with Stripe-style JSON responses. All routes require Authorization: Bearer dp_live_xxx.

Wallets

  • GET /v1/wallets List all wallets
  • POST /v1/wallets Create a wallet
  • GET /v1/wallets/:id Get wallet details + balance
  • PUT /v1/wallets/:id Update wallet settings
  • POST /v1/wallets/:id/deposit Deposit funds
  • POST /v1/wallets/:id/withdraw Withdraw funds
  • POST /v1/wallets/:id/freeze Freeze wallet
  • POST /v1/wallets/:id/unfreeze Unfreeze wallet
  • GET /v1/wallets/:id/verify Verify balance against ledger
  • GET /v1/wallets/agent/:agentType Get wallet by agent type

Transactions

  • GET /v1/transactions List transactions
  • POST /v1/transactions Create transfer (policy + fraud checks)
  • GET /v1/transactions/:id Get transaction details
  • POST /v1/transactions/:id/reverse Reverse a transaction
  • POST /v1/transactions/:id/approve Approve pending transaction

Ledger & Policies

  • GET /v1/ledger Immutable ledger entries
  • GET /v1/policies List spending policies
  • POST /v1/policies Create/update a policy
  • DELETE /v1/policies/:id Delete a policy

Fraud & Analytics

  • GET /v1/fraud/events List fraud events
  • POST /v1/fraud/score Score a transaction
  • GET /v1/analytics/spending Spending analytics by agent
  • GET /v1/analytics/flow Money flow between wallets

Webhooks & Events

  • GET /v1/webhooks List webhook endpoints
  • POST /v1/webhooks Register webhook endpoint
  • DELETE /v1/webhooks/:id Delete webhook endpoint
  • GET /v1/events List events
  • POST /v1/api-keys Create API key (bootstrap)

Ready to give your agents a wallet?

Deploy DainoPay in minutes. One API key, full financial control.

Get Started