Skip to content

API reference

Three surfaces. All bind 127.0.0.1.

SurfaceDefault portAuth
Operator control API4023Operator bearer token
Agent payment API4022Per-agent token if any agent is registered
Agent MCP server4024/mcpPer-agent token if any agent is registered

Control API (:4023)

Authentication: Authorization: Bearer <token> header, or ?token=<token> query parameter (constant-time compared). Every route except GET / requires it.

Status, audit and reporting

MethodPathReturns
GET/The control-plane web UI
GET/statusFreeze state, queue sizes
GET/reportSpend report (counters, totals per currency, mandates, orders, per-agent breakdown)
GET/auditThe whole audit ledger
GET/audit?paymentId=…One payment's trail
GET/audit/verify{ ok, events, brokenAt?, reason? }

Freeze

MethodPathBodyEffect
POST/freeze{ "reason": "..." }Freeze the wallet
POST/unfreezeLift the freeze

Mandates

MethodPathBody
GET/mandates
POST/mandatesMandate JSON (see below)
GET/mandates/:id
POST/mandates/:id/revoke

A mandate body:

jsonc
{
  "id": "groceries",
  "grantedBy": "operator",
  "cap": { "amount": "15000", "currency": "USD" },
  "perTxnCap": { "amount": "8000", "currency": "USD" },
  "perItemCap": { "amount": "2000", "currency": "USD" },
  "window": { "cap": { "amount": "50000", "currency": "USD" }, "durationMs": 604800000 },
  "rails": ["acp"],
  "allowedPayees": ["..."],
  "allowedCategories": ["groceries"],
  "blockedCategories": ["alcohol"],
  "allowedMerchants": ["grocer-1"],
  "allowedMerchantDomains": ["shop.realgrocer.com"],
  "agentId": "shopping-agent",
  "expiresAt": "2027-01-01T00:00:00Z"
}

Money amounts are integer minor units as strings — "15000" = $150.00.

Approvals

MethodPathBodyEffect
GET/approvalsList pending approvals
POST/approvals/:id/resolve{ "approved": true | false }Approve or reject

Funding source

MethodPathBody
GET/funding-source
POST/funding-source{ "paymentMethodId": "pm_…", "brand": "...", "last4": "...", "label": "..." }
DELETE/funding-source

The GET view never echoes the raw paymentMethodId.

Agents

MethodPathBody
GET/agents
POST/agents{ "id": "...", "label": "..." } — returns the bearer token once
DELETE/agents/:id

Payment API (:4022)

MethodPathBody
POST/payA PaymentInput

If agents are registered, an Authorization: Bearer <agent-token> header is required; the resolved agentId is bound to the payment. agentId cannot be set from the body.

jsonc
{
  "rail": "x402",
  "amount": { "amount": "500", "currency": "USD" },
  "payee": { "address": "https://api.example.com", "label": "Example", "category": "..." },
  "memo": "...",
  "mandateId": "..."
}

Returns a PayResult — one of:

jsonc
{ "status": "settled",          "paymentId": "...", "settlement": {...} }
{ "status": "denied",           "paymentId": "...", "reason": "..." }
{ "status": "failed",           "paymentId": "...", "reason": "..." }
{ "status": "pending_approval", "paymentId": "...", "approvalId": "...", "reason": "..." }

MCP server (:4024/mcp)

Streamable HTTP transport — stateless, one server-and-transport per request, sharing the one wallet. Same agent-token rule as the payment API.

Tools

  • request_payment(rail, amount, currency, payeeAddress, payeeLabel?, memo?, mandateId?)
  • get_payment_status(paymentId)
  • list_mandates()
  • acp_create_checkout(merchantEndpoint, currency, items, buyerEmail?)
  • acp_update_checkout(merchantEndpoint, sessionId, items)
  • acp_checkout_status(merchantEndpoint, sessionId)
  • pay_checkout(merchantEndpoint, merchantId, sessionId, maxAmount, currency, merchantName?, mandateId?, memo?)

See For agents and Agentic checkout for inputs / outputs.

Ledger event types

Every event the wallet appends. The full vocabulary:

payment.requested  policy.decided  payment.blocked
payment.settled    payment.failed
approval.requested approval.resolved approval.expired
mandate.created    mandate.revoked
wallet.frozen      wallet.unfrozen
funding.registered funding.cleared
agent.registered   agent.revoked

Each event carries seq, at, type, paymentId?, data, and the tamper-evidence fields hash (+ signature / keyId when signing is on).

A policy-governed payment wallet for AI agents.