Developers · API version 1
The OmniBooks API
Connect your own systems to OmniBooks: an online shop that sends its orders as invoices, a CRM that keeps customers in step, a warehouse system that reads stock, a script that records bank receipts. The API is in every plan.
It is a JSON API over HTTPS. Every write goes through the same rules as the screens: the permissions of the member the key acts as, branch access, approval policies, closed periods, e-invoicing and the audit log. A key can never do more than a person could.
Quick start
- In OmniBooks, open Settings → API keys and choose New key. Name it after the system that will use it and tick the scopes it needs. You need the right to edit settings.
- Copy the key straight away: it is shown once. It looks like
ob_live_o1a2b3…_X9k…. - The same screen shows your API address. It is your workspace's address followed by
/api/v1. - Check the key:
export OMNIBOOKS_KEY="ob_live_…"
curl https://your-workspace.omnibooks.online/api/v1/me -H "Authorization: Bearer $OMNIBOOKS_KEY"Then sell something: create the customer, raise an invoice, post it and record the payment.
curl -X POST https://your-workspace.omnibooks.online/api/v1/contacts \
-H "Authorization: Bearer $OMNIBOOKS_KEY" -H "Content-Type: application/json" \
-d '{"name":"Gulf Star Trading LLC","isCustomer":true,"isSupplier":false,"paymentTermsDays":30,"countryCode":"OM"}'curl "https://your-workspace.omnibooks.online/api/v1/accounts?type=REVENUE&postable=true" -H "Authorization: Bearer $OMNIBOOKS_KEY"
curl https://your-workspace.omnibooks.online/api/v1/tax-codes -H "Authorization: Bearer $OMNIBOOKS_KEY"curl -X POST https://your-workspace.omnibooks.online/api/v1/invoices \
-H "Authorization: Bearer $OMNIBOOKS_KEY" -H "Content-Type: application/json" \
-H "Idempotency-Key: order-10045" \
-d '{"kind":"INVOICE","contactId":"<contact id>","issueDate":"2026-11-30","dueDate":"2026-12-30",
"reference":"Web order 10045",
"lines":[{"description":"Consulting, November","quantity":"10","unitPrice":"35.000",
"accountId":"<revenue account id>","taxCodeId":"<tax code id>"}]}'curl -X POST https://your-workspace.omnibooks.online/api/v1/invoices/<invoice id>/post -H "Authorization: Bearer $OMNIBOOKS_KEY"curl https://your-workspace.omnibooks.online/api/v1/bank-accounts -H "Authorization: Bearer $OMNIBOOKS_KEY"
curl -X POST https://your-workspace.omnibooks.online/api/v1/receipts \
-H "Authorization: Bearer $OMNIBOOKS_KEY" -H "Content-Type: application/json" \
-H "Idempotency-Key: payment-77810" \
-d '{"contactId":"<contact id>","paymentDate":"2026-12-05","bankAccountId":"<bank accountId>",
"amount":"367.500","allocations":[{"documentId":"<invoice id>","amount":"367.500"}]}'Authentication
Send the key in the Authorization header of every request, as a bearer token. Never put it in a web page or an app that people install: anyone with the key can act as you, within its scopes.
Authorization: Bearer ob_live_<workspace>_<secret>- A key acts as the member who made it, in the company that was active when it was made. Its rights are that member's permissions narrowed to the key's scopes. A member limited to some branches sees and writes only those branches through the key too.
- If the member leaves or is suspended, the key stops working (
KEY_INACTIVE). Make keys as a member who will stay, or replace them when people change. - The key names its workspace, so it works on your workspace's address. Live demos can't be used through the API.
- OmniBooks keeps only a fingerprint of the key. A lost key can't be shown again: revoke it in Settings → API keys and make another. Revoking takes effect at once.
- Live and Test keys both work on the same workspace; the label only tells them apart. There is no separate sandbox yet: try things in a test company or a trial workspace.
- Every write is in the audit log as the member, with the change it made.
Scopes
Tick only what a system needs. A request outside the key's scopes is refused with SCOPE_MISSING. A request inside them that the member may not do is refused with FORBIDDEN.
| Scope | Allows |
|---|---|
| contacts:read | Read contacts |
| contacts:write | Create and change contacts |
| items:read | Read items and stock |
| items:write | Create and change items |
| sales:read | Read invoices, credit notes, quotations and orders |
| sales:write | Create, post and void sales documents; quotations and orders |
| purchases:read | Read bills and supplier notes |
| purchases:write | Create, post and void bills |
| payments:read | Read receipts and supplier payments |
| payments:write | Record and void receipts and supplier payments |
| settings:read | Read branches, accounts, tax codes, bank accounts and custom fields |
| crm:read | Read leads and deals; receive CRM events |
| crm:write | Create leads |
| pos:read | Receive till sale events |
| webhooks:manage | Subscribe and unsubscribe webhooks (Zapier, Make, n8n) |
Requests and answers
- Send and receive JSON (
Content-Type: application/json). Field names are camelCase. - Money and quantities are decimal strings, such as
"105.000", so they are never rounded by floating point. Send them as strings too. Amounts are in the document's currency; fields ending inBaseare in the company's base currency. - Dates are calendar dates,
YYYY-MM-DD. Times (createdAt, updatedAt) are ISO 8601 in UTC. - Ids are opaque strings. Store them as they are.
- Fields with no value are
null. On create, fields you leave out take their defaults. - Send prices and quantities, not totals: OmniBooks works out every line, tax and total, with the same rounding as the screens.
- Answers:
200OK,201created,204deleted. Each answer has anX-Request-Idheader; quote it if you contact support.
Custom fields
Contacts, items, invoices and bills, quotations and sales orders carry the company's custom fields in customFields, by key. GET /custom-fields lists the keys, types and choices.
"customFields": { "delivery_slot": "Morning", "site": "Ruwi", "fragile": true, "tags": ["B2B", "Export"] }- Only the keys you send change. An empty value (
"",falseor[]) clears a field. Unknown keys are refused. - Values are checked as on the screen: a pick list takes one of its choices (any letter case), dates are YYYY-MM-DD, whole numbers are numbers and decimals are strings. Problems come back in
error.fieldsascustomFields.<key>. - Required fields must be sent on create. Fields marked "fixed once posted" can't change after a document is posted.
Lists and paging
Lists come newest first, a page at a time. limit is 1–100 (default 25). When there are more, nextCursor is set: pass it as cursor for the next page. To sync changes, ask for updatedSince the time of your last sync.
GET /api/v1/invoices?status=POSTED&limit=100&updatedSince=2026-11-01T00:00:00Z
{ "data": [ { "id": "…", "number": "INV-2026-00042", … } ], "nextCursor": "cmabc123def456" }
GET /api/v1/invoices?status=POSTED&limit=100&updatedSince=2026-11-01T00:00:00Z&cursor=cmabc123def456Safe retries (idempotency)
Networks fail. If you send a write and get no answer, you can't tell whether it happened. Send an Idempotency-Key header with every write: a unique value of your own, such as your order number or a UUID, up to 120 characters.
- The same key with the same request within 24 hours returns the first answer again, with the header
Idempotent-Replayed: true. Nothing is done twice. This includes refusals: a request refused once is refused the same way. - The same key with a different request is refused with
IDEMPOTENCY_MISMATCH. If the first request is still running, you getIDEMPOTENCY_IN_PROGRESS: wait and retry. - Keys belong to your API key; two API keys don't share them.
Rate and monthly limits
A key may make 120 calls a minute, and a workspace 600 across all its keys. Every answer carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset (seconds). Past the limit you get 429 RATE_LIMITED with Retry-After.
Each plan includes a number of API calls a month; the count is on Settings → API keys and in GET /me. When they are used you get 429 MONTHLY_LIMIT until the next month, or choose a larger plan. See pricing.
Errors
Errors have one shape. code is stable: test for it, not for the message.
HTTP/1.1 422 Unprocessable Content
{
"error": {
"code": "VALIDATION_FAILED",
"message": "Enter the contact name.",
"fields": { "name": "Enter the contact name.", "customFields.delivery_slot": "\"Night\" is not one of the choices." }
}
}| Status | Codes | When |
|---|---|---|
| 400 | INVALID_JSON / INVALID_BODY | The body is not a JSON object. |
| 401 | MISSING_KEY, INVALID_KEY, KEY_REVOKED, KEY_EXPIRED, KEY_INACTIVE | No key, a wrong key, or a key that no longer works. |
| 403 | SCOPE_MISSING, FORBIDDEN | The key lacks the scope, or the member it acts as lacks the right. |
| 404 | NOT_FOUND | No such record (or the key can't see it). |
| 422 | VALIDATION_FAILED, or the rule's code | A field is wrong, or a rule refuses it (fields names the fields). |
| 429 | RATE_LIMITED, MONTHLY_LIMIT | More than 120 calls a minute, or the plan's monthly calls are used. |
| 500 | INTERNAL | Something failed on our side (quote reference). |
A rule that refuses a request (a closed period, a missing approval, a SKU already used) answers 422 with the rule's own code, such as PERIOD_CLOSED, APPROVAL_REQUIRED or SKU_TAKEN. Each endpoint lists the codes it is known to answer.
Webhooks
Instead of asking the API again and again, let OmniBooks tell you: add an endpoint in Settings → Webhooks, or subscribe through POST /webhooks, and OmniBooks posts a signed JSON message to your address when an invoice or bill is posted or voided, a payment is received or made, a quotation is accepted, an order confirmed, a contact or item saved, a till sale completed, or a lead or deal changes. Messages are signed with HMAC-SHA256 and retried for three days. Read the webhook guide: headers, signature checks in Node, Python and PHP, retries, and every event with a sample message.
OpenAPI and tools
The full description is at /api/v1/openapi.json (OpenAPI 3.0, also served on your workspace's address). Import it into Postman, Insomnia or Bruno, or generate a client library with openapi-generator. It is built from the same definitions the server answers with, so it is always current.
Versions and changes
- The version is in the address (
/api/v1). Within version 1 we only add: new endpoints, new optional fields, new fields in answers, new error codes. Write clients that ignore fields they don't know. - Anything that would break a client comes as version 2, with notice.
- Zapier: the OmniBooks app for Zapier is built on this API and the webhooks; it is not in Zapier's directory until Zapier has reviewed it. Make and n8n can use the webhooks and the API already.
- Not yet in the API: purchase orders, journals, stock movements, reports, HRMS and the point of sale (the CRM has leads and deals; till sales come as webhooks). Neither is OAuth for partner apps: today a customer makes a key and gives it to the partner.
All endpoints
Invoices
- GET
/invoicesList invoices - GET
/invoices/{id}Get a sales invoice, credit note or debit note - POST
/invoicesCreate a draft sales invoice, credit note or debit note - PUT
/invoices/{id}Replace a draft - DELETE
/invoices/{id}Delete a draft - POST
/invoices/{id}/postPost a draft - POST
/invoices/{id}/voidVoid a posted document