Zum Inhalt springen
Ressource · Accounting

Chart of accounts

A chart of accounts lists the accounts and the account groups of the workspace accounting.

chart-of-accounts:readchart-of-accounts:write
MethodePfadZusammenfassung
GET…/chart-of-accountsList charts of accounts in the workspace
POST…/chart-of-accountsCreate a chart of accounts
PATCH…/chart-of-accounts/{chartOfAccountId}Update a chart of accounts
DELETE…/chart-of-accounts/{chartOfAccountId}Delete a chart of accounts
POST…/chart-of-accounts/{chartOfAccountId}/accountsCreate an account inside a chart of accounts
PATCH…/chart-of-accounts/{chartOfAccountId}/accounts/{accountId}Update an account inside a chart of accounts
DELETE…/chart-of-accounts/{chartOfAccountId}/accounts/{accountId}Delete an account from a chart of accounts
POST…/chart-of-accounts/{chartOfAccountId}/groupsCreate an account group inside a chart of accounts
PATCH…/chart-of-accounts/{chartOfAccountId}/groups/{groupId}Update an account group inside a chart of accounts
DELETE…/chart-of-accounts/{chartOfAccountId}/groups/{groupId}Delete an account group from a chart of accounts
POST…/chart-of-accounts/exportExport a chart of accounts to a downloadable file

Die Pfade beginnen mit /workspaces/{workspaceId}. GET-Endpunkte brauchen chart-of-accounts:read, die übrigen chart-of-accounts:write.

Das Objekt ChartOfAccount

firestoreIdstringerforderlich

ID of the chart of accounts.

workspaceIdstringerforderlich

ID of the workspace.

validFromstring
validUntilstring
titlestringerforderlich
groupsobject[]erforderlich
4 untergeordnete Felder anzeigen
idstringerforderlich
namestringerforderlich
descriptionstring
parentIdstring
accountsobject[]erforderlich
8 untergeordnete Felder anzeigen
codestringerforderlich
namestringerforderlich
descriptionstring
groupIdstringerforderlich
taxTypeIdstring

ID of the tax type.

bankAccountIdstring

ID of the bank account.

typestring
18 Werte anzeigen

BANKCURRENT_ASSETFIXED_ASSETINVENTORYNON_CURRENT_ASSETPREPAYMENTCURRENT_LIABILITYLIABILITYNON_CURRENT_LIABILITYEQUITYREVENUESALESOTHER_INCOMEDIRECT_COSTOVERHEADEXPENSEDEPRECIATIONSUSPENSE

currencystring

ISO 4217 currency code

Alle 8 Felder anzeigen
creationobjecterforderlich

When and by whom the resource was created.

2 untergeordnete Felder anzeigen
creationDateTimestringdate-timeerforderlich

Date and time when the resource was created.

createdBystring

ID of the user who created the resource, when recorded.

Das Objekt ChartOfAccount
{
  "firestoreId": "Ca6yH3kN8pTr1vWx4bQs",
  "workspaceId": "Wk7fQ2xR9bLm4tZp8sNv",
  "validFrom": "string",
  "validUntil": "string",
  "title": "string",
  "groups": [
    {
      "id": "string",
      "name": "string",
      "description": "string",
      "parentId": "string"
    }
  ],
  "accounts": [
    {
      "code": "string",
      "name": "string",
      "description": "string",
      "groupId": "string",
      "taxTypeId": "Tt9mC5rL2wQz7nVb4kHp",
      "bankAccountId": "bacc_Q0gzMTA4NzY1NDM",
      "type": "BANK",
      "currency": "CHF"
    }
  ],
  "creation": {
    "creationDateTime": "2026-03-02T09:15:00.000Z",
    "createdBy": "Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"
  }
}
GET/workspaces/{workspaceId}/chart-of-accounts

List charts of accounts in the workspace

Bereichchart-of-accounts:read

Pfadparameter

workspaceIdstringerforderlich

ID of the workspace.

Abfrageparameter

limitinteger

Maximum number of items to return, from 1 to 100. A missing, invalid or non-positive value falls back to 20, and a larger value to 100.

Standard20

startAfterstring

Cursor of the page to return: the nextCursor of the previous page.

fieldsstring

Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.

idsstring[]

Comma-separated IDs of the items to return, up to 30. When set, limit, startAfter and the filters are ignored.

Rückgabe

200

List of items

dataChartOfAccount[]erforderlich

Items of the page, in list order.

limitintegererforderlich

Page size of the request, or the number of requested ids.

nextCursorstring

