This is the developer reference. To do the same work by hand, see the Guides tab. To understand how plans, subscriptions and invoices fit together, start with How Saasybill works.
Base URL
Every request goes to the API host,api.saasybill.com, under /v1.
Content-Type: application/json on every request with a body.
Your first request
Send your API key as a bearer token. This request returns the organisation the key belongs to, so it doubles as a connectivity check.Response
What you can do
Plans and charges are managed in the app, and customers sync from Xero. Your platform reads them and writes subscriptions.
Not available yet: add-ons, catalogue writes (plans, charges, categories, meters), reading reported usage back, invoice and credit note writes, managing keys or webhook endpoints through the API, OAuth, and SDKs.
How an integration fits together
1
Read your catalogue
List plans and charges once and cache the ids and codes. Plans change rarely.
2
Create subscriptions on signup
Send
POST /v1/subscriptions with an Idempotency-Key. Saasybill creates the subscription and its first invoice, and sends the invoice to Xero.3
Keep units in sync
When seats change on your platform, send the new total with
POST /v1/subscriptions/{id}/units. Saasybill invoices now, defers the charge to renewal, or issues a credit note, depending on the prorate option and the plan type.4
Report usage
For plans that bill by usage, send what each customer used with
POST /v1/usage_events. Saasybill totals it and bills it in arrears when the period ends. See Usage-based billing.5
Listen for changes
Subscribe to webhooks for invoice and subscription events instead of polling.
Explore
Quickstart
Create a key, create a subscription and change its units.
Authentication
API keys and scopes.
Webhooks
Events for customers, subscriptions, invoices and credit notes.
Errors
Error format, codes and handling.
OpenAPI document
The full API is described as an OpenAPI 3.1 document. Import it into Postman or Insomnia, or generate a client from it.The document is public and needs no key.