Octobill API & Webhooks

The Octobill API lets your own tools record metered usage and seat counts against a subscription, read back aggregated usage for a billing period, and receive signed webhook events.

Quickstart

Create an API key in Settings, record a metered usage event or seat count against a subscription, read back aggregated usage for a billing period, and receive signed webhook events.

Authentication

Authenticate every request with an API key sent as an Authorization: Bearer ob_live_… header. Keys are scoped to a single merchant account.

Base URL & versioning

The API is served under https://www.octobill.it/api/v1. The version is pinned in the path.

Errors

Errors return a JSON body with an error message and a stable code. Documented codes include API_KEY_MISSING, API_KEY_INVALID, VALIDATION_FAILED, USE_SEATS_ENDPOINT, INVALID_WINDOW, NO_BILLING_PERIOD, ACCOUNT_SUSPENDED, ACCOUNT_DELETED, ACCOUNT_PAUSED, SUBSCRIPTION_NOT_FOUND, IDEMPOTENCY_KEY_REUSED, RATE_LIMITED.

Rate limits

Requests are rate limited per API key. When the limit is exceeded the API returns 429 with a Retry-After header.

Idempotency

Send an idempotencyKey with write requests so retries are safe. Reusing a key with a different payload returns a 409 conflict.

Endpoints

Record usage (POST /subscriptions/:id/usage), set seat counts (POST /subscriptions/:id/seats), read aggregated usage for a billing period (GET /subscriptions/:id/usage), and identify the merchant for a key (GET /me).

Webhooks

Subscribe to signed webhook events delivered with an HMAC-SHA256 signature. Event types include usage.recorded, seats.updated, subscription.created, subscription.renewed, subscription.canceled, subscription.paused, invoice.paid, invoice.payment_failed.

Support

Questions? Email support@octobill.it.