Zum Inhalt springen
Ressource · Accounting

Ledger entries

A ledger entry books an amount to an account of the chart of accounts.

ledger-entries:readledger-entries:write
MethodePfadZusammenfassung
GET…/ledger-entriesList ledger entries in the workspace
POST…/ledger-entries/encode-bank-transactionApply a set of cash-coding operations to a bank transaction
POST…/ledger-entries/batch-encode-from-transaction-suggestionsCode one or more bank transactions from their accounting suggestion
POST…/ledger-entries/exportExport ledger entries to a downloadable file
GET…/ledger-entries/pre-exportRun pre-export checks on ledger entries before exporting
POST…/ledger-entries/reorderReorder ledger entries attached to a bank transaction

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

Das Objekt LedgerEntry

firestoreIdstringerforderlich

ID of the ledger entry.

workspaceIdstringerforderlich

ID of the workspace.

milliAmountnumbererforderlich
creditAccountstring
creditAccountSourcestring

Wertemanualaibank_accountimportrule

creditBankTransactionobject
3 untergeordnete Felder anzeigen
firestoreIdstringerforderlich

ID of the bank transaction.

bankAccountIdstringerforderlich

ID of the bank account.

orderintegererforderlich
debitAccountstring
Alle 18 Felder anzeigen
debitAccountSourcestring

Wertemanualaibank_accountimportrule

debitBankTransactionobject
3 untergeordnete Felder anzeigen
firestoreIdstringerforderlich

ID of the bank transaction.

bankAccountIdstringerforderlich

ID of the bank account.

orderintegererforderlich
taxRatenumber
taxMilliAmountnumber
taxCodestring
taxIdstring
taxAccountstring
taxDirectionstring

Wertecreditdebit

descriptionstring
datestringerforderlich
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 LedgerEntry
{
  "firestoreId": "Le3wN8qT5xKr1mZv7pBd",
  "workspaceId": "Wk7fQ2xR9bLm4tZp8sNv",
  "milliAmount": 0,
  "creditAccount": "string",
  "creditAccountSource": "manual",
  "creditBankTransaction": {
    "firestoreId": "trx_MjAyNjAzMDJUMDk",
    "bankAccountId": "bacc_Q0gzMTA4NzY1NDM",
    "order": 0
  },
  "debitAccount": "string",
  "debitAccountSource": "manual",
  "debitBankTransaction": {
    "firestoreId": "trx_MjAyNjAzMDJUMDk",
    "bankAccountId": "bacc_Q0gzMTA4NzY1NDM",
    "order": 0
  },
  "taxRate": 0,
  "taxMilliAmount": 0,
  "taxCode": "string",
  "taxId": "string",
  "taxAccount": "string",
  "taxDirection": "credit",
  "description": "string",
  "date": "2026-03-02",
  "creation": {
    "creationDateTime": "2026-03-02T09:15:00.000Z",
    "createdBy": "Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"
  }
}
GET/workspaces/{workspaceId}/ledger-entries

List ledger entries in the workspace

Bereichledger-entries: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

dataLedgerEntry[]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/ledger-entries' \
  -H "Authorization: Bearer $SWAY_API_KEY"
{
  "data": [
    {
      "firestoreId": "Le3wN8qT5xKr1mZv7pBd",
      "workspaceId": "Wk7fQ2xR9bLm4tZp8sNv",
      "milliAmount": 0,
      "creditAccount": "string",
      "creditAccountSource": "manual",
      "creditBankTransaction": {
        "firestoreId": "trx_MjAyNjAzMDJUMDk",
        "bankAccountId": "bacc_Q0gzMTA4NzY1NDM",
        "order": 0
      },
      "debitAccount": "string",
      "debitAccountSource": "manual",
      "debitBankTransaction": {
        "firestoreId": "trx_MjAyNjAzMDJUMDk",
        "bankAccountId": "bacc_Q0gzMTA4NzY1NDM",
        "order": 0
      },
      "taxRate": 0,
      "taxMilliAmount": 0,
      "taxCode": "string",
      "taxId": "string",
      "taxAccount": "string",
      "taxDirection": "credit",
      "description": "string",
      "date": "2026-03-02",
      "creation": {
        "creationDateTime": "2026-03-02T09:15:00.000Z",
        "createdBy": "Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"
      }
    }
  ],
  "limit": 0,
  "nextCursor": "string"
}
POST/workspaces/{workspaceId}/ledger-entries/encode-bank-transaction

Apply a set of cash-coding operations to a bank transaction

Created ledger entries are appended after the existing ones, in the order they are listed.

Bereichledger-entries: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

bankAccountIdstringerforderlich

ID of the bank account.

bankTransactionIdstringerforderlich

ID of the bank transaction.

operationsobject[]erforderlich
type: create
descriptionstring
taxRatenumber
taxMilliAmountnumber
taxCodestring
taxIdstring
taxAccountstring
signedMilliAmountnumbererforderlich
accountstring
typestringerforderlich

