API Reference

Getting started with the API

Base URL, authentication, and error handling for the Rebill REST API. Covers API key usage, monetary amounts in cents, date formats, and HTTP status codes explained.

The Rebill API lets you create and manage invoices, clients, quotes, items, and recurring invoices programmatically. It follows standard REST conventions: JSON in, JSON out, and predictable HTTP status codes.

Base URL

All API requests are made to:

https://rebill-api-896466068278.africa-south1.run.app

Every request that includes a body must send a Content-Type: application/json header.

Authentication

Authenticate by passing your secret API key in the Authorization header of every request. You can find and manage your API key in Settings → API inside the Rebill app.

curl https://rebill-api-896466068278.africa-south1.run.app/invoice \
  -H "Authorization: Bearer sk_your_secret_key"

Keep your key secret. Anyone who has it has full read and write access to your account. If it is ever compromised, regenerate it immediately from Settings. The old key stops working straight away.

Never expose your secret key

Do not include your API key in client-side code, public repositories, or anywhere it could be seen by others. Treat it like a password.

Amounts and currencies

All monetary amounts in the API are integers representing the smallest currency unit:

  • ZAR, USD, NGN, etc.: amounts are in cents (100 = R1.00 / $1.00 / ₦1.00)
  • VAT rates: expressed in basis points (1500 = 15%)
  • Deposit values: fixed deposits are in cents; percentage deposits are in basis points

Currency codes follow ISO 4217 (e.g. ZAR, USD, NGN). If omitted when creating a document, your account's default currency is used.

Dates

Timestamps in responses use ISO 8601 UTC format. When sending dates in request bodies you can use a full timestamp or just a date string:

"invoice_date": "2026-03-15T00:00:00Z"
// or
"invoice_date": "2026-03-15"

Error responses

The API uses standard HTTP status codes. Error responses include a message field.

StatusMeaning
200OK: request succeeded
201Created: resource was created successfully
400Bad Request: validation failed; check the message field
401Unauthorized: missing or invalid API key
402Payment Required: plan limit reached
404Not Found: resource does not exist
422Unprocessable: valid request but not allowed in the current state
500Internal Server Error: something went wrong on our end

Example error response:

{
  "message": "client_id: Client not found"
}

Was this article helpful?