canonical: https://jentic.com/apis/codat.io/accounting

# Codat Accounting API

Codat's Accounting API provides a unified interface for reading and writing accounting data across 20+ accounting platforms including QuickBooks, Xero, Sage, NetSuite, and FreeAgent. It standardises invoices, bills, journal entries, customers, suppliers, payments, and financial reports so a single integration maps to all supported systems. The API supports both pull operations (read normalised data from a linked company) and push operations (create or update records back into the source ledger). It is designed for fintech applications, lending platforms, and B2B SaaS products that need accounting data from their customers' books.

## For AI agents

Read and write standardised accounting data - invoices, bills, journal entries, customers, suppliers, and payments - across 20+ accounting platforms through a single unified interface.

## Scope

Does not handle direct bank feed connectivity, payment processing, or commerce platform sales - use for unified accounting ledger read and write across QuickBooks, Xero, Sage, and similar platforms only.

## Capabilities

- Pull standardised invoices, bills, and journal entries from QuickBooks, Xero, Sage, and 17 other accounting platforms
- Push new invoices, bill payments, and credit notes back into a customer's linked accounting software
- Retrieve customers, suppliers, and chart of accounts data normalised to the Codat schema
- Generate financial reports including profit and loss, balance sheet, cash flow, and aged debtors
- Reconcile bank accounts and bank transactions imported from linked accounting platforms
- Manage tax rates, tracking categories, and payment methods used during pushed transactions
- Attach files and supporting documents to bills, bill credit notes, and direct costs

## Use cases

### Underwriting and Lending Decisions

Lenders use the Codat Accounting API to pull a borrower's invoices, bills, and financial statements directly from their accounting software during underwriting. This replaces document upload and manual review with structured data fetched from QuickBooks, Xero, or Sage in seconds. The /companies/{companyId}/data/financials/profitAndLoss and /data/invoices endpoints surface the cash flow and receivables data that credit models need, accelerating decisioning from days to minutes.

Example prompt: Fetch the last 12 months of profit and loss data for company {companyId} and list any invoices over 90 days past due.

### Automated Bill Pay and Spend Management

Spend management platforms write reconciled expenses back into the customer's accounting ledger using the push endpoints. After capturing a card transaction or vendor bill, the platform calls /companies/{companyId}/connections/{connectionId}/push/bills or /push/billPayments to record the expense in QuickBooks or Xero with the correct GL account, tax rate, and tracking category. This eliminates duplicate data entry for finance teams.

Example prompt: Push a new bill for supplier ID {supplierId} totalling $1,250 with tax rate 'GST' against account 'Office Expenses' for company {companyId}.

### B2B SaaS Embedded Reporting

Vertical SaaS products embed real-time financial dashboards using Codat's reports endpoints. The /data/reports/profitAndLoss, /reports/balanceSheet, and /reports/cashFlowStatement operations return normalised report data that can drive in-app charts and KPIs without the SaaS team writing per-platform connectors. Integration moves from months of work per accounting system to a single API surface.

Example prompt: Retrieve the balance sheet report for company {companyId} for the period 2026-01-01 to 2026-06-30 and extract total assets and total liabilities.

### AI Agent Bookkeeping Assistant

AI agents acting as bookkeeping assistants use the Codat Accounting API through Jentic to answer client questions and perform routine reconciliations. The agent searches Jentic for 'fetch unpaid invoices', loads the operation schema, and executes against the customer's linked QuickBooks or Xero. Jentic handles credential isolation so the API key never enters the agent's context, and the unified schema means the same agent code works across every accounting platform a client uses.

Example prompt: Search Jentic for 'list unpaid invoices in Codat', load the operation, then list all invoices with status 'Submitted' older than 60 days for company {companyId}.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| GET | /companies/{companyId}/data/invoices | List standardised invoices from a linked accounting platform |
| POST | /companies/{companyId}/connections/{connectionId}/push/invoices | Create an invoice in the linked accounting software |
| GET | /companies/{companyId}/data/bills | List standardised bills |
| POST | /companies/{companyId}/connections/{connectionId}/push/billPayments | Push a bill payment into the linked accounting software |
| GET | /companies/{companyId}/data/accounts | Retrieve the chart of accounts |
| GET | /companies/{companyId}/data/journalEntries | List general ledger journal entries |
| GET | /companies/{companyId}/data/customers | List customers linked to invoices and payments |