Wertecreate

type: update
ledgerEntryIdstringerforderlich

ID of the ledger entry.

signedMilliAmountnumber
accountstring | null
descriptionstring | null
taxRatenumber | null
taxMilliAmountnumber | null
taxCodestring | null
taxIdstring | null
taxAccountstring | null
typestringerforderlich

Werteupdate

type: delete
typestringerforderlich

Wertedelete

ledgerEntryIdstringerforderlich

ID of the ledger entry.

existingLedgerEntryIdsstring[]

ID of the ledger entry.

Rückgabe

200

Successful response

dataCashCodingResulterforderlich
2 untergeordnete Felder anzeigen
entriesobject[]erforderlich
11 untergeordnete Felder anzeigen
descriptionstring
taxRatenumber
taxMilliAmountnumber
taxCodestring
taxIdstring
taxAccountstring
signedMilliAmountnumbererforderlich
accountstring
ledgerEntryIdstringerforderlich

ID of the ledger entry.

orderintegererforderlich
accountSourcestring

Wertemanualaibank_accountimportrule

accountingStatusstringerforderlich

Wertependingpartially_bookedbooked

curl -X POST 'https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/ledger-entries/encode-bank-transaction' \
  -H "Authorization: Bearer $SWAY_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "bankAccountId": "bacc_Q0gzMTA4NzY1NDM",
  "bankTransactionId": "trx_MjAyNjAzMDJUMDk",
  "operations": [
    {
      "description": "string",
      "taxRate": 0,
      "taxMilliAmount": 0,
      "taxCode": "string",
      "taxId": "string",
      "taxAccount": "string",
      "signedMilliAmount": 0,
      "account": "string",
      "type": "create"
    }
  ],
  "existingLedgerEntryIds": [
    "Le3wN8qT5xKr1mZv7pBd"
  ]
}'
{
  "data": {
    "entries": [
      {
        "description": "string",
        "taxRate": 0,
        "taxMilliAmount": 0,
        "taxCode": "string",
        "taxId": "string",
        "taxAccount": "string",
        "signedMilliAmount": 0,
        "account": "string",
        "ledgerEntryId": "Le3wN8qT5xKr1mZv7pBd",
        "order": 0,
        "accountSource": "manual"
      }
    ],
    "accountingStatus": "pending"
  }
}
POST/workspaces/{workspaceId}/ledger-entries/batch-encode-from-transaction-suggestions

Code one or more bank transactions from their accounting suggestion

Bereichledger-entries: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

bankAccountIdstringerforderlich

ID of the bank account.

bankTransactionsobject[]erforderlich
2 untergeordnete Felder anzeigen
bankTransactionIdstringerforderlich

ID of the bank transaction.

existingLedgerEntryIdsstring[]erforderlich

ID of the ledger entry.

Rückgabe

200

Successful response

dataBatchCodingResulterforderlich
1 untergeordnetes Feld anzeigen
resultsobject[]erforderlich
status: approved
entriesobject[]erforderlich
11 untergeordnete Felder anzeigen
descriptionstring
taxRatenumber
taxMilliAmountnumber
taxCodestring
taxIdstring
taxAccountstring
signedMilliAmountnumbererforderlich
accountstring
ledgerEntryIdstringerforderlich

ID of the ledger entry.

orderintegererforderlich
accountSourcestring

Wertemanualaibank_accountimportrule

accountingStatusstringerforderlich

Wertependingpartially_bookedbooked

bankTransactionIdstringerforderlich

ID of the bank transaction.

statusstringerforderlich

Werteapproved

status: skipped
bankTransactionIdstringerforderlich

ID of the bank transaction.

statusstringerforderlich

Werteskipped

reasonstringerforderlich

Werteout-of-datecannot-accept-suggestion

status: failed
bankTransactionIdstringerforderlich

ID of the bank transaction.

statusstringerforderlich

Wertefailed

errorCodestringerforderlich
curl -X POST 'https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/ledger-entries/batch-encode-from-transaction-suggestions' \
  -H "Authorization: Bearer $SWAY_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "bankAccountId": "bacc_Q0gzMTA4NzY1NDM",
  "bankTransactions": [
    {
      "bankTransactionId": "trx_MjAyNjAzMDJUMDk",
      "existingLedgerEntryIds": [
        "Le3wN8qT5xKr1mZv7pBd"
      ]
    }
  ]
}'
{
  "data": {
    "results": [
      {
        "entries": [
          {
            "description": "string",
            "taxRate": 0,
            "taxMilliAmount": 0,
            "taxCode": "string",
            "taxId": "string",
            "taxAccount": "string",
            "signedMilliAmount": 0,
            "account": "string",
            "ledgerEntryId": "Le3wN8qT5xKr1mZv7pBd",
            "order": 0,
            "accountSource": "manual"
          }
        ],
        "accountingStatus": "pending",
        "bankTransactionId": "trx_MjAyNjAzMDJUMDk",
        "status": "approved"
      }
    ]
  }
}
POST/workspaces/{workspaceId}/ledger-entries/export

