Home Dashboard Quickstart API v1.0
🧪 Interactive Playground

AgentBooks API

Double-entry ledger for AI agents. Ingest payments from Stripe, L402, and Lightning — AI categorizes them — balanced journal entries post automatically.

OpenAPI 3.0 Live Try-It curl · Python · Node.js ↓ openapi.json

Connect in 5 minutes

No OAuth, no webhooks to configure upfront. One registration call, one API key, you're in.

🔑 Authentication

Every request (except POST /api/register) requires your API key in the Authorization header:

Authorization: Bearer ab_your_key_here
  • Keys are prefixed ab_ and are shown once at creation — store them securely.
  • Rate limit: 100 req/min per key. Headers X-RateLimit-Limit / X-RateLimit-Remaining on every response.
  • Create additional keys or revoke old ones via your dashboard or POST /api/keys.
1

Register your agent

One call creates your org and returns an API key. No OAuth, no dashboard required.

curl -X POST https://agentbooks.polsia.app/api/register \
  -H "Content-Type: application/json" \
  -d '{"name": "My AI Agent"}'
2

Record a transaction

Pass your API key as a Bearer token. Works for manual entries and programmatic ingestion.

curl -X POST https://agentbooks.polsia.app/api/transactions \
  -H "Authorization: Bearer ab_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 49.99,
    "currency": "USD",
    "description": "Pro plan subscription",
    "source": "stripe",
    "external_id": "pi_3OsJK2abc123"
  }'
3

Run reconciliation

One call closes the books: AI categorizes all pending transactions and posts balanced journal entries.

curl -X POST https://agentbooks.polsia.app/api/reconciliation/run \
  -H "Authorization: Bearer ab_live_YOUR_KEY"

# Response:
# {
#   "events_processed": 3,
#   "transactions_categorized": 3,
#   "transactions_posted": 3,
#   "errors": []
# }
4

Check your trial balance

Verify the ledger is balanced. Total debits always equal total credits.

curl https://agentbooks.polsia.app/api/reconciliation/trial-balance \
  -H "Authorization: Bearer ab_live_YOUR_KEY"
5

Connect Stripe webhooks

Point Stripe to your feed endpoint. No signature verification config required — org is identified by query param.

# Your Stripe webhook URL:
# https://agentbooks.polsia.app/api/feeds/stripe?org_id=YOUR_ORG_ID

# Send a test event:
curl -X POST \
  "https://agentbooks.polsia.app/api/feeds/stripe?org_id=42" \
  -H "Content-Type: application/json" \
  -d '{
    "id": "evt_test_001",
    "type": "payment_intent.succeeded",
    "data": {
      "object": {
        "id": "pi_test_001",
        "amount": 4999,
        "currency": "usd"
      }
    }
  }'
🔬 Interactive Playground

Try every endpoint live

Authenticate with your API key, then execute requests directly against the production API.

🔑
Authentication: Click Authorize below and paste your API key (e.g. ab_live_xxx). Don't have one? Call POST /api/register (no auth required) to get one instantly.

Get early access to AgentBooks

Free during beta. No credit card. One API call gets you a key.

You're on the list.