Accountflow Developer prod

Conventions

Ids, paths, pagination, idempotency, rate limits and versioning.

These rules hold on every /v1 operation unless its reference says otherwise.

Ids

UUIDs name companies, organizations, portfolios, bank accounts and transactions, reconciliation groups, documents, jobs, imports, policies, webhook endpoints, tasks, and accounts (accountId, one per accounting year). They are stable for the resource's life.

Text ids are opaque strings. Never parse or build them.

Id Stable
lineId (general-ledger lines), openingBalanceId, parentOpeningBalanceId Across re-imports. A pushed line's lineId is not derived from your sourceLineId.
subjectKey on comments and flags Typed: type says which of accountId, lineId, openingBalanceId, openItemId, … it carries.
id on work-queue items and blockers While the item exists.
id on deadlines (vat-2026-T3, amelding-2026-05) For that deadline.
periodKey, target.key on tasks See tasks.
runId on approvals; keys you or the ERP chose: account numbers, dimension key, partyKey, voucherKey, erpDocumentId, suggestionKey As chosen.

Names and values

What Rule Example
JSON fields, query and path parameters camelCase pageSize, {companyId}
Enum values UPPER_SNAKE_CASE (exceptions) RECONCILED, AWAITING_CONTROL
error codes, reason values snake_case job_in_flight
Scopes resource:action ledger:read
Headers Http-Case Idempotency-Key
Amounts you read JSON numbers with decimals, signed where the domain is. Parse as decimal, never float. -6000.00
Amounts you send (imports) Decimal strings, at most four decimals. Numbers are accepted. "-1250.00"
Dates, timestamps ISO 8601; timestamps are UTC instants 2026-03-01
Media type application/json; errors application/problem+json (catalog)

One name per concept everywhere: the accounting year is year (yearFrom/yearTo, years), an account is accountNumber or accountId, a date range is dateFrom/dateTo, free text is query, a month of the year is period (beside periodType). A query parameter under a retired name is refused (400, reason: parameter_renamed), never ignored.

Enums

Reach

Your token defines your reach: the client's organization and the organizations below it. Anything outside it is 404, never 403, whether or not it exists.

Paths

Prefix Holds
/v1/organizations/{organizationId}/… What an organization administers: users, access policies, webhook endpoints, audit log, creating a company.
/v1/companies/{companyId}/… A company's data and settings. A child is read by its own id under its company; another company in the path is 404.
/v1/portfolios/{portfolioId}/… Reads across a portfolio's companies.
Top level Globally unique ids: /v1/documents/{documentId}, /v1/jobs/{jobId}, /v1/jobs, /v1/companies, /v1/whoami. Reach is checked inside.

Deletes

DELETE takes no body. The company delete takes an optional audit note as ?reason=.

You delete Answer Again
A company or a document { "id", "status": "DELETED", "deletedAt" } The same body, first deletedAt
A reconciliation group or a webhook endpoint { "id", "status": "DELETED", "deletedAt" } 404
Part of a resource: an account's mapping or routine, an intercompany line or linked account The resource as it is now
A document connection (DELETE /documents/{documentId}/associations/{connectionId}) The connection, kept as history with detachedAt The first removal
Imported data: accounts, dimensions, sub-ledger entries, opening balances, ledger lines 202 with the import to poll
An access assignment The revocation, status: REVOKED

An omitted year

year is the accounting year. Each operation's reference says what leaving it out means:

Without year Operations
The current accounting year: the one the ledger marks current, not the calendar's Most company reads; account settings, routines, mapping and correction routes. Send year on writes and deletes (DELETE …/accounts/{accountNumber}, mapping and settings writes).
Every year GET …/vouchers, a bank account's reconciliation groups, VAT terms, approvals
The year accountNumber resolves in (the current one) Account activity, flags, settlements
Required (400 without it) Portfolio reads, the bank reconciliation summary, a bank account's opening balance and GL lines, the bank GL account summary

A portfolio's period

period counts from each company's fiscal-year start: period 5 of 2026 is May 2026 for a January start and November 2026 for a July start. To read one calendar month across a portfolio, add yearMonth=YYYY-MM to the three portfolio reads. Each company is then read at its own year and period, named on each close-status row (year, period). year and period stay required; yearMonth wins. A company whose fiscal years don't reach the month is left out. A malformed yearMonth is 400.

From a task to its account

