Skip to Content
API ReferenceOverview

API Reference

RustBill exposes two API surfaces:

  • Admin API (/api/*) — Session-authenticated endpoints for dashboard operations
  • Public API (/api/v1/*) — API key-authenticated endpoints for integrations

Base URL

http://localhost:3001

Authentication

API SurfaceMethodHeader/Cookie
Admin APISession cookieCookie: session=<token>
Public APIBearer tokenAuthorization: Bearer <api-key>
WebhooksSignature verificationProvider-specific headers
CronSecret headerX-Cron-Secret: <secret>

Common Response Format

Success

{ "id": "01JQXYZ...", "name": "Example", "createdAt": "2026-01-15T10:30:00Z", "updatedAt": "2026-01-15T10:30:00Z" }

List endpoints return arrays directly:

[ { "id": "01JQXYZ...", "name": "Example 1" }, { "id": "01JQABC...", "name": "Example 2" } ]

Errors

{ "error": "not_found", "message": "Product not found" }

Validation errors include field-level details:

{ "error": "validation_error", "message": "Validation failed", "fields": { "email": "Invalid email format", "name": "Name is required" } }

HTTP Status Codes

CodeMeaning
200Success
201Created
204Deleted (no content)
400Bad request / validation error
401Unauthorized (missing or invalid auth)
403Forbidden (insufficient permissions)
404Resource not found
409Conflict (duplicate resource)
500Internal server error

Endpoint Groups

GroupBase PathAuthDescription
Products/api/productsSessionProduct catalog CRUD
Customers/api/customersSessionCustomer management
Subscriptions/api/billing/subscriptionsSessionSubscription lifecycle
Invoices/api/billing/invoicesSessionInvoice generation & management
Licenses/api/licensesSession / PublicLicense key management
Payments/api/billing/paymentsSessionPayment recording & processing
Webhooks/api/billing/webhooksSignatureInbound & outbound webhooks
Last updated on