Cursor of the next page, to pass as startAfter. Absent when the page holds fewer items than limit; a full last page still has one, and the page it points to is empty.

curl 'https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/chart-of-accounts' \
  -H "Authorization: Bearer $SWAY_API_KEY"
{
  "data": [
    {
      "firestoreId": "Ca6yH3kN8pTr1vWx4bQs",
      "workspaceId": "Wk7fQ2xR9bLm4tZp8sNv",
      "validFrom": "string",
      "validUntil": "string",
      "title": "string",
      "groups": […],
      "accounts": […],
      "creation": {
        "creationDateTime": "2026-03-02T09:15:00.000Z",
        "createdBy": "Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"
      }
    }
  ],
  "limit": 0,
  "nextCursor": "string"
}
POST/workspaces/{workspaceId}/chart-of-accounts

Create a chart of accounts

Bereichchart-of-accounts:write

Pfadparameter

workspaceIdstringerforderlich

ID of the workspace.

Abfrageparameter

fieldsstring

Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.

Request-Body

titlestringerforderlich
validFromstring
validUntilstring
groupsobject[]erforderlich
4 untergeordnete Felder anzeigen
idstringerforderlich
namestringerforderlich
descriptionstring
parentIdstring
accountsobject[]erforderlich
8 untergeordnete Felder anzeigen
codestringerforderlich
namestringerforderlich
descriptionstring
groupIdstringerforderlich
taxTypeIdstring

ID of the tax type.

bankAccountIdstring

ID of the bank account.

typestring
18 Werte anzeigen

BANKCURRENT_ASSETFIXED_ASSETINVENTORYNON_CURRENT_ASSETPREPAYMENTCURRENT_LIABILITYLIABILITYNON_CURRENT_LIABILITYEQUITYREVENUESALESOTHER_INCOMEDIRECT_COSTOVERHEADEXPENSEDEPRECIATIONSUSPENSE

currencystring

ISO 4217 currency code

importedFromFilestring

Rückgabe

200

Successful response

dataChartOfAccounterforderlich
curl -X POST 'https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/chart-of-accounts' \
  -H "Authorization: Bearer $SWAY_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "title": "string",
  "validFrom": "string",
  "validUntil": "string",
  "groups": [
    {
      "id": "string",
      "name": "string",
      "description": "string",
      "parentId": "string"
    }
  ],
  "accounts": [
    {
      "code": "string",
      "name": "string",
      "description": "string",
      "groupId": "string",
      "taxTypeId": "Tt9mC5rL2wQz7nVb4kHp",
      "bankAccountId": "bacc_Q0gzMTA4NzY1NDM",
      "type": "BANK",
      "currency": "CHF"
    }
  ],
  "importedFromFile": "string"
}'
{
  "data": {
    "firestoreId": "Ca6yH3kN8pTr1vWx4bQs",
    "workspaceId": "Wk7fQ2xR9bLm4tZp8sNv",
    "validFrom": "string",
    "validUntil": "string",
    "title": "string",
    "groups": […],
    "accounts": […],
    "creation": {
      "creationDateTime": "2026-03-02T09:15:00.000Z",
      "createdBy": "Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"
    }
  }
}
PATCH/workspaces/{workspaceId}/chart-of-accounts/{chartOfAccountId}

Update a chart of accounts

Bereichchart-of-accounts:write

Pfadparameter

workspaceIdstringerforderlich

ID of the workspace.

chartOfAccountIdstringerforderlich

ID of the chart of accounts.

Request-Body

titlestring
validFromstring
validUntilstring
groupsobject[]
4 untergeordnete Felder anzeigen
idstringerforderlich
namestringerforderlich
descriptionstring
parentIdstring
accountsobject[]
8 untergeordnete Felder anzeigen
codestringerforderlich
namestringerforderlich
descriptionstring
groupIdstringerforderlich
taxTypeIdstring

ID of the tax type.

bankAccountIdstring

ID of the bank account.

typestring
18 Werte anzeigen

BANKCURRENT_ASSETFIXED_ASSETINVENTORYNON_CURRENT_ASSETPREPAYMENTCURRENT_LIABILITYLIABILITYNON_CURRENT_LIABILITYEQUITYREVENUESALESOTHER_INCOMEDIRECT_COSTOVERHEADEXPENSEDEPRECIATIONSUSPENSE

currencystring

ISO 4217 currency code

Rückgabe

204

No content

