REST and MCP
Invoicing API for AI agents
Create, send, remind, and record payments through REST or MCP. Every write is idempotent. Every action has an actor. Every billing record can be verified. The same invoice the merchant sees in the dashboard is the object your agent writes.
MCP quick start
Point an MCP client at https://www.clientbilling.com/api/mcp with a Bearer API key. Bind the key to a service account under Settings, API keys so every write records that actor on the invoice's billing activity.
{
"mcpServers": {
"clientbilling": {
"url": "https://www.clientbilling.com/api/mcp",
"headers": {
"Authorization": "Bearer cb_live_..."
}
}
}
}Tools: list_invoices, get_invoice, create_invoice, send_invoice, send_reminder, record_payment, get_payment_costs, verify_record (planned, until the proof engine ships). There are no tools that charge a card, refund, or move funds.
OpenAPI example
Create a draft with an idempotency key. The response includes the actor that performed the write.
curl -s -X POST https://www.clientbilling.com/api/v1/invoices \
-H "Authorization: Bearer cb_live_..." \
-H "Idempotency-Key: create-1001" \
-H "Content-Type: application/json" \
-d '{
"newClient": { "name": "Jane Client", "email": "jane@example.com" },
"lines": [{ "description": "Consulting", "quantity": 10, "unitPrice": 150 }]
}'Machine-readable OpenAPI: /docs/api/openapi.json.
Idempotency and actors
REST mutations require an Idempotency-Key header. MCP write tools take an idempotencyKey argument. The same key with the same body replays; a different body returns a conflict. Each mutation records who acted: a user, an API key, or a service account bound to the key. Open the invoice in the app to see billing activity with that actor.
Test keys use the cb_test_ prefix and share an allowance of 100 writes a day on REST and MCP, currently free. Live keys have no daily write quota today; both kinds are held to 120 requests a minute. A Machine tier is planned, its pricing is not set, and the terms give 30 days of notice before anything free becomes paid.
Test keys act on your real account. They create real invoices and record real payments against them, and there is no separate test dataset today. They cannot send email: a send or a reminder from a test key is refused, because it would reach the real client on file. Use a live key to test the send path.
Full HTTP details live in the API reference.