# Accounting API Read and write your Accounting Genius companies, vendors, AP invoices, ledger and more from your own software. Category: Accounting Genius / ERP Canonical URL: https://otto.briq.ai/docs/accounting-api/ ## On this page - [What you can do today](https://otto.briq.ai/docs/accounting-api/today.md) - [Get started](https://otto.briq.ai/docs/accounting-api/get-started.md) - [Concepts](https://otto.briq.ai/docs/accounting-api/concepts.md) - [The interactive reference](https://otto.briq.ai/docs/accounting-api/reference.md) - [What is not available yet](https://otto.briq.ai/docs/accounting-api/not-yet.md) - [Versioning and changes](https://otto.briq.ai/docs/accounting-api/versions.md) ## 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. | Area | What you can do | Operations | | --- | --- | --- | | Company | List companies | listCompanies | | Ledger | List GL accounts, list departments, read trial balance, list journal entries, read journal entry, list fiscal periods | listGlAccounts, listDepartments, getTrialBalance, listJournalEntries, getJournalEntry, listFiscalPeriods | | Bank | List bank accounts, read bank reconciliation status, list bank statements, read bank statement, list bank statement lines, list bank statement matches | listBankAccounts, getBankReconciliationStatus, listBankStatements, getBankStatement, listBankStatementLines, listBankStatementMatches | | Equipment | List equipment | listEquipment | | Customers | List customers, read customer | listCustomers, getCustomer | | Accounts receivable | List AR invoices, read AR invoice, list AR invoice receipts, list AR receipts, read AR receipt | listArInvoices, getArInvoice, listArInvoiceReceipts, listArReceipts, getArReceipt | | Purchase orders | List purchase orders, read purchase order, list purchase order receipts | listPurchaseOrders, getPurchaseOrder, listPurchaseOrderReceipts | | Vendors | List vendors, create vendor, read vendor, edit vendor | listVendors, createVendor, getVendor, updateVendor | | AP Invoices | List AP invoices, create AP invoice, read AP invoice, edit AP invoice, list AP invoice payments | listApInvoices, createApInvoice, getApInvoice, updateApInvoice, listApInvoicePayments | | Jobs | List jobs, read job, read job cost to date | listJobs, getJob, getJobCostToDate | | Attachments | List attachments, upload attachment, download attachment | listAttachments, uploadAttachment, downloadAttachment | ## 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. 1. Make a first call to the example server. It returns made-up data, saves nothing and needs no sign-in. 2. List your companies and choose one. A token can cover several legal companies, each with its own books. 3. Send the chosen company's id in the X-Company-Id header on every other call. 4. 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. First call with curl, against the example server: ```bash curl "https://api.otto.briq.ai/functions/v1/accounting-api-example/v1/companies" ``` Pick a company and list vendors with TypeScript, against the example server: ```ts 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); ``` The same first call for your own company: ```bash 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. ## Next steps - [Accounting Genius / ERP](https://otto.briq.ai/docs/accounting-genius/)