curl -X PATCH 'https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/chart-of-accounts/Ca6yH3kN8pTr1vWx4bQs' \
  -H "Authorization: Bearer $SWAY_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "title": "string",
  "validFrom": "string",
  "validUntil": "string",
  "groups": [
    {
      "id": "string",
      "name": "string",
      "description": "string",
      "parentId": "string"
    }
  ],
  "accounts": [
    {
      "code": "string",
      "name": "string",
      "description": "string",
      "groupId": "string",
      "taxTypeId": "Tt9mC5rL2wQz7nVb4kHp",
      "bankAccountId": "bacc_Q0gzMTA4NzY1NDM",
      "type": "BANK",
      "currency": "CHF"
    }
  ]
}'
{
  "error": {
    "code": "invalid-argument",
    "message": "Invalid request"
  }
}
DELETE/workspaces/{workspaceId}/chart-of-accounts/{chartOfAccountId}

Delete a chart of accounts

Bereichchart-of-accounts:write

Pfadparameter

workspaceIdstringerforderlich

ID of the workspace.

chartOfAccountIdstringerforderlich

ID of the chart of accounts.

Rückgabe

204

No content

curl -X DELETE 'https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/chart-of-accounts/Ca6yH3kN8pTr1vWx4bQs' \
  -H "Authorization: Bearer $SWAY_API_KEY"
{
  "error": {
    "code": "invalid-argument",
    "message": "Invalid request"
  }
}
POST/workspaces/{workspaceId}/chart-of-accounts/{chartOfAccountId}/accounts

Create an account inside a chart of accounts

Bereichchart-of-accounts:write

Pfadparameter

workspaceIdstringerforderlich

ID of the workspace.

chartOfAccountIdstringerforderlich

ID of the chart of accounts.

Request-Body

accountCodestringerforderlich
namestringerforderlich
descriptionstring
groupIdstringerforderlich
taxTypeIdstring

ID of the tax type.

bankAccountIdstring

ID of the bank account.

typestring
18 Werte anzeigen

BANKCURRENT_ASSETFIXED_ASSETINVENTORYNON_CURRENT_ASSETPREPAYMENTCURRENT_LIABILITYLIABILITYNON_CURRENT_LIABILITYEQUITYREVENUESALESOTHER_INCOMEDIRECT_COSTOVERHEADEXPENSEDEPRECIATIONSUSPENSE

currencystring

ISO 4217 currency code

Rückgabe

204

No content

curl -X POST 'https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/chart-of-accounts/Ca6yH3kN8pTr1vWx4bQs/accounts' \
  -H "Authorization: Bearer $SWAY_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "accountCode": "string",
  "name": "string",
  "description": "string",
  "groupId": "string",
  "taxTypeId": "Tt9mC5rL2wQz7nVb4kHp",
  "bankAccountId": "bacc_Q0gzMTA4NzY1NDM",
  "type": "BANK",
  "currency": "CHF"
}'
{
  "error": {
    "code": "invalid-argument",
    "message": "Invalid request"
  }
}
PATCH/workspaces/{workspaceId}/chart-of-accounts/{chartOfAccountId}/accounts/{accountId}

Update an account inside a chart of accounts

Bereichchart-of-accounts:write

Pfadparameter

workspaceIdstringerforderlich

ID of the workspace.

chartOfAccountIdstringerforderlich

ID of the chart of accounts.

accountIdstringerforderlich

Code of the account in the chart of accounts.

Request-Body

newAccountCodestring
namestring
descriptionstring | null
groupIdstring
taxTypeIdstring | null

ID of the tax type.

bankAccountIdstring | null

ID of the bank account.

typestring | null
18 Werte anzeigen

BANKCURRENT_ASSETFIXED_ASSETINVENTORYNON_CURRENT_ASSETPREPAYMENTCURRENT_LIABILITYLIABILITYNON_CURRENT_LIABILITYEQUITYREVENUESALESOTHER_INCOMEDIRECT_COSTOVERHEADEXPENSEDEPRECIATIONSUSPENSE

currencystring | null

ISO 4217 currency code

Rückgabe

204

No content

curl -X PATCH 'https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/chart-of-accounts/Ca6yH3kN8pTr1vWx4bQs/accounts/1020' \
  -H "Authorization: Bearer $SWAY_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "taxTypeId": "Tt9mC5rL2wQz7nVb4kHp",
  "bankAccountId": "bacc_Q0gzMTA4NzY1NDM",
  "type": "BANK",
  "currency": "CHF"
}'
{
  "error": {
    "code": "invalid-argument",
    "message": "Invalid request"
  }
}
DELETE/workspaces/{workspaceId}/chart-of-accounts/{chartOfAccountId}/accounts/{accountId}

