SANDBOX

API Documentation

RESTful API for AI agents and programmatic wallet management

Authentication

All API requests require authentication via session cookies. Login via /login endpoint.

Wallets

POST /api/wallets

Create a new wallet

{
  "wallet_id": "wallet_abc123",
  "owner_email": "user@example.com",
  "balance": 0.0,
  "created_at": "2024-01-01T00:00:00"
}

GET /api/wallets/{wallet_id}

Get wallet details and current balance

Transactions

POST /api/deposit

Deposit funds to wallet

{
  "wallet_id": "wallet_abc123",
  "amount": 100.00
}

POST /api/payment

Create a payment transaction (subject to rules)

{
  "wallet_id": "wallet_abc123",
  "amount": 50.00,
  "merchant": "OpenAI",
  "category": "api_services"
}

Response includes status: approved, held, or denied

POST /api/approve

Approve or deny a held transaction

{
  "transaction_id": "txn_xyz789",
  "action": "approve",
  "admin_email": "admin@example.com"
}

GET /api/transactions/{wallet_id}

Get transaction history for a wallet

Spending Rules

POST /api/rules

Create a spending rule

{
  "wallet_id": "wallet_abc123",
  "rule_type": "amount_limit",
  "condition": {"max_amount": 500},
  "action": "hold",
  "priority": 10
}

GET /api/rules/{wallet_id}

Get all rules for a wallet

Audit & Compliance

GET /api/audit/export

Export complete audit log as CSV

GET /api/audit/verify

Verify integrity of audit hash chain

Default Rules Engine

Go to Dashboard