Accountflow Developer prod

Quickstart

Your first authenticated call in a few minutes.

Create an API client, exchange its credentials for a token, read your organization's data.

1. Create an API client

An organization administrator creates clients in Accountflow (https://ajour.accountflow.com) under organization settings → integrations → API clients.

Choice Meaning
Name, description For your own records.
Environment Production reads your organization's live data. Sandbox clients work only against the sandbox environment (coming soon).
Scopes Grant the minimum. Write and management scopes are opt-in. settings:write changes any company's settings in the organization, automatic approval included.

The dialog shows client_id and client_secret once. Store them in a secret manager. A lost secret needs a rotation; the old secret stops working at once.

2. Get a token

OAuth 2.0 client credentials. Don't send scope: the client's scopes are the ones granted to it. Cache the token until it expires; don't fetch one per request.

TOKEN=$(curl -s -X POST \
  "https://auth.prod.accountflow.com/realms/accountflow/protocol/openid-connect/token" \
  -d grant_type=client_credentials \
  -d client_id="$CLIENT_ID" \
  -d client_secret="$CLIENT_SECRET" | jq -r .access_token)

3. Check who you are

curl -s https://api.prod.accountflow.com/v1/whoami -H "Authorization: Bearer $TOKEN" | jq
{
  "clientId": "com.accountflow.api.prod.4be9a1c803f2",
  "mode": "SYSTEM",
  "organizationId": "d290f1ee-6c54-4b01-90e6-d701748f0851"
}

The token fixes your organization. It is never a request parameter.

4. List companies and read a ledger

curl -s https://api.prod.accountflow.com/v1/companies -H "Authorization: Bearer $TOKEN" \
  | jq '.data[] | {id, name}'

COMPANY=$(curl -s https://api.prod.accountflow.com/v1/companies \
  -H "Authorization: Bearer $TOKEN" | jq -r '.data[0].id')

curl -s "https://api.prod.accountflow.com/v1/companies/$COMPANY/general-ledger/lines?pageSize=50" \
  -H "Authorization: Bearer $TOKEN" \
  | jq '{lines: (.data | length), next: .pagination.nextCursor, more: .pagination.hasMore}'

Send pagination.nextCursor back as cursor while pagination.hasMore is true (pageSize 1–200). Next, try GET /v1/companies/{companyId}/trial-balance.

Before you build

Rule See
Every mutation needs an Idempotency-Key header; retries with the same key are safe. Conventions
Errors are RFC 9457 problem documents with a stable error code. Errors
On 429, wait Retry-After seconds. Conventions
Every response has X-Request-Id. Log it and quote it to support. Conventions
Outside your reach is 404, never 403. Conventions

The API reference has every endpoint, parameter and schema.