Delete an account from a chart of accounts

Bereichchart-of-accounts:write

Pfadparameter

workspaceIdstringerforderlich

ID of the workspace.

chartOfAccountIdstringerforderlich

ID of the chart of accounts.

accountIdstringerforderlich

Code of the account in the chart of accounts.

Rückgabe

204

No content

curl -X DELETE 'https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/chart-of-accounts/Ca6yH3kN8pTr1vWx4bQs/accounts/1020' \
  -H "Authorization: Bearer $SWAY_API_KEY"
{
  "error": {
    "code": "invalid-argument",
    "message": "Invalid request"
  }
}
POST/workspaces/{workspaceId}/chart-of-accounts/{chartOfAccountId}/groups

Create an account group inside a chart of accounts

Bereichchart-of-accounts:write

Pfadparameter

workspaceIdstringerforderlich

ID of the workspace.

chartOfAccountIdstringerforderlich

ID of the chart of accounts.

Request-Body

groupIdstringerforderlich
namestringerforderlich
descriptionstring
parentIdstring

Rückgabe

204

No content

curl -X POST 'https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/chart-of-accounts/Ca6yH3kN8pTr1vWx4bQs/groups' \
  -H "Authorization: Bearer $SWAY_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "groupId": "string",
  "name": "string",
  "description": "string",
  "parentId": "string"
}'
{
  "error": {
    "code": "invalid-argument",
    "message": "Invalid request"
  }
}
PATCH/workspaces/{workspaceId}/chart-of-accounts/{chartOfAccountId}/groups/{groupId}

Update an account group inside a chart of accounts

Bereichchart-of-accounts:write

Pfadparameter

workspaceIdstringerforderlich

ID of the workspace.

chartOfAccountIdstringerforderlich

ID of the chart of accounts.

groupIdstringerforderlich

ID of the account group in the chart of accounts.

Request-Body

newGroupIdstring
namestring
descriptionstring | null
parentIdstring | null

Rückgabe

204

No content

curl -X PATCH 'https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/chart-of-accounts/Ca6yH3kN8pTr1vWx4bQs/groups/10' \
  -H "Authorization: Bearer $SWAY_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "newGroupId": "string",
  "name": "string",
  "description": "string",
  "parentId": "string"
}'
{
  "error": {
    "code": "invalid-argument",
    "message": "Invalid request"
  }
}
DELETE/workspaces/{workspaceId}/chart-of-accounts/{chartOfAccountId}/groups/{groupId}

Delete an account group from a chart of accounts

Bereichchart-of-accounts:write

Pfadparameter

workspaceIdstringerforderlich

ID of the workspace.

chartOfAccountIdstringerforderlich

ID of the chart of accounts.

groupIdstringerforderlich

ID of the account group in the chart of accounts.

Rückgabe

204

No content

curl -X DELETE 'https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/chart-of-accounts/Ca6yH3kN8pTr1vWx4bQs/groups/10' \
  -H "Authorization: Bearer $SWAY_API_KEY"
{
  "error": {
    "code": "invalid-argument",
    "message": "Invalid request"
  }
}
POST/workspaces/{workspaceId}/chart-of-accounts/export

Export a chart of accounts to a downloadable file

Bereichchart-of-accounts:write

Pfadparameter

workspaceIdstringerforderlich

ID of the workspace.

Abfrageparameter

fieldsstring

Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.

Rückgabe

200

Successful response

dataExportedFile[]erforderlich
7 untergeordnete Felder anzeigen
successbooleanerforderlich

Whether the file was produced; a failed file has no content.

fromDatestring

First day of the period the file covers.

toDatestring

Last day of the period the file covers, included.

mimeTypestring

Media type of the file.

namestring

Name of the file.

contentstring

Content of the file, as text.

encodingstring

Character encoding of the file, when it is not UTF-8.

curl -X POST 'https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/chart-of-accounts/export' \
  -H "Authorization: Bearer $SWAY_API_KEY"
{
  "data": [
    {
      "success": true,
      "fromDate": "2026-03-02",
      "toDate": "2026-03-02",
      "mimeType": "text/csv",
      "name": "string",
      "content": "string",
      "encoding": "win1252"
    }
  ]
}

Bauen Sie auf Ihren eigenen Daten.

Erstellen Sie ein Konto, öffnen Sie Profil › Entwickler und erstellen Sie einen Schlüssel, der auf die nötigen Ressourcen begrenzt ist. Fragen zu einer Integration? Das Team beantwortet sie in einem Gespräch.