A task (GET /companies/{companyId}/tasks, or GET /organizations/{organizationId}/tasks across an organization's own companies) is one rule's finding on one target for one period.

The task says Read it with
target.type ACCOUNT: accountNumber, year GET /companies/{companyId}/accounts/{accountNumber}/reconciliation?year=…&period=…
target.type INTERCOMPANY: definitionId GET /companies/{companyId}/intercompany/definitions/{definitionId}
target.type COMPANY The company's own reads (target.key is its id)
id GET /companies/{companyId}/tasks/{taskId}: its episodes and latest 50 changes

Bank and ledger signs

Both sides book a movement with the same sign: a payment of 6 000 is -6000 in the bank and -6000 on the ledger, never +6000. A reconciliation group balances when glAmountTotal - bankAmountTotal = 0. Creating a group does not check the balance, so check it yourself.

Settings writes

Settings writes (settings:write) are patches: an omitted field stays, and null is the same as omitting it. To clear a value or return it to its default, name it in reset where the operation has one ("reset": ["accountTemplateId"]).

Each settings read returns a token; each write sends it back. A changed token is 409 conflict naming the current one. Read again and re-apply your change; don't just retry with the new token.

Token Read from Send as The 409 carries
A version string version on company settings, contacts, the account-template choice, an intercompany link and the groups, a routine source; companyRoutineVersion on routines expectedVersion (body; query on actions and deletes). Optional. currentVersion
An account revision settingsRevision on account settings and mappings settingsRevision (body; query on DELETE …/mapping). Required. currentRevision on account settings; nothing on the others

Access policies, webhooks and companies take no token.

Pagination

{ "data": [ ... ], "pagination": { "nextCursor": "…", "hasMore": true } }

Idempotency

Every POST, PATCH and DELETE needs an Idempotency-Key header: a unique string, such as a UUID per logical action.

Retry Result
Same key, same body, within 24 hours The stored response, byte-identical, with Idempotency-Replayed: true
Same key, different body 422 idempotency_key_reused
Same key while the first request runs 409 idempotency_in_flight, with Retry-After
Same key after 24 hours Executes again as a new request

Keys are scoped per API client and per operation. A replayed document upload returns the signed URL as stored, which may have expired: start a new upload with a new key.

When you PUT a file to upload.url, send every header in upload.headers exactly: Content-Type, x-goog-content-length-range (at most the declared sizeBytes) and x-goog-if-generation-match: 0 (the URL creates the file once). They are signed; storage refuses the PUT without them.

400 or 422?

400 and 422 share the errors[] item: {field, message, index?, allowedValues?}.

Async work

Heavy operations answer 202 Accepted with the resource to poll. For imports and corrections that is the import, GET /v1/companies/{companyId}/imports/{importId}. Its jobId is also readable at GET /v1/jobs/{jobId}; GET /v1/jobs lists the jobs your client submitted, newest first (status filter). Poll to a terminal status, or subscribe to job.succeeded and job.failed webhooks. One job per type and scope runs at a time; another is 409 with jobId naming the blocking job.

Reconciliation runs

POST /v1/companies/{companyId}/reconciliation-runs (reconciliation:run) orders runs now for 1 to 50 accounts of one year:

{ "year": 2026, "accounts": [ { "accountId": "…" }, { "accountNumber": "1920" } ] }

Rate limits

Plan Requests/min Burst
standard 300 60
premium 1200 240

429 carries Retry-After. The quota is counted per API replica without a shared counter: with several replicas you may get more, and RateLimit-Remaining describes the replica that answered. Treat the figures as a guaranteed minimum. For bulk reads, prefer a larger pageSize.

Versioning

/v1 is additive-only. New fields, endpoints, enum values and event types may appear at any time: ignore what you don't know. Anything scheduled for removal is announced in the changelog, marked with Deprecation and Sunset headers, and keeps working at least 12 months after the announcement (deprecation policy).

Response headers

Header On Meaning
X-Request-Id Every response Correlation id. Send your own to have it echoed. Problem documents repeat it as requestId. Quote it to support.
RateLimit-Limit, RateLimit-Remaining Every response The plan quota per minute, and what is left of it on the answering replica.
Retry-After 429, 503, 409 idempotency_in_flight Seconds to wait.
Idempotency-Replayed Replayed mutations true: the body is a stored response.
Location 201 of a create with its own read route The path to GET it, e.g. /v1/companies/{companyId}/reconciliations/{reconciliationGroupId}. Sent for reconciliation groups, companies, intercompany links, access policies, webhook endpoints.
Deprecation, Sunset Deprecated operations @<epoch-seconds> the deprecation took effect; the HTTP-date it stops working.
WWW-Authenticate 401, 403 insufficient_scope RFC 6750 challenge; names the missing scope.