| Méthode | Chemin | Résumé |
|---|---|---|
| GET | …/ledger-entries | List ledger entries in the workspace |
| POST | …/ledger-entries/encode-bank-transaction | Apply a set of cash-coding operations to a bank transaction |
| POST | …/ledger-entries/batch-encode-from-transaction-suggestions | Code one or more bank transactions from their accounting suggestion |
| POST | …/ledger-entries/export | Export ledger entries to a downloadable file |
| GET | …/ledger-entries/pre-export | Run pre-export checks on ledger entries before exporting |
| POST | …/ledger-entries/reorder | Reorder ledger entries attached to a bank transaction |
Les chemins commencent par /workspaces/{workspaceId}. Les endpoints GET demandent ledger-entries:read, les autres ledger-entries:write.
L’objet LedgerEntry
firestoreIdstringobligatoireID of the ledger entry.
workspaceIdstringobligatoireID of the workspace.
milliAmountnumberobligatoirecreditAccountstringcreditAccountSourcestringValeursmanualaibank_accountimportrule
creditBankTransactionobjectAfficher les 3 champs enfants
firestoreIdstringobligatoireID of the bank transaction.
bankAccountIdstringobligatoireID of the bank account.
orderintegerobligatoiredebitAccountstringAfficher les 18 champsMasquer la liste des champs
debitAccountSourcestringValeursmanualaibank_accountimportrule
debitBankTransactionobjectAfficher les 3 champs enfants
firestoreIdstringobligatoireID of the bank transaction.
bankAccountIdstringobligatoireID of the bank account.
orderintegerobligatoiretaxRatenumbertaxMilliAmountnumbertaxCodestringtaxIdstringtaxAccountstringtaxDirectionstringValeurscreditdebit
descriptionstringdatestringobligatoirecreationobjectobligatoireWhen and by whom the resource was created.
Afficher les 2 champs enfants
creationDateTimestringdate-timeobligatoireDate and time when the resource was created.
createdBystringID of the user who created the resource, when recorded.
{
"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"
}
}/workspaces/{workspaceId}/ledger-entriesList ledger entries in the workspace
Portéeledger-entries:read
Paramètres de chemin
workspaceIdstringobligatoireID of the workspace.
Paramètres de requête
limitintegerMaximum 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.
Par défaut20
startAfterstringCursor of the page to return: the nextCursor of the previous page.
fieldsstringComma-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.
Renvoie
List of items
Items of the page, in list order.
limitintegerobligatoirePage size of the request, or the number of requested ids.
nextCursorstringCursor 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"const response = await fetch('https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/ledger-entries', {
headers: {
Authorization: `Bearer ${process.env.SWAY_API_KEY}`,
},
});
console.log(await response.json());import os
import requests
response = requests.get(
"https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/ledger-entries",
headers={"Authorization": f"Bearer {os.environ['SWAY_API_KEY']}"},
)
print(response.json()){
"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"
}{
"error": {
"code": "invalid-argument",
"message": "Invalid request"
}
}{
"error": {
"code": "unauthenticated",
"message": "Invalid or expired credentials"
}
}{
"error": {
"code": "permission-denied",
"message": "Missing required scope: invoices:read"
}
}{
"error": {
"code": "not-found",
"message": "Resource not found"
}
}{
"error": {
"code": "internal",
"message": "An internal error occurred"
}
}/workspaces/{workspaceId}/ledger-entries/encode-bank-transactionApply 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.
Portéeledger-entries:write
Paramètres de chemin
workspaceIdstringobligatoireID of the workspace.
Paramètres de requête
fieldsstringComma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.
Corps de la requête
bankAccountIdstringobligatoireID of the bank account.
bankTransactionIdstringobligatoireID of the bank transaction.
operationsobject[]obligatoiretype: create
descriptionstringtaxRatenumbertaxMilliAmountnumbertaxCodestringtaxIdstringtaxAccountstringsignedMilliAmountnumberobligatoireaccountstringtypestringobligatoireValeurscreate
type: update
ledgerEntryIdstringobligatoireID of the ledger entry.
signedMilliAmountnumberaccountstring | nulldescriptionstring | nulltaxRatenumber | nulltaxMilliAmountnumber | nulltaxCodestring | nulltaxIdstring | nulltaxAccountstring | nulltypestringobligatoireValeursupdate
type: delete
typestringobligatoireValeursdelete
ledgerEntryIdstringobligatoireID of the ledger entry.
existingLedgerEntryIdsstring[]ID of the ledger entry.
Renvoie
Successful response
dataCashCodingResultobligatoireAfficher les 2 champs enfants
entriesobject[]obligatoireAfficher les 11 champs enfants
descriptionstringtaxRatenumbertaxMilliAmountnumbertaxCodestringtaxIdstringtaxAccountstringsignedMilliAmountnumberobligatoireaccountstringledgerEntryIdstringobligatoireID of the ledger entry.
orderintegerobligatoireaccountSourcestringValeursmanualaibank_accountimportrule
accountingStatusstringobligatoireValeurspendingpartially_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"
]
}'const response = await fetch('https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/ledger-entries/encode-bank-transaction', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SWAY_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"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"
]
}),
});
console.log(await response.json());import os
import requests
response = requests.post(
"https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/ledger-entries/encode-bank-transaction",
headers={"Authorization": f"Bearer {os.environ['SWAY_API_KEY']}"},
json={
"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",
],
},
)
print(response.json()){
"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"
}
}{
"error": {
"code": "invalid-argument",
"message": "Invalid request"
}
}{
"error": {
"code": "unauthenticated",
"message": "Invalid or expired credentials"
}
}{
"error": {
"code": "permission-denied",
"message": "Missing required scope: invoices:read"
}
}{
"error": {
"code": "not-found",
"message": "Resource not found"
}
}{
"error": {
"code": "internal",
"message": "An internal error occurred"
}
}/workspaces/{workspaceId}/ledger-entries/batch-encode-from-transaction-suggestionsCode one or more bank transactions from their accounting suggestion
Portéeledger-entries:write
Paramètres de chemin
workspaceIdstringobligatoireID of the workspace.
Paramètres de requête
fieldsstringComma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.
Corps de la requête
bankAccountIdstringobligatoireID of the bank account.
bankTransactionsobject[]obligatoireAfficher les 2 champs enfants
bankTransactionIdstringobligatoireID of the bank transaction.
existingLedgerEntryIdsstring[]obligatoireID of the ledger entry.
Renvoie
Successful response
dataBatchCodingResultobligatoireAfficher 1 champ enfant
resultsobject[]obligatoirestatus: approved
entriesobject[]obligatoireAfficher les 11 champs enfants
descriptionstringtaxRatenumbertaxMilliAmountnumbertaxCodestringtaxIdstringtaxAccountstringsignedMilliAmountnumberobligatoireaccountstringledgerEntryIdstringobligatoireID of the ledger entry.
orderintegerobligatoireaccountSourcestringValeursmanualaibank_accountimportrule
accountingStatusstringobligatoireValeurspendingpartially_bookedbooked
bankTransactionIdstringobligatoireID of the bank transaction.
statusstringobligatoireValeursapproved
status: skipped
bankTransactionIdstringobligatoireID of the bank transaction.
statusstringobligatoireValeursskipped
reasonstringobligatoireValeursout-of-datecannot-accept-suggestion
status: failed
bankTransactionIdstringobligatoireID of the bank transaction.
statusstringobligatoireValeursfailed
errorCodestringobligatoirecurl -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"
]
}
]
}'const response = await fetch('https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/ledger-entries/batch-encode-from-transaction-suggestions', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SWAY_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"bankAccountId": "bacc_Q0gzMTA4NzY1NDM",
"bankTransactions": [
{
"bankTransactionId": "trx_MjAyNjAzMDJUMDk",
"existingLedgerEntryIds": [
"Le3wN8qT5xKr1mZv7pBd"
]
}
]
}),
});
console.log(await response.json());import os
import requests
response = requests.post(
"https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/ledger-entries/batch-encode-from-transaction-suggestions",
headers={"Authorization": f"Bearer {os.environ['SWAY_API_KEY']}"},
json={
"bankAccountId": "bacc_Q0gzMTA4NzY1NDM",
"bankTransactions": [
{
"bankTransactionId": "trx_MjAyNjAzMDJUMDk",
"existingLedgerEntryIds": [
"Le3wN8qT5xKr1mZv7pBd",
],
},
],
},
)
print(response.json()){
"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"
}
]
}
}{
"error": {
"code": "invalid-argument",
"message": "Invalid request"
}
}{
"error": {
"code": "unauthenticated",
"message": "Invalid or expired credentials"
}
}{
"error": {
"code": "permission-denied",
"message": "Missing required scope: invoices:read"
}
}{
"error": {
"code": "not-found",
"message": "Resource not found"
}
}{
"error": {
"code": "internal",
"message": "An internal error occurred"
}
}/workspaces/{workspaceId}/ledger-entries/exportExport ledger entries to a downloadable file
Portéeledger-entries:write
Paramètres de chemin
workspaceIdstringobligatoireID of the workspace.
Paramètres de requête
fieldsstringComma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.
Corps de la requête
bankAccountIdstringobligatoireID of the bank account.
fromDatestringtoDatestringbankTransactionIdsstring[]ID of the bank transaction.
exportTypestringobligatoireFormat of the ledger entry export.
tsv_cresusTab-separated file to import into Crésus.
csv_winbizCSV file to import into Winbiz.
tsv_wineurTab-separated file to import into WinEUR.
csv_internal_ledger_entryCSV file with one row per ledger entry, with its debit, credit and tax accounts.
csv_internal_general_ledgerCSV file in general ledger layout, with one row per account and separate debit and credit columns.
xlsx_abacusExcel file to import into Abacus.
configobjectVariante 1
winbizVatSchemestringobligatoireValeursCASHVAT_NETNO_VATACCRUAL
winbizSuspenseAccountCodestringVariante 2
abacusMandantNumbernumberisWorkspaceFilebooleangenerateHeadersbooleantransliteratebooleanRenvoie
Successful response
dataLedgerEntryExportobligatoireAfficher les 4 champs enfants
startedbooleanobligatoireworkspaceIdstringobligatoirebankAccountIdstringobligatoirefilesobject[]obligatoireAfficher les 4 champs enfants
exportIdstringobligatoiretargetFileNamestringobligatoiredownloadUrlstringuriobligatoireTime-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.
expiresAtstringobligatoireInstant 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"
}'const response = await fetch('https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/ledger-entries/export', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SWAY_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"bankAccountId": "bacc_Q0gzMTA4NzY1NDM",
"fromDate": "2026-01-01",
"toDate": "2026-03-31",
"exportType": "tsv_cresus"
}),
});
console.log(await response.json());import os
import requests
response = requests.post(
"https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/ledger-entries/export",
headers={"Authorization": f"Bearer {os.environ['SWAY_API_KEY']}"},
json={
"bankAccountId": "bacc_Q0gzMTA4NzY1NDM",
"fromDate": "2026-01-01",
"toDate": "2026-03-31",
"exportType": "tsv_cresus",
},
)
print(response.json()){
"data": {
"started": true,
"workspaceId": "string",
"bankAccountId": "string",
"files": [
{
"exportId": "string",
"targetFileName": "string",
"downloadUrl": "https://example.com",
"expiresAt": "2026-03-02T09:30:00.000Z"
}
]
}
}{
"error": {
"code": "invalid-argument",
"message": "Invalid request"
}
}{
"error": {
"code": "unauthenticated",
"message": "Invalid or expired credentials"
}
}{
"error": {
"code": "permission-denied",
"message": "Missing required scope: invoices:read"
}
}{
"error": {
"code": "not-found",
"message": "Resource not found"
}
}{
"error": {
"code": "internal",
"message": "An internal error occurred"
}
}/workspaces/{workspaceId}/ledger-entries/pre-exportRun pre-export checks on ledger entries before exporting
Portéeledger-entries:read
Paramètres de chemin
workspaceIdstringobligatoireID of the workspace.
Paramètres de requête
fieldsstringComma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.
bankAccountIdstringobligatoireID of the bank account.
fromDatestringtoDatestringbankTransactionIdsstring[]ID of the bank transaction.
Renvoie
Successful response
dataLedgerEntryExportCheckobligatoireAfficher les 5 champs enfants
uncodedBankTransactionIdsstring[]obligatoireuncodedLedgerEntryIdsPerBankTransactionRecord<string, string[]>obligatoireimbalancedBankTransactionIdsstring[]obligatoirebankTransactionCountnumberobligatoireledgerEntryCountnumberobligatoirecurl 'https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/ledger-entries/pre-export?bankAccountId=bacc_Q0gzMTA4NzY1NDM' \
-H "Authorization: Bearer $SWAY_API_KEY"const response = await fetch('https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/ledger-entries/pre-export?bankAccountId=bacc_Q0gzMTA4NzY1NDM', {
headers: {
Authorization: `Bearer ${process.env.SWAY_API_KEY}`,
},
});
console.log(await response.json());import os
import requests
response = requests.get(
"https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/ledger-entries/pre-export?bankAccountId=bacc_Q0gzMTA4NzY1NDM",
headers={"Authorization": f"Bearer {os.environ['SWAY_API_KEY']}"},
)
print(response.json()){
"data": {
"uncodedBankTransactionIds": [
"string"
],
"uncodedLedgerEntryIdsPerBankTransaction": {
"key": [
"string"
]
},
"imbalancedBankTransactionIds": [
"string"
],
"bankTransactionCount": 0,
"ledgerEntryCount": 0
}
}{
"error": {
"code": "invalid-argument",
"message": "Invalid request"
}
}{
"error": {
"code": "unauthenticated",
"message": "Invalid or expired credentials"
}
}{
"error": {
"code": "permission-denied",
"message": "Missing required scope: invoices:read"
}
}{
"error": {
"code": "not-found",
"message": "Resource not found"
}
}{
"error": {
"code": "internal",
"message": "An internal error occurred"
}
}/workspaces/{workspaceId}/ledger-entries/reorderReorder ledger entries attached to a bank transaction
Portéeledger-entries:write
Paramètres de chemin
workspaceIdstringobligatoireID of the workspace.
Corps de la requête
ledgerEntryIdstringobligatoireID of the ledger entry.
bankTransactionIdstringobligatoireID of the bank transaction.
bankAccountIdstringobligatoireID of the bank account.
newOrderintegerobligatoireRenvoie
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
}'const response = await fetch('https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/ledger-entries/reorder', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SWAY_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"ledgerEntryId": "Le3wN8qT5xKr1mZv7pBd",
"bankTransactionId": "trx_MjAyNjAzMDJUMDk",
"bankAccountId": "bacc_Q0gzMTA4NzY1NDM",
"newOrder": 0
}),
});
console.log(response.status);import os
import requests
response = requests.post(
"https://api.business.swayapp.io/v1/workspaces/Wk7fQ2xR9bLm4tZp8sNv/ledger-entries/reorder",
headers={"Authorization": f"Bearer {os.environ['SWAY_API_KEY']}"},
json={
"ledgerEntryId": "Le3wN8qT5xKr1mZv7pBd",
"bankTransactionId": "trx_MjAyNjAzMDJUMDk",
"bankAccountId": "bacc_Q0gzMTA4NzY1NDM",
"newOrder": 0,
},
)
print(response.status_code){
"error": {
"code": "invalid-argument",
"message": "Invalid request"
}
}{
"error": {
"code": "unauthenticated",
"message": "Invalid or expired credentials"
}
}{
"error": {
"code": "permission-denied",
"message": "Missing required scope: invoices:read"
}
}{
"error": {
"code": "not-found",
"message": "Resource not found"
}
}{
"error": {
"code": "internal",
"message": "An internal error occurred"
}
}