Accounting API
Read and write your Accounting Genius companies, vendors, AP invoices, ledger and more from your own software.
On this page
What you can do today
The Accounting API lets your own software read and write Accounting Genius records over HTTPS with JSON. 39 of its 54 operations are available today; each one also carries an Available or Coming soon badge in the reference below.
Get started
Your company's data always needs an API token. A company admin creates one in Otto under Settings, API tokens. Send it as a bearer token in the Authorization header. Tokens expire and can be revoked. The example server needs no credentials.
- Make a first call to the example server. It returns made-up data, saves nothing and needs no sign-in.
- List your companies and choose one. A token can cover several legal companies, each with its own books.
- Send the chosen company's id in the X-Company-Id header on every other call.
- When you are ready for your own data, send the same calls to https://api.otto.briq.ai/functions/v1/accounting-api/v1 with your credential.
curl "https://api.otto.briq.ai/functions/v1/accounting-api-example/v1/companies"const base = "https://api.otto.briq.ai/functions/v1/accounting-api-example/v1";
// 1. List the companies you can use and pick one.
const companies = await (await fetch(`${base}/companies`)).json();
const companyId = companies.data[0].id;
// 2. Send that company on every other call.
const response = await fetch(`${base}/vendors?limit=5`, { headers: { "X-Company-Id": companyId } });
const vendors = await response.json();
console.log(response.status, vendors.data.length);curl "https://api.otto.briq.ai/functions/v1/accounting-api/v1/companies" --header "Authorization: Bearer $OTTO_SESSION_TOKEN"Concepts
Companies
Most calls act inside one legal company. List your companies first, then send the one you chose in X-Company-Id. A record that belongs to another company is answered as not found.
Money
Amounts are exact decimal strings such as "1250.00", with at most two decimal places and never an exponent. Send and compare them as text, not as floating-point numbers.
Dates
Dates are YYYY-MM-DD. Timestamps carry a time zone offset. A value that can be empty is null, never an empty string.
Paging
Lists return a page of records and a next_cursor. Pass it back as cursor to get the next page; limit is 50 by default and 200 at most. A cursor works only with the same operation, company, filters and sort it came from.
Creating safely
Every create needs an Idempotency-Key header of 8 to 80 letters, digits, dots, underscores or hyphens. Repeating a request with the same key returns the first result instead of creating a second record.
Editing safely
Every edit needs an If-Match header holding the record's current updated_at. If someone changed the record after you read it, the edit is refused with a conflict and their change is kept.
Errors
A refused request returns an error with a stable code, a message, a request_id and whether a retry can help. Quote the request_id when you ask Otto support about a call. You may send your own in X-Request-Id.
The interactive reference
The reference below lists every operation by area, with its parameters, request and response fields and an example. Try it out sends a real request: to Otto's example server by default, or to your own company when you choose it and authorize. You can also download the OpenAPI file at /docs/accounting/api/openapi.json.
What is not available yet
Coming soon
These are described in the reference so you can plan for them, but they do not answer for your company yet.
- Ledger: create GL journal, commit GL journal.
- Job Cost: create JC transaction, commit JC transaction.
- Bank: download bank statement file, send in bank statement, import bank statement, read bank intake.
- Events: create event subscription, read operation job.
- Attachments: create attachment, remove attachment.
- Documents: send in document, list document submissions, read document submission.
Not planned
- Posting, voiding, paying or approving AP bills and AR invoices.
- Closing or reopening fiscal periods.
- Payroll detail, such as pay rates and employee records.
- Full bank account and routing numbers, tax IDs and stored credentials.
Versioning and changes
The current version is 1.1.0. Compatible changes, such as a new operation or a new optional field, are added to version 1 and appear on this page when they ship. A change that could break existing calls is released as a new major version with migration notes. No operation is deprecated in this version.