Skip to content
Resource · Accounting

Ledger entries

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

ledger-entries:readledger-entries:write
MethodPathSummary
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

Paths start with /workspaces/{workspaceId}. GET endpoints need ledger-entries:read, the others ledger-entries:write.

The LedgerEntry object

firestoreIdstringrequired

ID of the ledger entry.

workspaceIdstringrequired

ID of the workspace.

milliAmountnumberrequired
creditAccountstring
creditAccountSourcestring

Valuesmanualaibank_accountimportrule

creditBankTransactionobject
Show 3 child fields
firestoreIdstringrequired

ID of the bank transaction.

bankAccountIdstringrequired

ID of the bank account.

orderintegerrequired
debitAccountstring
Show all 18 fields
debitAccountSourcestring

Valuesmanualaibank_accountimportrule

debitBankTransactionobject
Show 3 child fields
firestoreIdstringrequired

ID of the bank transaction.

bankAccountIdstringrequired

ID of the bank account.

orderintegerrequired
taxRatenumber
taxMilliAmountnumber
taxCodestring
taxIdstring
taxAccountstring
taxDirectionstring

Valuescreditdebit

descriptionstring
datestringrequired
creationobjectrequired

When and by whom the resource was created.

Show 2 child fields
creationDateTimestringdate-timerequired

Date and time when the resource was created.

createdBystring

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

The LedgerEntry object
{
  "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

Scopeledger-entries:read

Path parameters

workspaceIdstringrequired

ID of the workspace.

Query parameters

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.

Default20

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.

Returns

200

List of items

dataLedgerEntry[]required

Items of the page, in list order.

limitintegerrequired

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.

Scopeledger-entries:write

Path parameters

workspaceIdstringrequired

ID of the workspace.

Query parameters

fieldsstring

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

Request body

bankAccountIdstringrequired

ID of the bank account.

bankTransactionIdstringrequired

ID of the bank transaction.

operationsobject[]required
type: create
descriptionstring
taxRatenumber
taxMilliAmountnumber
taxCodestring
taxIdstring
taxAccountstring
signedMilliAmountnumberrequired
accountstring
typestringrequired

Valuescreate

type: update
ledgerEntryIdstringrequired

ID of the ledger entry.

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

Valuesupdate

type: delete
typestringrequired

Valuesdelete

ledgerEntryIdstringrequired

ID of the ledger entry.

existingLedgerEntryIdsstring[]

ID of the ledger entry.

Returns

200

Successful response

dataCashCodingResultrequired
Show 2 child fields
entriesobject[]required
Show 11 child fields
descriptionstring
taxRatenumber
taxMilliAmountnumber
taxCodestring
taxIdstring
taxAccountstring
signedMilliAmountnumberrequired
accountstring
ledgerEntryIdstringrequired

ID of the ledger entry.

orderintegerrequired
accountSourcestring

Valuesmanualaibank_accountimportrule

accountingStatusstringrequired

Valuespendingpartially_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

Scopeledger-entries:write

Path parameters

workspaceIdstringrequired

ID of the workspace.

Query parameters

fieldsstring

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

Request body

bankAccountIdstringrequired

ID of the bank account.

bankTransactionsobject[]required
Show 2 child fields
bankTransactionIdstringrequired

ID of the bank transaction.

existingLedgerEntryIdsstring[]required

ID of the ledger entry.

Returns

200

Successful response

dataBatchCodingResultrequired
Show 1 child field
resultsobject[]required
status: approved
entriesobject[]required
Show 11 child fields
descriptionstring
taxRatenumber
taxMilliAmountnumber
taxCodestring
taxIdstring
taxAccountstring
signedMilliAmountnumberrequired
accountstring
ledgerEntryIdstringrequired

ID of the ledger entry.

orderintegerrequired
accountSourcestring

Valuesmanualaibank_accountimportrule

accountingStatusstringrequired

Valuespendingpartially_bookedbooked

bankTransactionIdstringrequired

ID of the bank transaction.

statusstringrequired

Valuesapproved

status: skipped
bankTransactionIdstringrequired

ID of the bank transaction.

statusstringrequired

Valuesskipped

reasonstringrequired

Valuesout-of-datecannot-accept-suggestion

status: failed
bankTransactionIdstringrequired

ID of the bank transaction.

statusstringrequired

Valuesfailed

errorCodestringrequired
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

Scopeledger-entries:write

Path parameters

workspaceIdstringrequired

ID of the workspace.

Query parameters

fieldsstring

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

Request body

bankAccountIdstringrequired

ID of the bank account.

fromDatestring
toDatestring
bankTransactionIdsstring[]

ID of the bank transaction.

exportTypestringrequired

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
Variant 1
winbizVatSchemestringrequired

ValuesCASHVAT_NETNO_VATACCRUAL

winbizSuspenseAccountCodestring
Variant 2
abacusMandantNumbernumber
isWorkspaceFileboolean
generateHeadersboolean
transliterateboolean

Returns

200

Successful response

dataLedgerEntryExportrequired
Show 4 child fields
startedbooleanrequired
workspaceIdstringrequired
bankAccountIdstringrequired
filesobject[]required
Show 4 child fields
exportIdstringrequired
targetFileNamestringrequired
downloadUrlstringurirequired

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.

expiresAtstringrequired

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

Scopeledger-entries:read

Path parameters

workspaceIdstringrequired

ID of the workspace.

Query parameters

fieldsstring

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

bankAccountIdstringrequired

ID of the bank account.

fromDatestring
toDatestring
bankTransactionIdsstring[]

ID of the bank transaction.

Returns

200

Successful response

dataLedgerEntryExportCheckrequired
Show 5 child fields
uncodedBankTransactionIdsstring[]required
uncodedLedgerEntryIdsPerBankTransactionRecord<string, string[]>required
imbalancedBankTransactionIdsstring[]required
bankTransactionCountnumberrequired
ledgerEntryCountnumberrequired
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

Scopeledger-entries:write

Path parameters

workspaceIdstringrequired

ID of the workspace.

Request body

ledgerEntryIdstringrequired

ID of the ledger entry.

bankTransactionIdstringrequired

ID of the bank transaction.

bankAccountIdstringrequired

ID of the bank account.

newOrderintegerrequired

Returns

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"
  }
}

Start building on your own data.

Create an account, open Profile › Developer and create a key scoped to the resources you need. Questions about an integration? The team answers them on a call.