## Key resources

- **Invoices** — Read and push invoices, including line items, tax breakdown, and payment allocations across linked accounting platforms
- **Bills** — Read and push supplier bills and bill credit notes with attachments and payment status
- **Journal entries** — Read and push double-entry journal lines for general ledger reconciliation
- **Customers and Suppliers** — Access standardised customer and supplier records linked to invoices and bills
- **Reports** — Profit and loss, balance sheet, cash flow statement, and aged debtors and creditors
- **Bank accounts and transactions** — Read bank account balances and transaction history from the linked accounting ledger
- **Chart of accounts** — Standardised list of accounts with type, status, and currency for use in pushed transactions

## Why Jentic

- **Setup:** Wiring the Codat Accounting API by hand means encoding its API key into a Basic Authorization header, targeting api.codat.io, and handling paging and retries across a unified ledger spanning QuickBooks, Xero, and Sage yourself. Through Jentic you install once, import the Accounting API from the API Directory, store the key once, and your agent calls it.
- **Permission scoping:** Codat puts the company id in the URL path (/companies/{companyId}/...), so a rule can pin your agent to one company for reads like invoices, bills, and accounts. You choose the operations it may call, so write operations like pushing an invoice or a bill payment are not included unless you add them.
- **Credential handling:** Your Codat key is stored once, encrypted, by your own Jentic One instance and constructed into the Basic Authorization header at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'fetch unpaid invoices from accounting software', and Jentic returns the matching Codat operation with its input schema so the agent calls the right endpoint without browsing the full path list.

## Related APIs

- **Codat Sync for Expenses** — Codat product purpose-built for pushing expense transactions into accounting platforms
- **Codat Banking API** — Codat Banking API surfaces bank transaction data from direct bank connections rather than the accounting ledger
- **Codat Assess API** — Codat Assess builds on accounting and banking data to provide lending and risk metrics

## FAQ

### What authentication does the Codat Accounting API use?

The API uses an API key passed in the Authorization header as 'Basic <base64-encoded-key>'. The single security scheme is named auth_header in the spec. Through Jentic, the Codat API key is stored encrypted in the vault and never exposed to the agent runtime - agents receive a scoped execution token instead.

### Can I push invoices into QuickBooks or Xero with the Codat Accounting API?

Yes. Use POST /companies/{companyId}/connections/{connectionId}/push/invoices to create an invoice in the linked accounting platform. The same endpoint pattern works across QuickBooks, Xero, Sage, NetSuite, and the other supported systems because Codat normalises the request schema.

### What are the rate limits for the Codat Accounting API?

Codat does not publish a fixed rate limit in the OpenAPI spec; limits are governed at the company and connection level and depend on the underlying accounting platform's own limits. Codat returns HTTP 429 with a Retry-After header when a limit is hit, and recommends exponential backoff on retries.

### How do I fetch a profit and loss report through Jentic?

Search Jentic for 'profit and loss codat', load the GET /companies/{companyId}/data/reports/profitAndLoss operation, and execute it with the company ID and period range. Install with pip install jentic and run the standard async search, load, and execute flow.

### Which accounting platforms does the Codat Accounting API support?

The API normalises data from 20+ accounting platforms including QuickBooks Online, QuickBooks Desktop, Xero, Sage Business Cloud, Sage Intacct, NetSuite, FreeAgent, FreshBooks, MYOB, KashFlow, and Zoho Books. The same endpoints and schemas work for every supported platform.

### Can I read bank transactions through the Codat Accounting API?

Yes, but only the bank accounts and transactions that exist in the linked accounting ledger. Use GET /companies/{companyId}/data/bankAccounts and the related bank account transactions endpoints. For direct bank feeds use the separate Codat Bank Feeds or Banking APIs.

### Can I limit what my agent is allowed to do with the Codat Accounting API?

Yes. Because you run Jentic One yourself, your own rules decide which Codat operations and credentials the agent may use. Codat puts the company id in the URL path, so a rule can pin the agent to one company and to read-only calls like GET /data/invoices, /data/bills, and /data/accounts. Write operations such as POST push/invoices or push/billPayments stay off limits unless you explicitly add them, and your Codat key is only assembled into the request at execution time so it never reaches the agent's context.
