Skip to main content
POST
Create an account

Creating an account

Accounts are created by account number. For example, the following payload adds an expense account for electricity:
The account type is inferred from the account number according to the Swiss chart of accounts for SMEs, unless you provide a type explicitly. Account numbers 1000–1999 are assets, 2000–2999 liabilities, 3000–3999 income and 4000–6999 expenses; the ranges 7000–8999 contain both income and expense accounts. The new account becomes part of the current chart of accounts: it is created in the earliest open fiscal year and carried forward into the fiscal years that follow it.

Foreign currency accounts

To create a bank account in a foreign currency, pass its currency. Foreign currency accounts are only allowed in the liquid assets range 1000–1099, and the currency must be enabled in the organisation.

Authorizations

x-api-token
string
header
required

API token for authentication. Obtain from your Infinity account settings.

Body

application/json

Provide the account to create.

number
integer
required

The four-digit account number. Must not be taken yet.

Required range: 1000 <= x <= 9999
Example:

6410

name
string
required

The name of the account.

Required string length: 1 - 100
Example:

"Electricity"

type
enum<string>

The type of the account. If omitted, the type is inferred from the account number according to the Swiss chart of accounts for SMEs (e.g. 1000–1999 are assets, 2000–2999 liabilities, 3000–3999 income, 4000–6999 expenses).

Available options:
assets,
liabilities,
income,
expense
description
string

An optional description of what is booked to this account.

Maximum string length: 500
colour
string

An optional hex colour code used to display the account in the app.

Pattern: ^#[0-9a-fA-F]{6}$
Example:

"#0746c8"

currency
string

The 3-character currency code (ISO 4217) for a foreign currency account. Only allowed for liquid assets accounts 1000–1099, and must be a currency that is enabled in the organisation. Defaults to CHF.

Required string length: 3
Example:

"EUR"

Response

The account was created successfully.

account
Account · object
required

An account of the chart of accounts. Accounts are identified by their account number.