Export ledger entries to a downloadable file

Bereichledger-entries: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

bankAccountIdstringerforderlich

ID of the bank account.

fromDatestring
toDatestring
bankTransactionIdsstring[]

ID of the bank transaction.

exportTypestringerforderlich

Format of the ledger entry export.

  • tsv_cresus

    Tab-separated file to import into Crésus.

  • csv_winbiz

    CSV file to import into Winbiz.

  • tsv_wineur

    Tab-separated file to import into WinEUR.

  • csv_internal_ledger_entry

    CSV file with one row per ledger entry, with its debit, credit and tax accounts.

  • csv_internal_general_ledger

    CSV file in general ledger layout, with one row per account and separate debit and credit columns.

  • xlsx_abacus

    Excel file to import into Abacus.

configobject
Variante 1
winbizVatSchemestringerforderlich

WerteCASHVAT_NETNO_VATACCRUAL

winbizSuspenseAccountCodestring
Variante 2
abacusMandantNumbernumber
isWorkspaceFileboolean
generateHeadersboolean
transliterateboolean

Rückgabe

200

Successful response

dataLedgerEntryExporterforderlich
4 untergeordnete Felder anzeigen
startedbooleanerforderlich
workspaceIdstringerforderlich
bankAccountIdstringerforderlich
filesobject[]erforderlich
4 untergeordnete Felder anzeigen
exportIdstringerforderlich
targetFileNamestringerforderlich
downloadUrlstringurierforderlich

Time-limited URL to download the file. The file may not be ready the moment the export call returns: poll this URL and retry while it responds with 404 until the download succeeds.

expiresAtstringerforderlich

Instant after which downloadUrl stops working.

curl -X POST 'https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/ledger-entries/export' \
  -H "Authorization: Bearer $SWAY_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "bankAccountId": "bacc_Q0gzMTA4NzY1NDM",
  "fromDate": "2026-01-01",
  "toDate": "2026-03-31",
  "exportType": "tsv_cresus"
}'
{
  "data": {
    "started": true,
    "workspaceId": "string",
    "bankAccountId": "string",
    "files": [
      {
        "exportId": "string",
        "targetFileName": "string",
        "downloadUrl": "https://example.com",
        "expiresAt": "2026-03-02T09:30:00.000Z"
      }
    ]
  }
}
GET/workspaces/{workspaceId}/ledger-entries/pre-export

Run pre-export checks on ledger entries before exporting

Bereichledger-entries:read

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.

bankAccountIdstringerforderlich

ID of the bank account.

fromDatestring
toDatestring
bankTransactionIdsstring[]

ID of the bank transaction.

Rückgabe

200

Successful response

dataLedgerEntryExportCheckerforderlich
5 untergeordnete Felder anzeigen
uncodedBankTransactionIdsstring[]erforderlich
uncodedLedgerEntryIdsPerBankTransactionRecord<string, string[]>erforderlich
imbalancedBankTransactionIdsstring[]erforderlich
bankTransactionCountnumbererforderlich
ledgerEntryCountnumbererforderlich
curl 'https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/ledger-entries/pre-export?bankAccountId=bacc_Q0gzMTA4NzY1NDM' \
  -H "Authorization: Bearer $SWAY_API_KEY"
{
  "data": {
    "uncodedBankTransactionIds": [
      "string"
    ],
    "uncodedLedgerEntryIdsPerBankTransaction": {
      "key": [
        "string"
      ]
    },
    "imbalancedBankTransactionIds": [
      "string"
    ],
    "bankTransactionCount": 0,
    "ledgerEntryCount": 0
  }
}
POST/workspaces/{workspaceId}/ledger-entries/reorder

Reorder ledger entries attached to a bank transaction

Bereichledger-entries:write

Pfadparameter

workspaceIdstringerforderlich

ID of the workspace.

Request-Body

ledgerEntryIdstringerforderlich

ID of the ledger entry.

bankTransactionIdstringerforderlich

ID of the bank transaction.

bankAccountIdstringerforderlich

ID of the bank account.

newOrderintegererforderlich

Rückgabe

204

No content

curl -X POST 'https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/ledger-entries/reorder' \
  -H "Authorization: Bearer $SWAY_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "ledgerEntryId": "Le3wN8qT5xKr1mZv7pBd",
  "bankTransactionId": "trx_MjAyNjAzMDJUMDk",
  "bankAccountId": "bacc_Q0gzMTA4NzY1NDM",
  "newOrder": 0
}'
{
  "error": {
    "code": "invalid-argument",
    "message": "Invalid request"
  }
}

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.