{"openapi":"3.1.0","info":{"title":"Sway Finance API","version":"1.225.0","description":"The Sway Finance API gives access to the banking, billing, payment and accounting data of your workspaces. Send an API key as a bearer token; each operation lists the scope the key needs. Lists return pages: pass the `nextCursor` of a page as `startAfter` to get the next one."},"externalDocs":{"description":"API guides","url":"https://www.swayapp.io/docs/api"},"servers":[{"url":"https://api.business.swayapp.io/v1","description":"Production"}],"security":[{"bearerAuth":[]}],"tags":[{"name":"Workspaces","description":"A workspace holds the bank accounts, invoices, payments and accounting of one company."},{"name":"Memberships","description":"A membership gives a user a role in a workspace."},{"name":"Invitations","description":"An invitation asks a person, by email, to join a workspace with a given role."},{"name":"Consents","description":"A consent lets Sway read the data of bank accounts or initiate payments from them."},{"name":"Bank accounts","description":"A bank account, connected through a consent or managed offline, holds its transactions and past balances."},{"name":"Currency exchanges","description":"A currency exchange holds the exchange rates from one base currency to other currencies."},{"name":"Invoices","description":"An invoice is a sales invoice or a supplier bill of the workspace."},{"name":"Counterparties","description":"A counterparty is a customer or a supplier the workspace trades with."},{"name":"Products","description":"A product is a good or a service with the sale and purchase details used on invoices."},{"name":"Payments","description":"Summarize a payment before you create or initiate it."},{"name":"Draft payments","description":"A draft payment is a payment prepared in Sway and not yet sent to the bank."},{"name":"Initiated payments","description":"An initiated payment is a payment sent to the bank for execution."},{"name":"Ledger entries","description":"A ledger entry books an amount to an account of the chart of accounts."},{"name":"Chart of accounts","description":"A chart of accounts lists the accounts and the account groups of the workspace accounting."},{"name":"Tax types","description":"A tax type sets a tax rate and the accounts that book the tax."},{"name":"Account coding rules","description":"An account coding rule codes the bank transactions that match its conditions."},{"name":"Workspace files","description":"A workspace file is a document stored in the workspace, such as a receipt or a bank statement."},{"name":"Users","description":"The user is the person the API token acts for."},{"name":"Billing accounts","description":"A billing account holds the subscription and billing details of one or more workspaces."}],"x-tagGroups":[{"name":"Workspace","tags":["Workspaces","Memberships","Invitations","Consents"]},{"name":"Banking","tags":["Bank accounts","Currency exchanges"]},{"name":"Billing","tags":["Invoices","Counterparties","Products"]},{"name":"Payments","tags":["Payments","Draft payments","Initiated payments"]},{"name":"Accounting","tags":["Ledger entries","Chart of accounts","Tax types","Account coding rules"]},{"name":"Files and account","tags":["Workspace files","Users","Billing accounts"]}],"paths":{"/workspaces/{workspaceId}/bank-accounts":{"get":{"operationId":"bankAccounts-list","summary":"List bank accounts in the workspace","tags":["Bank accounts"],"security":[{"bearerAuth":["bank-accounts:read"]}],"x-sway-scope":"bank-accounts:read","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/StartAfter"},{"name":"fields","in":"query","description":"Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.","schema":{"type":"string"},"example":"firestoreId,name,products"},{"$ref":"#/components/parameters/Ids"}],"responses":{"200":{"description":"List of items","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","description":"Items of the page, in list order.","items":{"$ref":"#/components/schemas/BankAccount"}},"limit":{"type":"integer","description":"Page size of the request, or the number of requested `ids`."},"nextCursor":{"type":"string","description":"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."}},"required":["data","limit"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspaces/{workspaceId}/bank-accounts/{bankAccountId}":{"patch":{"operationId":"bankAccounts-update","summary":"Update a bank account","tags":["Bank accounts"],"security":[{"bearerAuth":["bank-accounts:write"]}],"x-sway-scope":"bank-accounts:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/BankAccountId"},{"name":"fields","in":"query","description":"Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.","schema":{"type":"string"},"example":"firestoreId,name,products"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/BankAccount"}},"required":["data"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"bic":{"type":"string"},"ownerName":{"type":"string"},"accountTypeCode":{"type":"string","enum":["CACC","CARD","CASH","CHAR","CISH","COMM","CPAC","LLSV","LOAN","MGLD","MOMA","NFCA","NREX","ODFT","ONDP","OTHR","SACC","SLRY","SVGS","TAXE","TRAN","TRAS","VACC"]},"enabled":{"type":"boolean"},"enrichWithCamt":{"type":"boolean"}}},"examples":{"default":{"summary":"Example request","value":{"accountTypeCode":"CACC"}}}}}}}},"/workspaces/{workspaceId}/bank-accounts/archive":{"post":{"operationId":"bankAccounts-archive","summary":"Archive bank accounts so they no longer appear in active lists","tags":["Bank accounts"],"security":[{"bearerAuth":["bank-accounts:write"]}],"x-sway-scope":"bank-accounts:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"responses":{"204":{"description":"No content"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspaces/{workspaceId}/bank-accounts/create-offline":{"post":{"operationId":"bankAccounts-createOffline","summary":"Create an offline bank account not connected to a banking provider","tags":["Bank accounts"],"security":[{"bearerAuth":["bank-accounts:write"]}],"x-sway-scope":"bank-accounts:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"fields","in":"query","description":"Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.","schema":{"type":"string"},"example":"firestoreId,name,products"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/BankAccount"}},"required":["data"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"serviceProviderId":{"type":"string","examples":["sprov_SUlEUDAwMjMw"],"description":"ID of the service provider."},"accountTypeCode":{"type":"string","enum":["CACC","CARD","CASH","CHAR","CISH","COMM","CPAC","LLSV","LOAN","MGLD","MOMA","NFCA","NREX","ODFT","ONDP","OTHR","SACC","SLRY","SVGS","TAXE","TRAN","TRAS","VACC"]},"country":{"type":"string","description":"ISO 3166-1 alpha-2 country code","examples":["CH"]},"currency":{"type":"string","description":"ISO 4217 currency code","examples":["CHF"]},"identification":{"type":"string"},"identificationType":{"type":"string","enum":["iban","bban","accountNumber","pan","email","msisdn","virtualAccountId","globalWallet","clabe","bitcoinAddress","bitcoinXpub","other"]},"name":{"type":"string","minLength":1},"ownerName":{"type":"string","minLength":1}},"required":["serviceProviderId","accountTypeCode","country","currency","identification","identificationType"]}}}}}},"/workspaces/{workspaceId}/bank-accounts/{bankAccountId}/delete-offline":{"delete":{"operationId":"bankAccounts-deleteOffline","summary":"Delete an offline bank account","tags":["Bank accounts"],"security":[{"bearerAuth":["bank-accounts:write"]}],"x-sway-scope":"bank-accounts:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/BankAccountId"}],"responses":{"204":{"description":"No content"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspaces/{workspaceId}/bank-accounts/create-account-counterparty":{"post":{"operationId":"bankAccounts-createAccountCounterparty","summary":"Create a counterparty bank account record","tags":["Bank accounts"],"security":[{"bearerAuth":["bank-accounts:write"]}],"x-sway-scope":"bank-accounts:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"fields","in":"query","description":"Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.","schema":{"type":"string"},"example":"firestoreId,workspaceId,creation"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Counterparty"}},"required":["data"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"bankAccountId":{"type":"string","examples":["bacc_Q0gzMTA4NzY1NDM"],"description":"ID of the bank account."},"type":{"type":"string","enum":["individual","organization"],"description":"Kind of entity: an individual or an organization.","x-enumDescriptions":{"individual":"A natural person.","organization":"A company or another organization."}},"name":{"type":"string"},"address":{"$ref":"#/components/schemas/PostalAddress"}},"required":["bankAccountId","type","name","address"]}}}}}},"/workspaces/{workspaceId}/bank-accounts/transactions/search":{"get":{"operationId":"bankAccounts-transactions-search","summary":"Search bank transactions across the workspace","tags":["Bank accounts"],"security":[{"bearerAuth":["bank-accounts:read"]}],"x-sway-scope":"bank-accounts:read","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"fields","in":"query","description":"Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.","schema":{"type":"string"},"example":"firestoreId,dateTime,executionStatus"},{"name":"bankAccountId","in":"query","schema":{"type":"string","examples":["bacc_Q0gzMTA4NzY1NDM"],"description":"ID of the bank account."},"description":"ID of the bank account.","example":"bacc_Q0gzMTA4NzY1NDM"},{"name":"query","in":"query","schema":{"type":"string"},"required":true},{"name":"page","in":"query","schema":{"default":0,"type":"integer","minimum":0},"example":0},{"name":"size","in":"query","schema":{"default":20,"type":"integer","minimum":1,"maximum":100},"example":20}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/BankTransaction"}}},"required":["data"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspaces/{workspaceId}/bank-accounts/transactions/approve-all":{"post":{"operationId":"bankAccounts-transactions-approveAll","summary":"Approve all matching bank transactions in bulk","tags":["Bank accounts"],"security":[{"bearerAuth":["bank-accounts:write"]}],"x-sway-scope":"bank-accounts:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"responses":{"204":{"description":"No content"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspaces/{workspaceId}/bank-accounts/transactions/export":{"post":{"operationId":"bankAccounts-transactions-export","summary":"Export bank transactions to a downloadable file","tags":["Bank accounts"],"security":[{"bearerAuth":["bank-accounts:write"]}],"x-sway-scope":"bank-accounts:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"fields","in":"query","description":"Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.","schema":{"type":"string"},"example":"started,workspaceId,bankAccountId"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/BankTransactionExport"}},"required":["data"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"bankAccountId":{"type":"string","examples":["bacc_Q0gzMTA4NzY1NDM"],"description":"ID of the bank account."},"fromDate":{"type":"string","examples":["2026-03-02"]},"toDate":{"type":"string","examples":["2026-03-02"]},"exportType":{"type":"string","enum":["xero","csv_xero","quickbooks","csv_quickbooks","csv_winbiz","tsv_cresus","csv_wineur","tsv_wineur","xml_camt053","csv_statement","html_statement","pdf_statement","dsv_custom"],"description":"Format of the bank transaction export.","x-enumDescriptions":{"xero":"Deprecated alias of `csv_xero`.","csv_xero":"CSV file to import into Xero.","quickbooks":"Deprecated alias of `csv_quickbooks`.","csv_quickbooks":"CSV file to import into QuickBooks.","csv_winbiz":"CSV file of accounting entries to import into Winbiz.","tsv_cresus":"Tab-separated file of accounting entries to import into Crésus.","csv_wineur":"Deprecated alias of `tsv_wineur`.","tsv_wineur":"Tab-separated file of accounting entries to import into WinEUR.","xml_camt053":"ISO 20022 camt.053 XML bank statement, one file per day.","csv_statement":"CSV bank statement.","html_statement":"HTML bank statement.","pdf_statement":"PDF bank statement.","dsv_custom":"Delimited text file with the columns in `fields`, separated by `separator`."}},"fields":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["account_identification","transaction_id","status","transaction_code","balance","booking_date","booking_date_time","value_date","value_date_time","transaction_amount_signed","transaction_amount_value","transaction_amount_debit","transaction_amount_credit","transaction_amount_currency","transaction_amount_text","instructed_amount_value","instructed_amount_currency","instructed_amount_text","fees_amount_value","fees_amount_currency","fees_amount_text","exchange_rate_value","exchange_rate_text","counterparty_name","counterparty_address","counterparty_account_identification","communication","reference","additional_information","full_description","smart_description","custom_string","custom_number","custom_boolean","custom_date","custom_iso_date","custom_empty"]},"name":{"type":"string"},"defaultValue":{"type":"string"},"format":{"type":"string"}},"required":["type"]}},"config":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}},"separator":{"type":"string"},"generateHeaders":{"type":"boolean"},"transliterate":{"type":"boolean"},"messagingToken":{"type":"string"},"isWorkspaceFile":{"type":"boolean"}},"required":["bankAccountId","fromDate","toDate","exportType"]},"examples":{"default":{"summary":"Example request","value":{"bankAccountId":"bacc_Q0gzMTA4NzY1NDM","fromDate":"2026-03-02","toDate":"2026-03-02","exportType":"xero","fields":[{"type":"account_identification"}]}}}}}}}},"/workspaces/{workspaceId}/bank-accounts/transactions/request-cash-coding":{"post":{"operationId":"bankAccounts-transactions-requestCashCoding","summary":"Request AI-suggested cash coding for bank transactions","description":"Takes at most 10 distinct `bankTransactionIds`. A request with more, or with the same id twice, returns a `400`.","tags":["Bank accounts"],"security":[{"bearerAuth":["bank-accounts:write"]}],"x-sway-scope":"bank-accounts:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"responses":{"204":{"description":"No content"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"bankAccountId":{"type":"string","examples":["bacc_Q0gzMTA4NzY1NDM"],"description":"ID of the bank account."},"bankTransactionIds":{"maxItems":10,"type":"array","items":{"type":"string","examples":["trx_MjAyNjAzMDJUMDk"],"description":"ID of the bank transaction."}}},"required":["bankAccountId","bankTransactionIds"]},"examples":{"default":{"summary":"Example request","value":{"bankAccountId":"bacc_Q0gzMTA4NzY1NDM","bankTransactionIds":["trx_MjAyNjAzMDJUMDk"]}}}}}}}},"/workspaces/{workspaceId}/bank-accounts/{bankAccountId}/transactions":{"get":{"operationId":"bankAccounts-transactions-list","summary":"List transactions on a bank account","tags":["Bank accounts"],"security":[{"bearerAuth":["bank-accounts:read"]}],"x-sway-scope":"bank-accounts:read","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/BankAccountId"},{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/StartAfter"},{"name":"fields","in":"query","description":"Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.","schema":{"type":"string"},"example":"firestoreId,dateTime,executionStatus"},{"$ref":"#/components/parameters/Ids"},{"name":"approvalStatus","in":"query","schema":{"type":"string","enum":["pending","approved","rejected"],"description":"Review status of the bank transaction.","x-enumDescriptions":{"pending":"The transaction waits for a review. A new transaction starts in this status, except the older transactions of a newly connected bank account.","approved":"A user approved the transaction, or Sway approved it as an older transaction when the bank account was connected.","rejected":"A user rejected the transaction."}},"description":"Review status of the bank transaction.","example":"pending"}],"responses":{"200":{"description":"List of items","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","description":"Items of the page, in list order.","items":{"$ref":"#/components/schemas/BankTransaction"}},"limit":{"type":"integer","description":"Page size of the request, or the number of requested `ids`."},"nextCursor":{"type":"string","description":"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."}},"required":["data","limit"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspaces/{workspaceId}/bank-accounts/{bankAccountId}/transactions/{transactionId}/review":{"post":{"operationId":"bankAccounts-transactions-review","summary":"Review a single bank transaction (approve, reject, or update)","tags":["Bank accounts"],"security":[{"bearerAuth":["bank-accounts:write"]}],"x-sway-scope":"bank-accounts:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/BankAccountId"},{"$ref":"#/components/parameters/TransactionId"},{"name":"fields","in":"query","description":"Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.","schema":{"type":"string"},"example":"firestoreId,dateTime,executionStatus"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/BankTransaction"}},"required":["data"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["pending","approved","rejected"],"description":"Review status of the bank transaction.","x-enumDescriptions":{"pending":"The transaction waits for a review. A new transaction starts in this status, except the older transactions of a newly connected bank account.","approved":"A user approved the transaction, or Sway approved it as an older transaction when the bank account was connected.","rejected":"A user rejected the transaction."}}},"required":["status"]},"examples":{"default":{"summary":"Example request","value":{"status":"pending"}}}}}}}},"/workspaces/{workspaceId}/bank-accounts/{bankAccountId}/balance-history":{"get":{"operationId":"bankAccounts-balanceHistory-list","summary":"List historical balances for a bank account","tags":["Bank accounts"],"security":[{"bearerAuth":["bank-accounts:read"]}],"x-sway-scope":"bank-accounts:read","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/BankAccountId"},{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/StartAfter"},{"name":"fields","in":"query","description":"Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.","schema":{"type":"string"},"example":"firestoreId,bankAccountId,workspaceId"},{"$ref":"#/components/parameters/Ids"}],"responses":{"200":{"description":"List of items","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","description":"Items of the page, in list order.","items":{"$ref":"#/components/schemas/BalanceHistory"}},"limit":{"type":"integer","description":"Page size of the request, or the number of requested `ids`."},"nextCursor":{"type":"string","description":"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."}},"required":["data","limit"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspaces/{workspaceId}/bank-accounts/{bankAccountId}/attachments/upload":{"post":{"operationId":"bankAccounts-attachments-upload","summary":"Get an upload URL for an attachment of the bank account","description":"The attachment is a PDF, CSV, XML or image file. The characters `<>:\"/\\|?*#^` are removed from `fileName`, and a name left empty is rejected. PUT the file bytes to `uploadUrl` with the returned `contentType`. The file is kept as an attachment of the bank account, visible in the web app, under the returned `attachmentId`.","tags":["Bank accounts"],"security":[{"bearerAuth":["bank-accounts:write"]}],"x-sway-scope":"bank-accounts:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/BankAccountId"},{"name":"fields","in":"query","description":"Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.","schema":{"type":"string"},"example":"uploadUrl,contentType,size"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AttachmentUploadUrl"}},"required":["data"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"fileName":{"type":"string","minLength":1},"contentType":{"type":"string","minLength":1},"size":{"type":"integer","exclusiveMinimum":0}},"required":["fileName","contentType","size"]}}}}}},"/workspaces/{workspaceId}/bank-accounts/{bankAccountId}/attachments/{attachmentId}/parse-transactions":{"post":{"operationId":"bankAccounts-attachments-parseTransactions","summary":"Parse the transactions of a PDF bank statement attached to the bank account in the background","description":"Takes the `attachmentId` returned by `upload`. Returns a `404` until the `PUT` to `uploadUrl` completes and the attachment is registered, and for a file that is not an attachment of this bank account. Returns a `400` for an attachment that is not a PDF. When parsing completes, the caller receives an email linking to the statement preview in the web app, where they review and confirm the import. Calling it again within 6 hours of the previous parsing start starts no new parsing and sends no new email. A later call, or a call after the import was confirmed, parses the statement again and sends another email.","tags":["Bank accounts"],"security":[{"bearerAuth":["bank-accounts:write"]}],"x-sway-scope":"bank-accounts:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/BankAccountId"},{"$ref":"#/components/parameters/AttachmentId"}],"responses":{"204":{"description":"No content"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspaces/{workspaceId}/memberships":{"get":{"operationId":"memberships-list","summary":"List workspace memberships","tags":["Memberships"],"security":[{"bearerAuth":["memberships:read"]}],"x-sway-scope":"memberships:read","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/StartAfter"},{"name":"fields","in":"query","description":"Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.","schema":{"type":"string"},"example":"firestoreId,workspaceId,userId"},{"$ref":"#/components/parameters/Ids"}],"responses":{"200":{"description":"List of items","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","description":"Items of the page, in list order.","items":{"$ref":"#/components/schemas/Membership"}},"limit":{"type":"integer","description":"Page size of the request, or the number of requested `ids`."},"nextCursor":{"type":"string","description":"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."}},"required":["data","limit"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspaces/{workspaceId}/memberships/{membershipId}":{"patch":{"operationId":"memberships-update","summary":"Update a workspace membership","tags":["Memberships"],"security":[{"bearerAuth":["memberships:write"]}],"x-sway-scope":"memberships:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/MembershipId"},{"name":"fields","in":"query","description":"Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.","schema":{"type":"string"},"example":"firestoreId,workspaceId,userId"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Membership"}},"required":["data"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"role":{"anyOf":[{"type":"string","const":"ws.owner"},{"type":"string","const":"ws.admin"},{"type":"string","const":"ws.member"},{"type":"string","const":"ws.viewer"},{"type":"string","const":"ba.owner"},{"type":"string","const":"ba.admin"},{"type":"string","const":"ba.member"}]}},"required":["role"]},"examples":{"default":{"summary":"Example request","value":{"role":"ws.owner"}}}}}}}},"/workspaces/{workspaceId}/memberships/{membershipId}/disable":{"post":{"operationId":"memberships-disable","summary":"Disable a workspace membership","tags":["Memberships"],"security":[{"bearerAuth":["memberships:write"]}],"x-sway-scope":"memberships:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/MembershipId"},{"name":"fields","in":"query","description":"Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.","schema":{"type":"string"},"example":"firestoreId,workspaceId,userId"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Membership"}},"required":["data"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspaces/{workspaceId}/invitations":{"get":{"operationId":"invitations-list","summary":"List workspace invitations","tags":["Invitations"],"security":[{"bearerAuth":["invitations:read"]}],"x-sway-scope":"invitations:read","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/StartAfter"},{"name":"fields","in":"query","description":"Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.","schema":{"type":"string"},"example":"firestoreId,workspaceId,inviterId"},{"$ref":"#/components/parameters/Ids"}],"responses":{"200":{"description":"List of items","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","description":"Items of the page, in list order.","items":{"$ref":"#/components/schemas/Invitation"}},"limit":{"type":"integer","description":"Page size of the request, or the number of requested `ids`."},"nextCursor":{"type":"string","description":"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."}},"required":["data","limit"]},"examples":{"default":{"summary":"Example response","value":{"data":[{"firestoreId":"In8rD4sF7jPw2yKm6tQb","workspaceId":"Wk7fQ2xR9bLm4tZp8sNv","inviterId":"Xq3vT9mB2kLpR7sN4wYc8dZf1aHj","status":"pending","role":"ws.owner","email":"anna.meier@example.com","expirationDateTime":"2026-03-02T09:30:00.000Z"}],"limit":20}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"operationId":"invitations-create","summary":"Create and send a workspace invitation","tags":["Invitations"],"security":[{"bearerAuth":["invitations:write"]}],"x-sway-scope":"invitations:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"fields","in":"query","description":"Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.","schema":{"type":"string"},"example":"firestoreId,workspaceId,inviterId"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Invitation"}},"required":["data"]},"examples":{"default":{"summary":"Example response","value":{"data":{"firestoreId":"In8rD4sF7jPw2yKm6tQb","workspaceId":"Wk7fQ2xR9bLm4tZp8sNv","inviterId":"Xq3vT9mB2kLpR7sN4wYc8dZf1aHj","status":"pending","role":"ws.owner","email":"anna.meier@example.com","expirationDateTime":"2026-03-02T09:30:00.000Z"}}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"examples":["anna.meier@example.com"],"type":"string"},"role":{"anyOf":[{"type":"string","const":"ws.owner"},{"type":"string","const":"ws.admin"},{"type":"string","const":"ws.member"},{"type":"string","const":"ws.viewer"},{"type":"string","const":"ba.owner"},{"type":"string","const":"ba.admin"},{"type":"string","const":"ba.member"}]}},"required":["email","role"]},"examples":{"default":{"summary":"Example request","value":{"email":"anna.meier@example.com","role":"ws.owner"}}}}}}}},"/workspaces/{workspaceId}/invitations/{invitationId}":{"delete":{"operationId":"invitations-delete","summary":"Delete (cancel) a pending invitation","tags":["Invitations"],"security":[{"bearerAuth":["invitations:write"]}],"x-sway-scope":"invitations:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/InvitationId"}],"responses":{"204":{"description":"No content"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"get":{"operationId":"invitations-get","summary":"Get detailed information about an invitation","tags":["Invitations"],"security":[{"bearerAuth":["invitations:read"]}],"x-sway-scope":"invitations:read","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/InvitationId"},{"name":"fields","in":"query","description":"Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.","schema":{"type":"string"},"example":"firestoreId,workspaceId,inviterId"},{"name":"email","in":"query","schema":{"examples":["anna.meier@example.com"],"type":"string"},"required":true,"example":"anna.meier@example.com"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/DetailedInvitation"}},"required":["data"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspaces/{workspaceId}/invitations/{invitationId}/resend":{"post":{"operationId":"invitations-resend","summary":"Resend a pending invitation email","tags":["Invitations"],"security":[{"bearerAuth":["invitations:write"]}],"x-sway-scope":"invitations:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/InvitationId"}],"responses":{"204":{"description":"No content"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspaces/{workspaceId}/invitations/{invitationId}/consume":{"post":{"operationId":"invitations-consume","summary":"Consume an invitation to join the workspace","tags":["Invitations"],"security":[{"bearerAuth":["invitations:write"]}],"x-sway-scope":"invitations:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/InvitationId"},{"name":"fields","in":"query","description":"Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.","schema":{"type":"string"},"example":"firestoreId,workspaceId,userId"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Membership"}},"required":["data"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspaces/{workspaceId}/read-consents":{"get":{"operationId":"consents-readConsents-list","summary":"List read consents granted to access banking data","tags":["Consents"],"security":[{"bearerAuth":["consents:read"]}],"x-sway-scope":"consents:read","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/StartAfter"},{"name":"fields","in":"query","description":"Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.","schema":{"type":"string"},"example":"firestoreId,expirationDateTime,authorizationStatus"},{"$ref":"#/components/parameters/Ids"}],"responses":{"200":{"description":"List of items","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","description":"Items of the page, in list order.","items":{"$ref":"#/components/schemas/ReadConsent"}},"limit":{"type":"integer","description":"Page size of the request, or the number of requested `ids`."},"nextCursor":{"type":"string","description":"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."}},"required":["data","limit"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"operationId":"consents-readConsents-create","summary":"Create a new read consent with a banking provider","tags":["Consents"],"security":[{"bearerAuth":["consents:write"]}],"x-sway-scope":"consents:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"fields","in":"query","description":"Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.","schema":{"type":"string"},"example":"firestoreId,expirationDateTime,authorizationStatus"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ReadConsent"}},"required":["data"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"serviceProviderId":{"type":"string","examples":["sprov_SUlEUDAwMjMw"],"description":"ID of the service provider."},"reference":{"type":"string"},"consentId":{"type":"string","examples":["rcons_UkVBRC0wMDQy"],"description":"ID of an earlier read consent to revoke and replace; the new consent keeps its reference."}},"required":["serviceProviderId","reference"]}}}}}},"/workspaces/{workspaceId}/read-consents/{consentId}/finalize":{"post":{"operationId":"consents-readConsents-finalize","summary":"Finalize a read consent after the provider authorization step","tags":["Consents"],"security":[{"bearerAuth":["consents:write"]}],"x-sway-scope":"consents:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/ConsentId"},{"name":"fields","in":"query","description":"Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.","schema":{"type":"string"},"example":"firestoreId,expirationDateTime,authorizationStatus"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ReadConsent"}},"required":["data"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspaces/{workspaceId}/read-consents/{consentId}/renew":{"post":{"operationId":"consents-readConsents-renew","summary":"Renew an expiring or expired read consent","tags":["Consents"],"security":[{"bearerAuth":["consents:write"]}],"x-sway-scope":"consents:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/ConsentId"},{"name":"fields","in":"query","description":"Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.","schema":{"type":"string"},"example":"firestoreId,expirationDateTime,authorizationStatus"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ReadConsent"}},"required":["data"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"serviceProviderId":{"type":"string","examples":["sprov_SUlEUDAwMjMw"],"description":"ID of the service provider."},"reference":{"type":"string"}},"required":["serviceProviderId","reference"]}}}}}},"/workspaces/{workspaceId}/read-consents/{consentId}/revoke":{"post":{"operationId":"consents-readConsents-revoke","summary":"Revoke an active read consent","tags":["Consents"],"security":[{"bearerAuth":["consents:write"]}],"x-sway-scope":"consents:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/ConsentId"}],"responses":{"204":{"description":"No content"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspaces/{workspaceId}/read-consents/{consentId}/solve":{"post":{"operationId":"consents-readConsents-solve","summary":"Solve a pending read consent issue requiring user action","tags":["Consents"],"security":[{"bearerAuth":["consents:write"]}],"x-sway-scope":"consents:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/ConsentId"}],"responses":{"204":{"description":"No content"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspaces/{workspaceId}/write-consents":{"post":{"operationId":"consents-writeConsents-create","summary":"Create a write consent to enable initiating payments","tags":["Consents"],"security":[{"bearerAuth":["consents:write"]}],"x-sway-scope":"consents:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"fields","in":"query","description":"Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.","schema":{"type":"string"},"example":"firestoreId,expirationDateTime,authorizationStatus"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/WriteConsent"}},"required":["data"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"serviceProviderId":{"type":"string","examples":["sprov_SUlEUDAwMjMw"],"description":"ID of the service provider."},"paymentData":{"type":"object","properties":{"scope":{"anyOf":[{"type":"string","enum":["domestic","international"],"description":"Scope of the payment, which depends on the countries and currencies of the debtor and creditor accounts.","x-enumDescriptions":{"domestic":"A GBP payment between two accounts in the United Kingdom, or a EUR payment between two accounts in SEPA countries.","international":"Any other payment, which needs the BIC of the creditor bank."}},{"type":"null"}],"description":"Scope of the payment, which depends on the countries and currencies of the debtor and creditor accounts."},"idempotencyId":{"anyOf":[{"type":"string"},{"type":"null"}]},"executionDate":{"type":"string","examples":["2026-03-02"]},"amount":{"type":"number","exclusiveMinimum":0,"description":"Amount of the payment, in `currency`."},"currency":{"type":"string"},"reference":{"anyOf":[{"type":"string"},{"type":"null"}]},"communication":{"anyOf":[{"type":"string"},{"type":"null"}]},"invoiceId":{"anyOf":[{"type":"string","examples":["Iv5zP2nK7wRt3xMq9bLd"],"description":"ID of the invoice."},{"type":"null"}],"description":"ID of the invoice."},"chargeBearer":{"anyOf":[{"type":"string","enum":["CRED","DEBT","SHAR","SLEV"]},{"type":"null"}]},"debtor":{"type":"object","properties":{"bankAccountId":{"type":"string","examples":["bacc_Q0gzMTA4NzY1NDM"],"description":"ID of the bank account."},"name":{"type":"string"},"accountIdentifications":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["bic","sortCode","iban","bban","accountNumber","pan","email","msisdn","virtualAccountId","globalWallet","clabe","bitcoinAddress","bitcoinXpub","other"],"description":"Kind of identifier of a bank account or of its bank.","x-enumDescriptions":{"bic":"Bank Identifier Code of the bank.","sortCode":"Six-digit code of a bank and branch in the United Kingdom.","iban":"International Bank Account Number.","bban":"Basic Bank Account Number, the country-specific format of an account number.","accountNumber":"Account number that the bank assigns, unique within the bank or the branch.","pan":"Primary Account Number, the number of a credit or debit card.","email":"Email address that identifies the account.","msisdn":"Mobile phone number that identifies the account.","virtualAccountId":"Identifier of a virtual sub-account of a main account.","globalWallet":"Identifier of a digital wallet that holds and pays in several currencies.","clabe":"CLABE, the 18-digit standardized bank code of a Mexican bank account.","bitcoinAddress":"Single Bitcoin address, the only address the account tracks.","bitcoinXpub":"Bitcoin extended public key (xpub, ypub or zpub), from which the addresses of the wallet are derived.","other":"Another kind of identifier."}},"value":{"description":"Value of the identifier, for example the IBAN or the BIC.","type":"string"}},"required":["type","value"]}},"currency":{"type":"string"}},"required":["bankAccountId","name","accountIdentifications","currency"]},"creditor":{"type":"object","properties":{"counterpartyId":{"type":"string","examples":["Cp2nG7vB4xLq9wRt5hMz"],"description":"ID of the counterparty."},"counterpartyCashAccountId":{"type":"string"},"name":{"type":"string"},"accountIdentifications":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["bic","sortCode","iban","bban","accountNumber","pan","email","msisdn","virtualAccountId","globalWallet","clabe","bitcoinAddress","bitcoinXpub","other"],"description":"Kind of identifier of a bank account or of its bank.","x-enumDescriptions":{"bic":"Bank Identifier Code of the bank.","sortCode":"Six-digit code of a bank and branch in the United Kingdom.","iban":"International Bank Account Number.","bban":"Basic Bank Account Number, the country-specific format of an account number.","accountNumber":"Account number that the bank assigns, unique within the bank or the branch.","pan":"Primary Account Number, the number of a credit or debit card.","email":"Email address that identifies the account.","msisdn":"Mobile phone number that identifies the account.","virtualAccountId":"Identifier of a virtual sub-account of a main account.","globalWallet":"Identifier of a digital wallet that holds and pays in several currencies.","clabe":"CLABE, the 18-digit standardized bank code of a Mexican bank account.","bitcoinAddress":"Single Bitcoin address, the only address the account tracks.","bitcoinXpub":"Bitcoin extended public key (xpub, ypub or zpub), from which the addresses of the wallet are derived.","other":"Another kind of identifier."}},"value":{"description":"Value of the identifier, for example the IBAN or the BIC.","type":"string"}},"required":["type","value"]}},"currency":{"type":"string"},"address":{"type":"object","properties":{"country":{"type":"string","description":"ISO 3166-1 alpha-2 country code","examples":["CH"]},"postCode":{"description":"Post code of the address.","type":"string","minLength":2},"townName":{"description":"Name of the town or city.","type":"string","minLength":1},"streetName":{"description":"Name of the street.","type":"string"},"buildingNumber":{"description":"Number of the building in the street.","type":"string"},"name":{"description":"Name of the building or place.","type":"string"},"sortingCode":{"description":"Additional sorting code of the postal service, used in a few countries such as France.","type":"string"},"postBox":{"description":"Post office box.","type":"string"},"administrativeArea":{"description":"Region of the country, such as a canton or a state.","type":"string"},"recipients":{"type":"array","items":{"type":"string"},"description":"Names of the people the address is for."},"organization":{"description":"Name of the organization at the address.","type":"string"},"source":{"type":"array","items":{"type":"string"},"description":"Text the address was read from, one item per line."}}}},"required":["counterpartyId","counterpartyCashAccountId","name","accountIdentifications","currency"]}},"required":["executionDate","amount","currency","debtor","creditor"]},"callbackParams":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["serviceProviderId","paymentData"]}}}}}},"/workspaces/{workspaceId}/counterparties":{"get":{"operationId":"counterparties-list","summary":"List counterparties (customers, vendors) in the workspace","tags":["Counterparties"],"security":[{"bearerAuth":["counterparties:read"]}],"x-sway-scope":"counterparties:read","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/StartAfter"},{"name":"fields","in":"query","description":"Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.","schema":{"type":"string"},"example":"firestoreId,workspaceId,creation"},{"$ref":"#/components/parameters/Ids"},{"name":"activation.enabled","in":"query","schema":{"type":"boolean","description":"Whether the resource is enabled.","examples":[true]},"description":"Whether the resource is enabled.","example":true}],"responses":{"200":{"description":"List of items","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","description":"Items of the page, in list order.","items":{"$ref":"#/components/schemas/Counterparty"}},"limit":{"type":"integer","description":"Page size of the request, or the number of requested `ids`."},"nextCursor":{"type":"string","description":"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."}},"required":["data","limit"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"operationId":"counterparties-create","summary":"Create a counterparty or merge with an existing one","tags":["Counterparties"],"security":[{"bearerAuth":["counterparties:write"]}],"x-sway-scope":"counterparties:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"fields","in":"query","description":"Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.","schema":{"type":"string"},"example":"firestoreId,workspaceId,creation"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Counterparty"}},"required":["data"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"entityType":{"type":"string","enum":["individual","organization"],"description":"Kind of entity: an individual or an organization.","x-enumDescriptions":{"individual":"A natural person.","organization":"A company or another organization."}},"name":{"type":"string","minLength":1},"phones":{"type":"array","items":{"type":"string"}},"emails":{"type":"array","items":{"type":"string"}},"address":{"$ref":"#/components/schemas/PostalAddress"},"contactPersons":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"phone":{"type":"string"},"email":{"type":"string"}},"required":["name"]}},"taxIdentification":{"type":"string"},"notes":{"type":"string"},"cashAccounts":{"type":"array","items":{"type":"object","properties":{"identifications":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["bic","sortCode","iban","bban","accountNumber","pan","email","msisdn","virtualAccountId","globalWallet","clabe","bitcoinAddress","bitcoinXpub","other"],"description":"Kind of identifier of a bank account or of its bank.","x-enumDescriptions":{"bic":"Bank Identifier Code of the bank.","sortCode":"Six-digit code of a bank and branch in the United Kingdom.","iban":"International Bank Account Number.","bban":"Basic Bank Account Number, the country-specific format of an account number.","accountNumber":"Account number that the bank assigns, unique within the bank or the branch.","pan":"Primary Account Number, the number of a credit or debit card.","email":"Email address that identifies the account.","msisdn":"Mobile phone number that identifies the account.","virtualAccountId":"Identifier of a virtual sub-account of a main account.","globalWallet":"Identifier of a digital wallet that holds and pays in several currencies.","clabe":"CLABE, the 18-digit standardized bank code of a Mexican bank account.","bitcoinAddress":"Single Bitcoin address, the only address the account tracks.","bitcoinXpub":"Bitcoin extended public key (xpub, ypub or zpub), from which the addresses of the wallet are derived.","other":"Another kind of identifier."}},"value":{"description":"Value of the identifier, for example the IBAN or the BIC.","type":"string"}},"required":["type","value"]}},"currency":{"type":"string","description":"ISO 4217 currency code","examples":["CHF"]},"bankAddress":{"type":"object","properties":{"country":{"type":"string","description":"ISO 3166-1 alpha-2 country code","examples":["CH"]},"postCode":{"description":"Post code of the address.","type":"string","minLength":2},"townName":{"description":"Name of the town or city.","type":"string","minLength":1},"streetName":{"description":"Name of the street.","type":"string"},"buildingNumber":{"description":"Number of the building in the street.","type":"string"},"name":{"description":"Name of the building or place.","type":"string"},"sortingCode":{"description":"Additional sorting code of the postal service, used in a few countries such as France.","type":"string"},"postBox":{"description":"Post office box.","type":"string"},"administrativeArea":{"description":"Region of the country, such as a canton or a state.","type":"string"},"recipients":{"type":"array","items":{"type":"string"},"description":"Names of the people the address is for."},"organization":{"description":"Name of the organization at the address.","type":"string"},"source":{"type":"array","items":{"type":"string"},"description":"Text the address was read from, one item per line."}},"required":["country"]},"internalId":{"type":"string"},"nickname":{"type":"string","minLength":1},"verification":{"type":"object","properties":{"id":{"type":"string","examples":["3f2c8a1e-6b4d-4e7a-9c15-8d2b7f0e4a61"]},"status":{"type":"string","enum":["verified","pending","rejected"]},"holderName":{"type":"string","minLength":1},"dateTime":{"type":"string","format":"date-time"}},"required":["id","status","holderName","dateTime"]}},"required":["identifications","currency","bankAddress"]}},"bankAccountId":{"anyOf":[{"type":"string"},{"type":"null"}]},"merge":{"type":"boolean"}},"required":["name","phones","emails","contactPersons","cashAccounts","merge"]}}}}}},"/workspaces/{workspaceId}/counterparties/search":{"get":{"operationId":"counterparties-search","summary":"Search counterparties by name or other attributes","tags":["Counterparties"],"security":[{"bearerAuth":["counterparties:read"]}],"x-sway-scope":"counterparties:read","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"fields","in":"query","description":"Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.","schema":{"type":"string"},"example":"firestoreId,workspaceId,creation"},{"name":"query","in":"query","schema":{"type":"string"},"required":true},{"name":"page","in":"query","schema":{"default":0,"type":"integer","minimum":0},"example":0},{"name":"size","in":"query","schema":{"default":20,"type":"integer","minimum":1,"maximum":100},"example":20}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Counterparty"}}},"required":["data"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspaces/{workspaceId}/counterparties/{counterpartyId}":{"patch":{"operationId":"counterparties-update","summary":"Update a counterparty","tags":["Counterparties"],"security":[{"bearerAuth":["counterparties:write"]}],"x-sway-scope":"counterparties:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/CounterpartyId"}],"responses":{"204":{"description":"No content"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"entityType":{"anyOf":[{"type":"string","enum":["individual","organization"],"description":"Kind of entity: an individual or an organization.","x-enumDescriptions":{"individual":"A natural person.","organization":"A company or another organization."}},{"type":"null"}],"description":"Kind of entity: an individual or an organization."},"name":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"phones":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"emails":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"address":{"anyOf":[{"$ref":"#/components/schemas/PostalAddress"},{"type":"null"}]},"contactPersons":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"phone":{"type":"string"},"email":{"type":"string"}},"required":["name"]}},{"type":"null"}]},"taxIdentification":{"anyOf":[{"type":"string"},{"type":"null"}]},"notes":{"anyOf":[{"type":"string"},{"type":"null"}]},"newCashAccounts":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"identifications":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["bic","sortCode","iban","bban","accountNumber","pan","email","msisdn","virtualAccountId","globalWallet","clabe","bitcoinAddress","bitcoinXpub","other"],"description":"Kind of identifier of a bank account or of its bank.","x-enumDescriptions":{"bic":"Bank Identifier Code of the bank.","sortCode":"Six-digit code of a bank and branch in the United Kingdom.","iban":"International Bank Account Number.","bban":"Basic Bank Account Number, the country-specific format of an account number.","accountNumber":"Account number that the bank assigns, unique within the bank or the branch.","pan":"Primary Account Number, the number of a credit or debit card.","email":"Email address that identifies the account.","msisdn":"Mobile phone number that identifies the account.","virtualAccountId":"Identifier of a virtual sub-account of a main account.","globalWallet":"Identifier of a digital wallet that holds and pays in several currencies.","clabe":"CLABE, the 18-digit standardized bank code of a Mexican bank account.","bitcoinAddress":"Single Bitcoin address, the only address the account tracks.","bitcoinXpub":"Bitcoin extended public key (xpub, ypub or zpub), from which the addresses of the wallet are derived.","other":"Another kind of identifier."}},"value":{"description":"Value of the identifier, for example the IBAN or the BIC.","type":"string"}},"required":["type","value"]}},"currency":{"type":"string","description":"ISO 4217 currency code","examples":["CHF"]},"bankAddress":{"type":"object","properties":{"country":{"type":"string","description":"ISO 3166-1 alpha-2 country code","examples":["CH"]},"postCode":{"description":"Post code of the address.","type":"string","minLength":2},"townName":{"description":"Name of the town or city.","type":"string","minLength":1},"streetName":{"description":"Name of the street.","type":"string"},"buildingNumber":{"description":"Number of the building in the street.","type":"string"},"name":{"description":"Name of the building or place.","type":"string"},"sortingCode":{"description":"Additional sorting code of the postal service, used in a few countries such as France.","type":"string"},"postBox":{"description":"Post office box.","type":"string"},"administrativeArea":{"description":"Region of the country, such as a canton or a state.","type":"string"},"recipients":{"type":"array","items":{"type":"string"},"description":"Names of the people the address is for."},"organization":{"description":"Name of the organization at the address.","type":"string"},"source":{"type":"array","items":{"type":"string"},"description":"Text the address was read from, one item per line."}},"required":["country"]},"internalId":{"type":"string"},"nickname":{"type":"string","minLength":1},"verification":{"type":"object","properties":{"id":{"type":"string","examples":["3f2c8a1e-6b4d-4e7a-9c15-8d2b7f0e4a61"]},"status":{"type":"string","enum":["verified","pending","rejected"]},"holderName":{"type":"string","minLength":1},"dateTime":{"type":"string","format":"date-time"}},"required":["id","status","holderName","dateTime"]}},"required":["identifications","currency","bankAddress"]}},{"type":"null"}]},"cashAccountUpdates":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"internalId":{"type":"string"},"bic":{"type":"string"}},"required":["internalId","bic"]}},{"type":"null"}]}}},"examples":{"default":{"summary":"Example request","value":{"entityType":"individual","address":{"country":"CH","postCode":"8001","townName":"Zürich","streetName":"Bahnhofstrasse","buildingNumber":"10","name":"Haus zur Linde","postBox":"Postfach 1234","administrativeArea":"Zürich","recipients":["Anna Meier"],"organization":"Muster AG","source":["Muster AG","Bahnhofstrasse 10","8001 Zürich"]}}}}}}}},"delete":{"operationId":"counterparties-delete","summary":"Delete (soft-delete) a counterparty","tags":["Counterparties"],"security":[{"bearerAuth":["counterparties:write"]}],"x-sway-scope":"counterparties:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/CounterpartyId"}],"responses":{"204":{"description":"No content"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspaces/{workspaceId}/counterparties/{counterpartyId}/restore":{"post":{"operationId":"counterparties-restore","summary":"Restore a previously deleted counterparty","tags":["Counterparties"],"security":[{"bearerAuth":["counterparties:write"]}],"x-sway-scope":"counterparties:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/CounterpartyId"},{"name":"fields","in":"query","description":"Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.","schema":{"type":"string"},"example":"firestoreId,workspaceId,creation"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Counterparty"}},"required":["data"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspaces/{workspaceId}/chart-of-accounts":{"get":{"operationId":"chartOfAccounts-list","summary":"List charts of accounts in the workspace","tags":["Chart of accounts"],"security":[{"bearerAuth":["chart-of-accounts:read"]}],"x-sway-scope":"chart-of-accounts:read","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/StartAfter"},{"name":"fields","in":"query","description":"Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.","schema":{"type":"string"},"example":"firestoreId,workspaceId,validFrom"},{"$ref":"#/components/parameters/Ids"}],"responses":{"200":{"description":"List of items","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","description":"Items of the page, in list order.","items":{"$ref":"#/components/schemas/ChartOfAccount"}},"limit":{"type":"integer","description":"Page size of the request, or the number of requested `ids`."},"nextCursor":{"type":"string","description":"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."}},"required":["data","limit"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"operationId":"chartOfAccounts-create","summary":"Create a chart of accounts","tags":["Chart of accounts"],"security":[{"bearerAuth":["chart-of-accounts:write"]}],"x-sway-scope":"chart-of-accounts:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"fields","in":"query","description":"Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.","schema":{"type":"string"},"example":"firestoreId,workspaceId,validFrom"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ChartOfAccount"}},"required":["data"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string"},"validFrom":{"type":"string"},"validUntil":{"type":"string"},"groups":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"parentId":{"type":"string"}},"required":["id","name"]}},"accounts":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"groupId":{"type":"string"},"taxTypeId":{"type":"string","examples":["Tt9mC5rL2wQz7nVb4kHp"],"description":"ID of the tax type."},"bankAccountId":{"type":"string","examples":["bacc_Q0gzMTA4NzY1NDM"],"description":"ID of the bank account."},"type":{"$ref":"#/components/schemas/AccountType"},"currency":{"type":"string","description":"ISO 4217 currency code","examples":["CHF"]}},"required":["code","name","groupId"]}},"importedFromFile":{"type":"string"}},"required":["title","groups","accounts"]}}}}}},"/workspaces/{workspaceId}/chart-of-accounts/{chartOfAccountId}":{"patch":{"operationId":"chartOfAccounts-update","summary":"Update a chart of accounts","tags":["Chart of accounts"],"security":[{"bearerAuth":["chart-of-accounts:write"]}],"x-sway-scope":"chart-of-accounts:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/ChartOfAccountId"}],"responses":{"204":{"description":"No content"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string"},"validFrom":{"type":"string"},"validUntil":{"type":"string"},"groups":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"parentId":{"type":"string"}},"required":["id","name"]}},"accounts":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"groupId":{"type":"string"},"taxTypeId":{"type":"string","examples":["Tt9mC5rL2wQz7nVb4kHp"],"description":"ID of the tax type."},"bankAccountId":{"type":"string","examples":["bacc_Q0gzMTA4NzY1NDM"],"description":"ID of the bank account."},"type":{"$ref":"#/components/schemas/AccountType"},"currency":{"type":"string","description":"ISO 4217 currency code","examples":["CHF"]}},"required":["code","name","groupId"]}}}}}}}},"delete":{"operationId":"chartOfAccounts-delete","summary":"Delete a chart of accounts","tags":["Chart of accounts"],"security":[{"bearerAuth":["chart-of-accounts:write"]}],"x-sway-scope":"chart-of-accounts:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/ChartOfAccountId"}],"responses":{"204":{"description":"No content"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspaces/{workspaceId}/chart-of-accounts/{chartOfAccountId}/accounts":{"post":{"operationId":"chartOfAccounts-accounts-create","summary":"Create an account inside a chart of accounts","tags":["Chart of accounts"],"security":[{"bearerAuth":["chart-of-accounts:write"]}],"x-sway-scope":"chart-of-accounts:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/ChartOfAccountId"}],"responses":{"204":{"description":"No content"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"accountCode":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"groupId":{"type":"string"},"taxTypeId":{"type":"string","examples":["Tt9mC5rL2wQz7nVb4kHp"],"description":"ID of the tax type."},"bankAccountId":{"type":"string","examples":["bacc_Q0gzMTA4NzY1NDM"],"description":"ID of the bank account."},"type":{"$ref":"#/components/schemas/AccountType"},"currency":{"type":"string","description":"ISO 4217 currency code","examples":["CHF"]}},"required":["accountCode","name","groupId"]}}}}}},"/workspaces/{workspaceId}/chart-of-accounts/{chartOfAccountId}/accounts/{accountId}":{"patch":{"operationId":"chartOfAccounts-accounts-update","summary":"Update an account inside a chart of accounts","tags":["Chart of accounts"],"security":[{"bearerAuth":["chart-of-accounts:write"]}],"x-sway-scope":"chart-of-accounts:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/ChartOfAccountId"},{"$ref":"#/components/parameters/AccountId"}],"responses":{"204":{"description":"No content"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"newAccountCode":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"groupId":{"type":"string"},"taxTypeId":{"anyOf":[{"type":"string","examples":["Tt9mC5rL2wQz7nVb4kHp"],"description":"ID of the tax type."},{"type":"null"}],"description":"ID of the tax type."},"bankAccountId":{"anyOf":[{"type":"string","examples":["bacc_Q0gzMTA4NzY1NDM"],"description":"ID of the bank account."},{"type":"null"}],"description":"ID of the bank account."},"type":{"anyOf":[{"$ref":"#/components/schemas/AccountType"},{"type":"null"}]},"currency":{"anyOf":[{"type":"string","description":"ISO 4217 currency code","examples":["CHF"]},{"type":"null"}],"description":"ISO 4217 currency code"}}},"examples":{"default":{"summary":"Example request","value":{"taxTypeId":"Tt9mC5rL2wQz7nVb4kHp","bankAccountId":"bacc_Q0gzMTA4NzY1NDM","type":"BANK","currency":"CHF"}}}}}}},"delete":{"operationId":"chartOfAccounts-accounts-delete","summary":"Delete an account from a chart of accounts","tags":["Chart of accounts"],"security":[{"bearerAuth":["chart-of-accounts:write"]}],"x-sway-scope":"chart-of-accounts:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/ChartOfAccountId"},{"$ref":"#/components/parameters/AccountId"}],"responses":{"204":{"description":"No content"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspaces/{workspaceId}/chart-of-accounts/{chartOfAccountId}/groups":{"post":{"operationId":"chartOfAccounts-groups-create","summary":"Create an account group inside a chart of accounts","tags":["Chart of accounts"],"security":[{"bearerAuth":["chart-of-accounts:write"]}],"x-sway-scope":"chart-of-accounts:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/ChartOfAccountId"}],"responses":{"204":{"description":"No content"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"groupId":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"parentId":{"type":"string"}},"required":["groupId","name"]}}}}}},"/workspaces/{workspaceId}/chart-of-accounts/{chartOfAccountId}/groups/{groupId}":{"patch":{"operationId":"chartOfAccounts-groups-update","summary":"Update an account group inside a chart of accounts","tags":["Chart of accounts"],"security":[{"bearerAuth":["chart-of-accounts:write"]}],"x-sway-scope":"chart-of-accounts:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/ChartOfAccountId"},{"$ref":"#/components/parameters/GroupId"}],"responses":{"204":{"description":"No content"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"newGroupId":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"parentId":{"anyOf":[{"type":"string"},{"type":"null"}]}}}}}}},"delete":{"operationId":"chartOfAccounts-groups-delete","summary":"Delete an account group from a chart of accounts","tags":["Chart of accounts"],"security":[{"bearerAuth":["chart-of-accounts:write"]}],"x-sway-scope":"chart-of-accounts:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/ChartOfAccountId"},{"$ref":"#/components/parameters/GroupId"}],"responses":{"204":{"description":"No content"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspaces/{workspaceId}/chart-of-accounts/export":{"post":{"operationId":"chartOfAccounts-export","summary":"Export a chart of accounts to a downloadable file","tags":["Chart of accounts"],"security":[{"bearerAuth":["chart-of-accounts:write"]}],"x-sway-scope":"chart-of-accounts:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"fields","in":"query","description":"Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.","schema":{"type":"string"},"example":"success,fromDate,toDate"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ExportedFile"}}},"required":["data"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspaces/{workspaceId}/tax-types":{"get":{"operationId":"taxTypes-list","summary":"List tax types in the workspace","tags":["Tax types"],"security":[{"bearerAuth":["tax-types:read"]}],"x-sway-scope":"tax-types:read","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/StartAfter"},{"name":"fields","in":"query","description":"Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.","schema":{"type":"string"},"example":"firestoreId,workspaceId,name"},{"$ref":"#/components/parameters/Ids"}],"responses":{"200":{"description":"List of items","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","description":"Items of the page, in list order.","items":{"$ref":"#/components/schemas/TaxType"}},"limit":{"type":"integer","description":"Page size of the request, or the number of requested `ids`."},"nextCursor":{"type":"string","description":"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."}},"required":["data","limit"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"operationId":"taxTypes-create","summary":"Create a tax type","tags":["Tax types"],"security":[{"bearerAuth":["tax-types:write"]}],"x-sway-scope":"tax-types:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"fields","in":"query","description":"Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.","schema":{"type":"string"},"example":"firestoreId,workspaceId,name"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/TaxType"}},"required":["data"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"rate":{"type":"number"},"externalId":{"type":"string","minLength":1},"code":{"type":"string"},"ledgerAccount":{"type":"string"},"milliRoundingFactor":{"type":"number"}},"required":["name","rate","externalId"]}}}}}},"/workspaces/{workspaceId}/tax-types/{taxTypeId}":{"patch":{"operationId":"taxTypes-update","summary":"Update a tax type","tags":["Tax types"],"security":[{"bearerAuth":["tax-types:write"]}],"x-sway-scope":"tax-types:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/TaxTypeId"}],"responses":{"204":{"description":"No content"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"rate":{"type":"number"},"externalId":{"type":"string","minLength":1},"code":{"anyOf":[{"type":"string"},{"type":"null"}]},"ledgerAccount":{"anyOf":[{"type":"string"},{"type":"null"}]},"milliRoundingFactor":{"anyOf":[{"type":"number"},{"type":"null"}]}}}}}}},"delete":{"operationId":"taxTypes-delete","summary":"Delete a tax type","tags":["Tax types"],"security":[{"bearerAuth":["tax-types:write"]}],"x-sway-scope":"tax-types:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/TaxTypeId"}],"responses":{"204":{"description":"No content"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspaces/{workspaceId}/products":{"get":{"operationId":"products-list","summary":"List products in the workspace catalog","tags":["Products"],"security":[{"bearerAuth":["products:read"]}],"x-sway-scope":"products:read","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/StartAfter"},{"name":"fields","in":"query","description":"Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.","schema":{"type":"string"},"example":"firestoreId,workspaceId,creation"},{"$ref":"#/components/parameters/Ids"},{"name":"activation.enabled","in":"query","schema":{"type":"boolean","description":"Whether the resource is enabled.","examples":[true]},"description":"Whether the resource is enabled.","example":true}],"responses":{"200":{"description":"List of items","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","description":"Items of the page, in list order.","items":{"$ref":"#/components/schemas/Product"}},"limit":{"type":"integer","description":"Page size of the request, or the number of requested `ids`."},"nextCursor":{"type":"string","description":"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."}},"required":["data","limit"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"operationId":"products-create","summary":"Create a product","tags":["Products"],"security":[{"bearerAuth":["products:write"]}],"x-sway-scope":"products:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"fields","in":"query","description":"Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.","schema":{"type":"string"},"example":"firestoreId,workspaceId,creation"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Product"}},"required":["data"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","minLength":1,"maxLength":50},"name":{"type":"object","properties":{"default":{"type":"string","minLength":1,"maxLength":100,"description":"Text in the default language."}},"required":["default"]},"unit":{"type":"object","properties":{"default":{"type":"string","minLength":1,"maxLength":20,"description":"Text in the default language."}},"required":["default"]},"purchaseName":{"type":"object","properties":{"default":{"type":"string","minLength":1,"maxLength":100,"description":"Text in the default language."}},"required":["default"]},"purchaseCurrency":{"type":"string","description":"ISO 4217 currency code","examples":["CHF"]},"purchaseMilliAmount":{"type":"number","minimum":0},"purchaseDescription":{"type":"object","properties":{"default":{"type":"string","minLength":1,"maxLength":500,"description":"Text in the default language."}},"required":["default"]},"purchaseAccount":{"type":"string","minLength":1,"maxLength":50,"description":"Code of an account in the chart of accounts.","examples":["1020"]},"purchaseTaxTypeId":{"type":"string","examples":["Tt9mC5rL2wQz7nVb4kHp"],"description":"ID of the tax type."},"saleName":{"type":"object","properties":{"default":{"type":"string","minLength":1,"maxLength":100,"description":"Text in the default language."}},"required":["default"]},"saleCurrency":{"type":"string","description":"ISO 4217 currency code","examples":["CHF"]},"saleMilliAmount":{"type":"number","minimum":0},"saleDescription":{"type":"object","properties":{"default":{"type":"string","minLength":1,"maxLength":500,"description":"Text in the default language."}},"required":["default"]},"saleAccount":{"type":"string","minLength":1,"maxLength":50,"description":"Code of an account in the chart of accounts.","examples":["1020"]},"saleTaxTypeId":{"type":"string","examples":["Tt9mC5rL2wQz7nVb4kHp"],"description":"ID of the tax type."},"supplierReferences":{"default":[],"type":"array","items":{"type":"object","properties":{"counterpartyId":{"type":"string","examples":["Cp2nG7vB4xLq9wRt5hMz"],"description":"ID of the counterparty."},"code":{"type":"string","minLength":1,"maxLength":50},"name":{"type":"string","minLength":1,"maxLength":100}}}},"tags":{"default":[],"type":"array","items":{"type":"string","minLength":1,"maxLength":50}}},"required":["code","name"]}}}}}},"/workspaces/{workspaceId}/products/{productId}":{"patch":{"operationId":"products-update","summary":"Update a product","tags":["Products"],"security":[{"bearerAuth":["products:write"]}],"x-sway-scope":"products:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/ProductId"}],"responses":{"204":{"description":"No content"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","minLength":1,"maxLength":50},"name":{"type":"object","properties":{"default":{"type":"string","minLength":1,"maxLength":100,"description":"Text in the default language."}},"required":["default"]},"unit":{"anyOf":[{"type":"object","properties":{"default":{"type":"string","minLength":1,"maxLength":20,"description":"Text in the default language."}},"required":["default"]},{"type":"null"}]},"purchaseName":{"anyOf":[{"type":"object","properties":{"default":{"type":"string","minLength":1,"maxLength":100,"description":"Text in the default language."}},"required":["default"]},{"type":"null"}]},"purchaseCurrency":{"anyOf":[{"type":"string","description":"ISO 4217 currency code","examples":["CHF"]},{"type":"null"}],"description":"ISO 4217 currency code"},"purchaseMilliAmount":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}]},"purchaseDescription":{"anyOf":[{"type":"object","properties":{"default":{"type":"string","minLength":1,"maxLength":500,"description":"Text in the default language."}},"required":["default"]},{"type":"null"}]},"purchaseAccount":{"anyOf":[{"type":"string","minLength":1,"maxLength":50,"description":"Code of an account in the chart of accounts.","examples":["1020"]},{"type":"null"}],"description":"Code of an account in the chart of accounts."},"purchaseTaxTypeId":{"anyOf":[{"type":"string","examples":["Tt9mC5rL2wQz7nVb4kHp"],"description":"ID of the tax type."},{"type":"null"}],"description":"ID of the tax type."},"saleName":{"anyOf":[{"type":"object","properties":{"default":{"type":"string","minLength":1,"maxLength":100,"description":"Text in the default language."}},"required":["default"]},{"type":"null"}]},"saleCurrency":{"anyOf":[{"type":"string","description":"ISO 4217 currency code","examples":["CHF"]},{"type":"null"}],"description":"ISO 4217 currency code"},"saleMilliAmount":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}]},"saleDescription":{"anyOf":[{"type":"object","properties":{"default":{"type":"string","minLength":1,"maxLength":500,"description":"Text in the default language."}},"required":["default"]},{"type":"null"}]},"saleAccount":{"anyOf":[{"type":"string","minLength":1,"maxLength":50,"description":"Code of an account in the chart of accounts.","examples":["1020"]},{"type":"null"}],"description":"Code of an account in the chart of accounts."},"saleTaxTypeId":{"anyOf":[{"type":"string","examples":["Tt9mC5rL2wQz7nVb4kHp"],"description":"ID of the tax type."},{"type":"null"}],"description":"ID of the tax type."},"supplierReferences":{"type":"array","items":{"type":"object","properties":{"counterpartyId":{"type":"string","examples":["Cp2nG7vB4xLq9wRt5hMz"],"description":"ID of the counterparty."},"code":{"type":"string","minLength":1,"maxLength":50},"name":{"type":"string","minLength":1,"maxLength":100}}}},"tags":{"type":"array","items":{"type":"string","minLength":1,"maxLength":50}}}},"examples":{"default":{"summary":"Example request","value":{"purchaseCurrency":"CHF","purchaseAccount":"1020","purchaseTaxTypeId":"Tt9mC5rL2wQz7nVb4kHp","saleCurrency":"CHF","saleAccount":"1020","saleTaxTypeId":"Tt9mC5rL2wQz7nVb4kHp","supplierReferences":[{"counterpartyId":"Cp2nG7vB4xLq9wRt5hMz"}]}}}}}}},"delete":{"operationId":"products-delete","summary":"Soft-delete (archive) a product","tags":["Products"],"security":[{"bearerAuth":["products:write"]}],"x-sway-scope":"products:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/ProductId"}],"responses":{"204":{"description":"No content"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspaces/{workspaceId}/products/{productId}/restore":{"post":{"operationId":"products-restore","summary":"Restore a previously deleted product","tags":["Products"],"security":[{"bearerAuth":["products:write"]}],"x-sway-scope":"products:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/ProductId"}],"responses":{"204":{"description":"No content"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspaces/{workspaceId}/account-coding-rules":{"get":{"operationId":"accountCodingRules-list","summary":"List account coding rules in the workspace","tags":["Account coding rules"],"security":[{"bearerAuth":["account-coding-rules:read"]}],"x-sway-scope":"account-coding-rules:read","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/StartAfter"},{"name":"fields","in":"query","description":"Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.","schema":{"type":"string"},"example":"firestoreId,workspaceId,name"},{"$ref":"#/components/parameters/Ids"}],"responses":{"200":{"description":"List of items","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","description":"Items of the page, in list order.","items":{"$ref":"#/components/schemas/AccountCodingRule"}},"limit":{"type":"integer","description":"Page size of the request, or the number of requested `ids`."},"nextCursor":{"type":"string","description":"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."}},"required":["data","limit"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"operationId":"accountCodingRules-create","summary":"Create a new account coding rule","tags":["Account coding rules"],"security":[{"bearerAuth":["account-coding-rules:write"]}],"x-sway-scope":"account-coding-rules:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"fields","in":"query","description":"Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.","schema":{"type":"string"},"example":"firestoreId,workspaceId,name"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AccountCodingRule"}},"required":["data"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"description":{"type":"string","maxLength":500},"bankAccountId":{"type":"string","examples":["bacc_Q0gzMTA4NzY1NDM"],"description":"ID of the bank account."},"conditionsOperator":{"type":"string","enum":["AND","OR"]},"conditions":{"minItems":1,"type":"array","items":{"oneOf":[{"type":"object","properties":{"field":{"type":"string","const":"TEXT"},"operator":{"type":"string","enum":["CONTAINS","NOT_CONTAINS"]},"value":{"type":"string"}},"required":["field","operator","value"]},{"type":"object","properties":{"field":{"type":"string","const":"MILLI_AMOUNT"},"operator":{"type":"string","enum":["LT","GT","LTE","GTE","EQ","NEQ"]},"value":{"type":"number"}},"required":["field","operator","value"]},{"type":"object","properties":{"field":{"type":"string","const":"CURRENCY"},"operator":{"type":"string","enum":["EQ","NEQ"]},"value":{"type":"string","description":"ISO 4217 currency code","examples":["CHF"]}},"required":["field","operator","value"]}]}},"actions":{"minItems":1,"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["ASSIGN_ACCOUNT","ASSIGN_TAX_TYPE","SET_ENTRY_DESCRIPTION"]},"value":{"type":"string"}},"required":["type","value"]}},"encodeDaysOfHistoricalData":{"type":"integer","minimum":0,"maximum":730}},"required":["name","conditionsOperator","conditions","actions"]}}}}}},"/workspaces/{workspaceId}/account-coding-rules/{ruleId}":{"patch":{"operationId":"accountCodingRules-update","summary":"Update an existing account coding rule","tags":["Account coding rules"],"security":[{"bearerAuth":["account-coding-rules:write"]}],"x-sway-scope":"account-coding-rules:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/RuleId"}],"responses":{"204":{"description":"No content"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"bankAccountId":{"anyOf":[{"type":"string","examples":["bacc_Q0gzMTA4NzY1NDM"],"description":"ID of the bank account."},{"type":"null"}],"description":"ID of the bank account."},"conditionsOperator":{"type":"string","enum":["AND","OR"]},"active":{"type":"boolean"},"encodeDaysOfHistoricalData":{"type":"integer","minimum":0,"maximum":730}}},"examples":{"default":{"summary":"Example request","value":{"bankAccountId":"bacc_Q0gzMTA4NzY1NDM","conditionsOperator":"AND"}}}}}}},"delete":{"operationId":"accountCodingRules-delete","summary":"Delete an account coding rule","tags":["Account coding rules"],"security":[{"bearerAuth":["account-coding-rules:write"]}],"x-sway-scope":"account-coding-rules:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/RuleId"}],"responses":{"204":{"description":"No content"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspaces/{workspaceId}/account-coding-rules/reorder":{"post":{"operationId":"accountCodingRules-reorder","summary":"Reorder account coding rules to change their evaluation priority","tags":["Account coding rules"],"security":[{"bearerAuth":["account-coding-rules:write"]}],"x-sway-scope":"account-coding-rules:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"responses":{"204":{"description":"No content"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ruleId":{"type":"string","examples":["Ru7bX2kQ9mWp4tLz6nHc"],"description":"ID of the account coding rule."},"newOrder":{"type":"integer","minimum":0}},"required":["ruleId","newOrder"]}}}}}},"/workspaces/{workspaceId}/account-coding-rules/{ruleId}/conditions":{"post":{"operationId":"accountCodingRules-conditions-add","summary":"Add a condition to an account coding rule","tags":["Account coding rules"],"security":[{"bearerAuth":["account-coding-rules:write"]}],"x-sway-scope":"account-coding-rules:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/RuleId"}],"responses":{"204":{"description":"No content"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"condition":{"oneOf":[{"type":"object","properties":{"field":{"type":"string","const":"TEXT"},"operator":{"type":"string","enum":["CONTAINS","NOT_CONTAINS"]},"value":{"type":"string"}},"required":["field","operator","value"]},{"type":"object","properties":{"field":{"type":"string","const":"MILLI_AMOUNT"},"operator":{"type":"string","enum":["LT","GT","LTE","GTE","EQ","NEQ"]},"value":{"type":"number"}},"required":["field","operator","value"]},{"type":"object","properties":{"field":{"type":"string","const":"CURRENCY"},"operator":{"type":"string","enum":["EQ","NEQ"]},"value":{"type":"string","description":"ISO 4217 currency code","examples":["CHF"]}},"required":["field","operator","value"]}]}},"required":["condition"]}}}}}},"/workspaces/{workspaceId}/account-coding-rules/{ruleId}/conditions/{conditionId}":{"delete":{"operationId":"accountCodingRules-conditions-delete","summary":"Delete a condition from an account coding rule","tags":["Account coding rules"],"security":[{"bearerAuth":["account-coding-rules:write"]}],"x-sway-scope":"account-coding-rules:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/RuleId"},{"$ref":"#/components/parameters/ConditionId"}],"responses":{"204":{"description":"No content"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"patch":{"operationId":"accountCodingRules-conditions-edit","summary":"Edit a condition on an account coding rule","tags":["Account coding rules"],"security":[{"bearerAuth":["account-coding-rules:write"]}],"x-sway-scope":"account-coding-rules:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/RuleId"},{"$ref":"#/components/parameters/ConditionId"}],"responses":{"204":{"description":"No content"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"condition":{"oneOf":[{"type":"object","properties":{"field":{"type":"string","const":"TEXT"},"operator":{"type":"string","enum":["CONTAINS","NOT_CONTAINS"]},"value":{"type":"string"}},"required":["field","operator","value"]},{"type":"object","properties":{"field":{"type":"string","const":"MILLI_AMOUNT"},"operator":{"type":"string","enum":["LT","GT","LTE","GTE","EQ","NEQ"]},"value":{"type":"number"}},"required":["field","operator","value"]},{"type":"object","properties":{"field":{"type":"string","const":"CURRENCY"},"operator":{"type":"string","enum":["EQ","NEQ"]},"value":{"type":"string","description":"ISO 4217 currency code","examples":["CHF"]}},"required":["field","operator","value"]}]}},"required":["condition"]}}}}}},"/workspaces/{workspaceId}/account-coding-rules/{ruleId}/actions":{"post":{"operationId":"accountCodingRules-actions-add","summary":"Add an action to an account coding rule","tags":["Account coding rules"],"security":[{"bearerAuth":["account-coding-rules:write"]}],"x-sway-scope":"account-coding-rules:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/RuleId"}],"responses":{"204":{"description":"No content"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"action":{"type":"object","properties":{"type":{"type":"string","enum":["ASSIGN_ACCOUNT","ASSIGN_TAX_TYPE","SET_ENTRY_DESCRIPTION"]},"value":{"type":"string"}},"required":["type","value"]}},"required":["action"]}}}}}},"/workspaces/{workspaceId}/account-coding-rules/{ruleId}/actions/{actionId}":{"delete":{"operationId":"accountCodingRules-actions-delete","summary":"Delete an action from an account coding rule","tags":["Account coding rules"],"security":[{"bearerAuth":["account-coding-rules:write"]}],"x-sway-scope":"account-coding-rules:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/RuleId"},{"$ref":"#/components/parameters/ActionId"}],"responses":{"204":{"description":"No content"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"patch":{"operationId":"accountCodingRules-actions-edit","summary":"Edit an action on an account coding rule","tags":["Account coding rules"],"security":[{"bearerAuth":["account-coding-rules:write"]}],"x-sway-scope":"account-coding-rules:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/RuleId"},{"$ref":"#/components/parameters/ActionId"}],"responses":{"204":{"description":"No content"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"action":{"type":"object","properties":{"type":{"type":"string","enum":["ASSIGN_ACCOUNT","ASSIGN_TAX_TYPE","SET_ENTRY_DESCRIPTION"]},"value":{"type":"string"}},"required":["type","value"]}},"required":["action"]}}}}}},"/workspaces/{workspaceId}/files":{"get":{"operationId":"workspaceFiles-list","summary":"List files attached to the workspace","tags":["Workspace files"],"security":[{"bearerAuth":["workspace-files:read"]}],"x-sway-scope":"workspace-files:read","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/StartAfter"},{"name":"fields","in":"query","description":"Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.","schema":{"type":"string"},"example":"firestoreId,creation,workspaceId"},{"$ref":"#/components/parameters/Ids"}],"responses":{"200":{"description":"List of items","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","description":"Items of the page, in list order.","items":{"$ref":"#/components/schemas/WorkspaceFile"}},"limit":{"type":"integer","description":"Page size of the request, or the number of requested `ids`."},"nextCursor":{"type":"string","description":"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."}},"required":["data","limit"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspaces/{workspaceId}/files/search":{"get":{"operationId":"workspaceFiles-search","summary":"Search workspace files by attributes","tags":["Workspace files"],"security":[{"bearerAuth":["workspace-files:read"]}],"x-sway-scope":"workspace-files:read","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"fields","in":"query","description":"Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.","schema":{"type":"string"},"example":"firestoreId,creation,workspaceId"},{"name":"query","in":"query","schema":{"type":"string"},"required":true},{"name":"page","in":"query","schema":{"default":0,"type":"integer","minimum":0},"example":0},{"name":"size","in":"query","schema":{"default":20,"type":"integer","minimum":1,"maximum":100},"example":20}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WorkspaceFile"}}},"required":["data"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspaces/{workspaceId}/files/move":{"post":{"operationId":"workspaceFiles-move","summary":"Move a workspace file to a different folder or location","tags":["Workspace files"],"security":[{"bearerAuth":["workspace-files:write"]}],"x-sway-scope":"workspace-files:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"responses":{"204":{"description":"No content"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"oldPath":{"type":"string","minLength":1},"newPath":{"type":"string","minLength":1}},"required":["oldPath","newPath"]}}}}}},"/workspaces/{workspaceId}/files/{fileId}/download":{"get":{"operationId":"workspaceFiles-download","summary":"Generate a time-limited download URL for a workspace file","tags":["Workspace files"],"security":[{"bearerAuth":["workspace-files:read"]}],"x-sway-scope":"workspace-files:read","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/FileId"},{"name":"fields","in":"query","description":"Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.","schema":{"type":"string"},"example":"downloadUrl,expiresAt"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/FileDownloadUrl"}},"required":["data"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspaces/{workspaceId}/invoices":{"get":{"operationId":"invoices-list","summary":"List invoices in the workspace","tags":["Invoices"],"security":[{"bearerAuth":["invoices:read"]}],"x-sway-scope":"invoices:read","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/StartAfter"},{"name":"fields","in":"query","description":"Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.","schema":{"type":"string"},"example":"firestoreId,workspaceId,creation"},{"$ref":"#/components/parameters/Ids"}],"responses":{"200":{"description":"List of items","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","description":"Items of the page, in list order.","items":{"$ref":"#/components/schemas/Invoice"}},"limit":{"type":"integer","description":"Page size of the request, or the number of requested `ids`."},"nextCursor":{"type":"string","description":"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."}},"required":["data","limit"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspaces/{workspaceId}/invoices/search":{"get":{"operationId":"invoices-search","summary":"Search invoices by attributes","tags":["Invoices"],"security":[{"bearerAuth":["invoices:read"]}],"x-sway-scope":"invoices:read","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"fields","in":"query","description":"Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.","schema":{"type":"string"},"example":"firestoreId,workspaceId,creation"},{"name":"query","in":"query","schema":{"type":"string"},"required":true},{"name":"accountingType","in":"query","schema":{"type":"string","enum":["payable","receivable"],"description":"Direction of the invoice: a supplier bill to pay or a sales invoice to collect.","x-enumDescriptions":{"payable":"A bill received from a supplier, which the workspace pays.","receivable":"An invoice issued to a customer, which the workspace collects."}},"description":"Direction of the invoice: a supplier bill to pay or a sales invoice to collect.","example":"payable"},{"name":"statuses","in":"query","schema":{"maxItems":6,"type":"array","items":{"type":"string","enum":["drafted","created","deleted","authorised","paid","voided"],"description":"Status of the invoice in its lifecycle.","x-enumDescriptions":{"drafted":"Draft that may lack mandatory fields; an uploaded invoice starts here and moves to `created` once its data passes validation.","created":"Validated invoice, whose mandatory fields are all present and valid.","deleted":"Deleted invoice, which can no longer change status and is left out of transaction matching.","authorised":"Validated invoice that a user approved.","paid":"Validated invoice settled in full by matched bank transactions or marked as paid by a user; its mandatory fields can no longer change.","voided":"Cancelled invoice, left out of transaction matching."}}},"style":"form","explode":false,"example":["drafted"]},{"name":"page","in":"query","schema":{"default":0,"type":"integer","minimum":0},"example":0},{"name":"size","in":"query","schema":{"default":20,"type":"integer","minimum":1,"maximum":100},"example":20}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Invoice"}}},"required":["data"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspaces/{workspaceId}/invoices/upload":{"post":{"operationId":"invoices-upload","summary":"Get an upload URL for a sales invoice or a bill document","description":"The document is a PDF or an image. The characters `<>:\"/\\|?*#^` are removed from `fileName`, and a name left empty is rejected. PUT the file bytes to `uploadUrl` with the returned `contentType`. Once uploaded, the document is parsed in the background into a new invoice (`receivable`) or bill (`payable`). With `bankAccountId` and `bankTransactionId`, the new invoice is matched with that bank transaction.","tags":["Invoices"],"security":[{"bearerAuth":["invoices:write"]}],"x-sway-scope":"invoices:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"fields","in":"query","description":"Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.","schema":{"type":"string"},"example":"uploadUrl,contentType,size"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/FileUploadUrl"}},"required":["data"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"accountingType":{"type":"string","enum":["payable","receivable"],"description":"Direction of the invoice: a supplier bill to pay or a sales invoice to collect.","x-enumDescriptions":{"payable":"A bill received from a supplier, which the workspace pays.","receivable":"An invoice issued to a customer, which the workspace collects."}},"fileName":{"type":"string","minLength":1},"contentType":{"type":"string","minLength":1},"size":{"type":"integer","exclusiveMinimum":0},"bankAccountId":{"type":"string","examples":["bacc_Q0gzMTA4NzY1NDM"],"description":"ID of the bank account."},"bankTransactionId":{"type":"string","examples":["trx_MjAyNjAzMDJUMDk"],"description":"ID of the bank transaction."}},"required":["accountingType","fileName","contentType","size"]}}}}}},"/workspaces/{workspaceId}/invoices/upload-split":{"post":{"operationId":"invoices-uploadSplit","summary":"Get an upload URL for a document holding several sales invoices or bills","description":"The document is a PDF or an image. The characters `<>:\"/\\|?*#^` are removed from `fileName`, and a name left empty is rejected. PUT the file bytes to `uploadUrl` with the returned `contentType`. Once uploaded, the document is split in the background into one document per invoice or receipt. Each invoice is parsed into a new invoice (`receivable`) or bill (`payable`), and each receipt into a new bill.","tags":["Invoices"],"security":[{"bearerAuth":["invoices:write"]}],"x-sway-scope":"invoices:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"fields","in":"query","description":"Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.","schema":{"type":"string"},"example":"uploadUrl,contentType,size"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/FileUploadUrl"}},"required":["data"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"accountingType":{"type":"string","enum":["payable","receivable"],"description":"Direction of the invoice: a supplier bill to pay or a sales invoice to collect.","x-enumDescriptions":{"payable":"A bill received from a supplier, which the workspace pays.","receivable":"An invoice issued to a customer, which the workspace collects."}},"fileName":{"type":"string","minLength":1},"contentType":{"type":"string","minLength":1},"size":{"type":"integer","exclusiveMinimum":0}},"required":["accountingType","fileName","contentType","size"]}}}}}},"/workspaces/{workspaceId}/invoices/{invoiceId}":{"patch":{"operationId":"invoices-update","summary":"Update an invoice","tags":["Invoices"],"security":[{"bearerAuth":["invoices:write"]}],"x-sway-scope":"invoices:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/InvoiceId"},{"name":"fields","in":"query","description":"Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.","schema":{"type":"string"},"example":"firestoreId,workspaceId,creation"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Invoice"}},"required":["data"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"fields":{"type":"object","properties":{"amountDue":{"anyOf":[{"$ref":"#/components/schemas/MonetaryAmount"},{"type":"null"}]},"amountPaidSinceLastInvoice":{"anyOf":[{"$ref":"#/components/schemas/MonetaryAmount"},{"type":"null"}]},"clientId":{"anyOf":[{"type":"string"},{"type":"null"}]},"currency":{"anyOf":[{"type":"string","description":"ISO 4217 currency code","examples":["CHF"]},{"type":"null"}],"description":"ISO 4217 currency code"},"dueDate":{"anyOf":[{"type":"string","examples":["2026-03-02"]},{"type":"null"}]},"footer":{"description":"Text printed at the bottom of the invoice.","anyOf":[{"type":"string","minLength":1,"maxLength":2000},{"type":"null"}]},"header":{"description":"Text printed at the top of the invoice.","anyOf":[{"type":"string","minLength":1,"maxLength":2000},{"type":"null"}]},"invoiceDate":{"anyOf":[{"type":"string","examples":["2026-03-02"]},{"type":"null"}]},"invoiceId":{"anyOf":[{"type":"string"},{"type":"null"}]},"isUnpaidReminder":{"anyOf":[{"type":"number"},{"type":"null"}]},"netAmount":{"anyOf":[{"$ref":"#/components/schemas/MonetaryAmount"},{"type":"null"}]},"paymentTerms":{"anyOf":[{"type":"string"},{"type":"null"}]},"purchaseOrder":{"anyOf":[{"type":"string"},{"type":"null"}]},"receiverAddress":{"anyOf":[{"$ref":"#/components/schemas/AddressField"},{"type":"null"}]},"receiverBankAccount":{"anyOf":[{"$ref":"#/components/schemas/BankAccountField"},{"type":"null"}]},"receiverContactName":{"anyOf":[{"type":"string"},{"type":"null"}]},"receiverEmail":{"anyOf":[{"type":"string"},{"type":"null"}]},"receiverName":{"anyOf":[{"type":"string"},{"type":"null"}]},"receiverPhone":{"anyOf":[{"type":"string"},{"type":"null"}]},"receiverTaxId":{"anyOf":[{"type":"string"},{"type":"null"}]},"remitToAddress":{"anyOf":[{"$ref":"#/components/schemas/AddressField"},{"type":"null"}]},"remitToName":{"anyOf":[{"type":"string"},{"type":"null"}]},"shipToAddress":{"anyOf":[{"$ref":"#/components/schemas/AddressField"},{"type":"null"}]},"shipToName":{"anyOf":[{"type":"string"},{"type":"null"}]},"supplierAddress":{"anyOf":[{"$ref":"#/components/schemas/AddressField"},{"type":"null"}]},"supplierBankAccounts":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/BankAccountField"}},{"type":"null"}]},"supplierContactName":{"anyOf":[{"type":"string"},{"type":"null"}]},"supplierEmail":{"anyOf":[{"type":"string"},{"type":"null"}]},"supplierName":{"anyOf":[{"type":"string"},{"type":"null"}]},"supplierPaymentRef":{"anyOf":[{"type":"string"},{"type":"null"}]},"supplierPhone":{"anyOf":[{"type":"string"},{"type":"null"}]},"supplierTaxId":{"anyOf":[{"type":"string"},{"type":"null"}]},"supplierWebsite":{"anyOf":[{"type":"string"},{"type":"null"}]},"totalAmount":{"anyOf":[{"$ref":"#/components/schemas/MonetaryAmount"},{"type":"null"}]},"totalTaxAmount":{"anyOf":[{"$ref":"#/components/schemas/MonetaryAmount"},{"type":"null"}]},"items":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"amount":{"anyOf":[{"$ref":"#/components/schemas/MonetaryAmount"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"discountAmount":{"anyOf":[{"$ref":"#/components/schemas/MonetaryAmount"},{"type":"null"}]},"discountRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"productCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"productId":{"anyOf":[{"type":"string","examples":["Pr4wJ8tM1xNq6zRb3vKf"],"description":"ID of the product."},{"type":"null"}],"description":"ID of the product."},"quantity":{"anyOf":[{"type":"number"},{"type":"null"}]},"taxAmount":{"anyOf":[{"$ref":"#/components/schemas/MonetaryAmount"},{"type":"null"}]},"taxRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"taxTypeId":{"anyOf":[{"type":"string","examples":["Tt9mC5rL2wQz7nVb4kHp"],"description":"ID of the tax type."},{"type":"null"}],"description":"ID of the tax type."},"unit":{"anyOf":[{"type":"string"},{"type":"null"}]},"unitPrice":{"anyOf":[{"$ref":"#/components/schemas/MonetaryAmount"},{"type":"null"}]}}}},{"type":"null"}]},"taxes":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"netAmountBeforeTax":{"anyOf":[{"$ref":"#/components/schemas/MonetaryAmount"},{"type":"null"}]},"taxAmount":{"anyOf":[{"$ref":"#/components/schemas/MonetaryAmount"},{"type":"null"}]},"taxCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"taxRate":{"anyOf":[{"type":"number"},{"type":"null"}]}}}},{"type":"null"}]},"qrCodeData":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}}}},"required":["fields"]},"examples":{"default":{"summary":"Example request","value":{"fields":{"amountDue":{"amount":1250.5,"currency":"CHF"},"amountPaidSinceLastInvoice":{"amount":1250.5,"currency":"CHF"},"currency":"CHF","dueDate":"2026-03-02","invoiceDate":"2026-03-02","netAmount":{"amount":1250.5,"currency":"CHF"},"receiverAddress":{"country":"CH","postCode":"8001","townName":"Zürich","streetName":"Bahnhofstrasse","buildingNumber":"10","name":"Haus zur Linde","postBox":"Postfach 1234","administrativeArea":"Zürich","recipients":["Anna Meier"],"organization":"Muster AG","source":["Muster AG","Bahnhofstrasse 10","8001 Zürich"]},"receiverBankAccount":{"bankAddress":{"country":"CH","postCode":"8001","townName":"Zürich","streetName":"Bahnhofstrasse","buildingNumber":"10","name":"Haus zur Linde","postBox":"Postfach 1234","administrativeArea":"Zürich","recipients":["Anna Meier"],"organization":"Muster AG","source":["Muster AG","Bahnhofstrasse 10","8001 Zürich"]},"currency":"CHF"},"remitToAddress":{"country":"CH","postCode":"8001","townName":"Zürich","streetName":"Bahnhofstrasse","buildingNumber":"10","name":"Haus zur Linde","postBox":"Postfach 1234","administrativeArea":"Zürich","recipients":["Anna Meier"],"organization":"Muster AG","source":["Muster AG","Bahnhofstrasse 10","8001 Zürich"]},"shipToAddress":{"country":"CH","postCode":"8001","townName":"Zürich","streetName":"Bahnhofstrasse","buildingNumber":"10","name":"Haus zur Linde","postBox":"Postfach 1234","administrativeArea":"Zürich","recipients":["Anna Meier"],"organization":"Muster AG","source":["Muster AG","Bahnhofstrasse 10","8001 Zürich"]},"supplierAddress":{"country":"CH","postCode":"8001","townName":"Zürich","streetName":"Bahnhofstrasse","buildingNumber":"10","name":"Haus zur Linde","postBox":"Postfach 1234","administrativeArea":"Zürich","recipients":["Anna Meier"],"organization":"Muster AG","source":["Muster AG","Bahnhofstrasse 10","8001 Zürich"]},"supplierBankAccounts":[{"bankAddress":{"country":"CH","postCode":"8001","townName":"Zürich","streetName":"Bahnhofstrasse","buildingNumber":"10","name":"Haus zur Linde","postBox":"Postfach 1234","administrativeArea":"Zürich","recipients":["Anna Meier"],"organization":"Muster AG","source":["Muster AG","Bahnhofstrasse 10","8001 Zürich"]},"currency":"CHF"}],"totalAmount":{"amount":1250.5,"currency":"CHF"},"totalTaxAmount":{"amount":1250.5,"currency":"CHF"},"items":[{"amount":{"amount":1250.5,"currency":"CHF"},"discountAmount":{"amount":1250.5,"currency":"CHF"},"productId":"Pr4wJ8tM1xNq6zRb3vKf","taxAmount":{"amount":1250.5,"currency":"CHF"},"taxTypeId":"Tt9mC5rL2wQz7nVb4kHp","unitPrice":{"amount":1250.5,"currency":"CHF"}}],"taxes":[{"netAmountBeforeTax":{"amount":1250.5,"currency":"CHF"},"taxAmount":{"amount":1250.5,"currency":"CHF"}}]}}}}}}}}},"/workspaces/{workspaceId}/invoices/{invoiceId}/update-status":{"post":{"operationId":"invoices-updateStatus","summary":"Update the status of an invoice","tags":["Invoices"],"security":[{"bearerAuth":["invoices:write"]}],"x-sway-scope":"invoices:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/InvoiceId"},{"name":"fields","in":"query","description":"Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.","schema":{"type":"string"},"example":"firestoreId,workspaceId,creation"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Invoice"}},"required":["data"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["drafted","created","deleted","authorised","paid","voided"],"description":"Status of the invoice in its lifecycle.","x-enumDescriptions":{"drafted":"Draft that may lack mandatory fields; an uploaded invoice starts here and moves to `created` once its data passes validation.","created":"Validated invoice, whose mandatory fields are all present and valid.","deleted":"Deleted invoice, which can no longer change status and is left out of transaction matching.","authorised":"Validated invoice that a user approved.","paid":"Validated invoice settled in full by matched bank transactions or marked as paid by a user; its mandatory fields can no longer change.","voided":"Cancelled invoice, left out of transaction matching."}},"processed":{"type":"boolean"},"paymentSubmitted":{"type":"boolean"}}},"examples":{"default":{"summary":"Example request","value":{"status":"drafted"}}}}}}}},"/workspaces/{workspaceId}/invoices/{invoiceId}/update-counterparty":{"post":{"operationId":"invoices-updateCounterparty","summary":"Update the counterparty associated with an invoice","tags":["Invoices"],"security":[{"bearerAuth":["invoices:write"]}],"x-sway-scope":"invoices:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/InvoiceId"},{"name":"fields","in":"query","description":"Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.","schema":{"type":"string"},"example":"firestoreId,workspaceId,creation"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Invoice"}},"required":["data"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"counterpartyId":{"anyOf":[{"type":"string","examples":["Cp2nG7vB4xLq9wRt5hMz"],"description":"ID of the counterparty."},{"type":"null"}],"description":"ID of the counterparty."}},"required":["counterpartyId"]},"examples":{"default":{"summary":"Example request","value":{"counterpartyId":"Cp2nG7vB4xLq9wRt5hMz"}}}}}}}},"/workspaces/{workspaceId}/invoices/{invoiceId}/matches/add":{"post":{"operationId":"invoices-matches-add","summary":"Add a confirmed match between an invoice and a bank transaction","tags":["Invoices"],"security":[{"bearerAuth":["invoices:write"]}],"x-sway-scope":"invoices:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/InvoiceId"}],"responses":{"204":{"description":"No content"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"bankAccountId":{"type":"string","examples":["bacc_Q0gzMTA4NzY1NDM"],"description":"ID of the bank account."},"bankTransactionId":{"type":"string","examples":["trx_MjAyNjAzMDJUMDk"],"description":"ID of the bank transaction."}},"required":["bankAccountId","bankTransactionId"]},"examples":{"default":{"summary":"Example request","value":{"bankAccountId":"bacc_Q0gzMTA4NzY1NDM","bankTransactionId":"trx_MjAyNjAzMDJUMDk"}}}}}}}},"/workspaces/{workspaceId}/invoices/{invoiceId}/matches/confirm":{"post":{"operationId":"invoices-matches-confirm","summary":"Confirm a candidate match between an invoice and a bank transaction","tags":["Invoices"],"security":[{"bearerAuth":["invoices:write"]}],"x-sway-scope":"invoices:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/InvoiceId"},{"name":"fields","in":"query","description":"Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.","schema":{"type":"string"},"example":"target,data"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/InvoiceMatch"}},"required":["data"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"matchReference":{"type":"string"}},"required":["matchReference"]}}}}}},"/workspaces/{workspaceId}/invoices/{invoiceId}/matches/remove":{"post":{"operationId":"invoices-matches-remove","summary":"Remove a confirmed match between an invoice and a bank transaction","tags":["Invoices"],"security":[{"bearerAuth":["invoices:write"]}],"x-sway-scope":"invoices:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/InvoiceId"}],"responses":{"204":{"description":"No content"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"matchReference":{"type":"string"}},"required":["matchReference"]}}}}}},"/workspaces/{workspaceId}/invoices/{invoiceId}/matches/remove-candidate":{"post":{"operationId":"invoices-matches-removeCandidate","summary":"Remove a candidate match suggestion for an invoice","tags":["Invoices"],"security":[{"bearerAuth":["invoices:write"]}],"x-sway-scope":"invoices:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/InvoiceId"}],"responses":{"204":{"description":"No content"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"matchReference":{"type":"string"}},"required":["matchReference"]}}}}}},"/workspaces/{workspaceId}/invoices/export":{"post":{"operationId":"invoices-export","summary":"Export an invoice to a downloadable file","tags":["Invoices"],"security":[{"bearerAuth":["invoices:write"]}],"x-sway-scope":"invoices:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"fields","in":"query","description":"Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.","schema":{"type":"string"},"example":"started,workspaceId,files"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/InvoiceExport"}},"required":["data"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"exportType":{"type":"string","enum":["csv","pain.001"],"description":"Format of the invoice export.","x-enumDescriptions":{"csv":"CSV file of the invoices, with the columns in `fields`.","pain.001":"ISO 20022 pain.001 payment file that pays the invoices from the bank account `bankAccountId`."}},"invoiceIds":{"type":"array","items":{"type":"string","examples":["Iv5zP2nK7wRt3xMq9bLd"],"description":"ID of the invoice."}},"bankAccountId":{"type":"string","examples":["bacc_Q0gzMTA4NzY1NDM"],"description":"ID of the bank account."},"counterpartyCashAccountIds":{"type":"object","propertyNames":{"type":"string","examples":["Iv5zP2nK7wRt3xMq9bLd"],"description":"ID of the invoice."},"additionalProperties":{"type":"string"}},"requestedExecutionDate":{"type":"string","examples":["2026-03-02"]},"requestedExecutionDateMode":{"type":"string","enum":["dueDate","commonDate"]},"localTimeZone":{"type":"string"},"markAsPaymentSubmitted":{"type":"boolean"},"fields":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string","enum":["invoice_id","invoice_date","due_date","net_amount","tax_amount","total_amount","amount_due","currency","status","processing_status","accounting_type","purchase_order","payment_terms","client_id","supplier_name","supplier_address","supplier_contact","supplier_email","supplier_phone","supplier_tax_id","supplier_bank_accounts","receiver_name","receiver_address","receiver_contact","receiver_email","receiver_phone","receiver_tax_id","receiver_bank_account","ship_to_name","ship_to_address","remit_to_name","remit_to_address","payment_reference","line_items","taxes","creation_date","is_unpaid_reminder","reconciled","processed","payment_submitted"]},"name":{"type":"string"},"defaultValue":{"type":"string"},"format":{"type":"string"}},"required":["field"]}}},"required":["exportType","invoiceIds"]},"examples":{"default":{"summary":"Example request","value":{"exportType":"csv","invoiceIds":["Iv5zP2nK7wRt3xMq9bLd"],"bankAccountId":"bacc_Q0gzMTA4NzY1NDM","requestedExecutionDate":"2026-03-02","requestedExecutionDateMode":"dueDate","fields":[{"field":"invoice_id"}]}}}}}}}},"/workspaces/{workspaceId}/ledger-entries":{"get":{"operationId":"ledgerEntries-list","summary":"List ledger entries in the workspace","tags":["Ledger entries"],"security":[{"bearerAuth":["ledger-entries:read"]}],"x-sway-scope":"ledger-entries:read","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/StartAfter"},{"name":"fields","in":"query","description":"Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.","schema":{"type":"string"},"example":"firestoreId,workspaceId,milliAmount"},{"$ref":"#/components/parameters/Ids"}],"responses":{"200":{"description":"List of items","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","description":"Items of the page, in list order.","items":{"$ref":"#/components/schemas/LedgerEntry"}},"limit":{"type":"integer","description":"Page size of the request, or the number of requested `ids`."},"nextCursor":{"type":"string","description":"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."}},"required":["data","limit"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspaces/{workspaceId}/ledger-entries/encode-bank-transaction":{"post":{"operationId":"ledgerEntries-encodeBankTransaction","summary":"Apply a set of cash-coding operations to a bank transaction","description":"Created ledger entries are appended after the existing ones, in the order they are listed.","tags":["Ledger entries"],"security":[{"bearerAuth":["ledger-entries:write"]}],"x-sway-scope":"ledger-entries:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"fields","in":"query","description":"Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.","schema":{"type":"string"},"example":"entries,accountingStatus"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CashCodingResult"}},"required":["data"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"bankAccountId":{"type":"string","examples":["bacc_Q0gzMTA4NzY1NDM"],"description":"ID of the bank account."},"bankTransactionId":{"type":"string","examples":["trx_MjAyNjAzMDJUMDk"],"description":"ID of the bank transaction."},"operations":{"minItems":1,"maxItems":100,"type":"array","items":{"oneOf":[{"type":"object","properties":{"description":{"type":"string"},"taxRate":{"type":"number"},"taxMilliAmount":{"type":"number","minimum":0},"taxCode":{"type":"string"},"taxId":{"type":"string"},"taxAccount":{"type":"string"},"signedMilliAmount":{"type":"number"},"account":{"type":"string"},"type":{"type":"string","const":"create"}},"required":["signedMilliAmount","type"]},{"type":"object","properties":{"ledgerEntryId":{"type":"string","examples":["Le3wN8qT5xKr1mZv7pBd"],"description":"ID of the ledger entry."},"signedMilliAmount":{"type":"number"},"account":{"anyOf":[{"type":"string"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"taxRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"taxMilliAmount":{"anyOf":[{"type":"number","minimum":0},{"type":"null"}]},"taxCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"taxId":{"anyOf":[{"type":"string"},{"type":"null"}]},"taxAccount":{"anyOf":[{"type":"string"},{"type":"null"}]},"type":{"type":"string","const":"update"}},"required":["ledgerEntryId","type"]},{"type":"object","properties":{"type":{"type":"string","const":"delete"},"ledgerEntryId":{"type":"string","examples":["Le3wN8qT5xKr1mZv7pBd"],"description":"ID of the ledger entry."}},"required":["type","ledgerEntryId"]}]}},"existingLedgerEntryIds":{"type":"array","items":{"type":"string","examples":["Le3wN8qT5xKr1mZv7pBd"],"description":"ID of the ledger entry."}}},"required":["bankAccountId","bankTransactionId","operations"]}}}}}},"/workspaces/{workspaceId}/ledger-entries/batch-encode-from-transaction-suggestions":{"post":{"operationId":"ledgerEntries-batchEncodeFromTransactionSuggestions","summary":"Code one or more bank transactions from their accounting suggestion","tags":["Ledger entries"],"security":[{"bearerAuth":["ledger-entries:write"]}],"x-sway-scope":"ledger-entries:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"fields","in":"query","description":"Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.","schema":{"type":"string"},"example":"results"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/BatchCodingResult"}},"required":["data"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"bankAccountId":{"type":"string","examples":["bacc_Q0gzMTA4NzY1NDM"],"description":"ID of the bank account."},"bankTransactions":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"bankTransactionId":{"type":"string","examples":["trx_MjAyNjAzMDJUMDk"],"description":"ID of the bank transaction."},"existingLedgerEntryIds":{"type":"array","items":{"type":"string","examples":["Le3wN8qT5xKr1mZv7pBd"],"description":"ID of the ledger entry."}}},"required":["bankTransactionId","existingLedgerEntryIds"]}}},"required":["bankAccountId","bankTransactions"]},"examples":{"default":{"summary":"Example request","value":{"bankAccountId":"bacc_Q0gzMTA4NzY1NDM","bankTransactions":[{"bankTransactionId":"trx_MjAyNjAzMDJUMDk","existingLedgerEntryIds":["Le3wN8qT5xKr1mZv7pBd"]}]}}}}}}}},"/workspaces/{workspaceId}/ledger-entries/export":{"post":{"operationId":"ledgerEntries-export","summary":"Export ledger entries to a downloadable file","tags":["Ledger entries"],"security":[{"bearerAuth":["ledger-entries:write"]}],"x-sway-scope":"ledger-entries:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"fields","in":"query","description":"Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.","schema":{"type":"string"},"example":"started,workspaceId,bankAccountId"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LedgerEntryExport"}},"required":["data"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"bankAccountId":{"type":"string","examples":["bacc_Q0gzMTA4NzY1NDM"],"description":"ID of the bank account."},"fromDate":{"type":"string","examples":["2026-03-02"]},"toDate":{"type":"string","examples":["2026-03-02"]},"bankTransactionIds":{"maxItems":500,"type":"array","items":{"type":"string","examples":["trx_MjAyNjAzMDJUMDk"],"description":"ID of the bank transaction."}},"exportType":{"type":"string","enum":["tsv_cresus","csv_winbiz","tsv_wineur","csv_internal_ledger_entry","csv_internal_general_ledger","xlsx_abacus"],"description":"Format of the ledger entry export.","x-enumDescriptions":{"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."}},"config":{"anyOf":[{"type":"object","properties":{"winbizVatScheme":{"type":"string","enum":["CASH","VAT_NET","NO_VAT","ACCRUAL"]},"winbizSuspenseAccountCode":{"type":"string"}},"required":["winbizVatScheme"]},{"type":"object","properties":{"abacusMandantNumber":{"type":"number"}}}]},"isWorkspaceFile":{"type":"boolean"},"generateHeaders":{"type":"boolean"},"transliterate":{"type":"boolean"}},"required":["bankAccountId","exportType"]},"examples":{"default":{"summary":"Example request","value":{"bankAccountId":"bacc_Q0gzMTA4NzY1NDM","fromDate":"2026-01-01","toDate":"2026-03-31","exportType":"tsv_cresus"}}}}}}}},"/workspaces/{workspaceId}/ledger-entries/pre-export":{"get":{"operationId":"ledgerEntries-preExport","summary":"Run pre-export checks on ledger entries before exporting","tags":["Ledger entries"],"security":[{"bearerAuth":["ledger-entries:read"]}],"x-sway-scope":"ledger-entries:read","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"fields","in":"query","description":"Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.","schema":{"type":"string"},"example":"uncodedBankTransactionIds,uncodedLedgerEntryIdsPerBankTransaction,imbalancedBankTransactionIds"},{"name":"bankAccountId","in":"query","schema":{"type":"string","examples":["bacc_Q0gzMTA4NzY1NDM"],"description":"ID of the bank account."},"description":"ID of the bank account.","required":true,"example":"bacc_Q0gzMTA4NzY1NDM"},{"name":"fromDate","in":"query","schema":{"type":"string","examples":["2026-03-02"]},"example":"2026-03-02"},{"name":"toDate","in":"query","schema":{"type":"string","examples":["2026-03-02"]},"example":"2026-03-02"},{"name":"bankTransactionIds","in":"query","schema":{"maxItems":500,"type":"array","items":{"type":"string","examples":["trx_MjAyNjAzMDJUMDk"],"description":"ID of the bank transaction."}},"style":"form","explode":false,"example":["trx_MjAyNjAzMDJUMDk"]}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LedgerEntryExportCheck"}},"required":["data"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspaces/{workspaceId}/ledger-entries/reorder":{"post":{"operationId":"ledgerEntries-reorder","summary":"Reorder ledger entries attached to a bank transaction","tags":["Ledger entries"],"security":[{"bearerAuth":["ledger-entries:write"]}],"x-sway-scope":"ledger-entries:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"}],"responses":{"204":{"description":"No content"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ledgerEntryId":{"type":"string","examples":["Le3wN8qT5xKr1mZv7pBd"],"description":"ID of the ledger entry."},"bankTransactionId":{"type":"string","examples":["trx_MjAyNjAzMDJUMDk"],"description":"ID of the bank transaction."},"bankAccountId":{"type":"string","examples":["bacc_Q0gzMTA4NzY1NDM"],"description":"ID of the bank account."},"newOrder":{"type":"integer","minimum":0}},"required":["ledgerEntryId","bankTransactionId","bankAccountId","newOrder"]}}}}}},"/workspaces/{workspaceId}/payments/summarize":{"post":{"operationId":"payments-summarize","summary":"Summarize a payment before creating or initiating it","tags":["Payments"],"security":[{"bearerAuth":["payments:write"]}],"x-sway-scope":"payments:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"fields","in":"query","description":"Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.","schema":{"type":"string"},"example":"workspaceId,type,scope"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PaymentSummary"}},"required":["data"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"bankAccountId":{"type":"string","examples":["bacc_Q0gzMTA4NzY1NDM"],"description":"ID of the bank account."},"executionDate":{"type":"string","examples":["2026-03-02"]},"amount":{"type":"number"},"currency":{"type":"string"},"counterpartyId":{"type":"string","examples":["Cp2nG7vB4xLq9wRt5hMz"],"description":"ID of the counterparty."},"counterpartyCashAccountId":{"type":"string"},"reference":{"type":"string"},"communication":{"type":"string"},"invoiceId":{"type":"string","examples":["Iv5zP2nK7wRt3xMq9bLd"],"description":"ID of the invoice."}},"required":["bankAccountId","executionDate","amount","counterpartyId","counterpartyCashAccountId"]}}}}}},"/workspaces/{workspaceId}/draft-payments":{"get":{"operationId":"draftPayments-list","summary":"List draft payments in the workspace","tags":["Draft payments"],"security":[{"bearerAuth":["draft-payments:read"]}],"x-sway-scope":"draft-payments:read","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/StartAfter"},{"name":"fields","in":"query","description":"Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.","schema":{"type":"string"},"example":"firestoreId,messageId,endToEndIds"},{"$ref":"#/components/parameters/Ids"}],"responses":{"200":{"description":"List of items","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","description":"Items of the page, in list order.","items":{"$ref":"#/components/schemas/DraftPayment"}},"limit":{"type":"integer","description":"Page size of the request, or the number of requested `ids`."},"nextCursor":{"type":"string","description":"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."}},"required":["data","limit"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"operationId":"draftPayments-create","summary":"Create a single draft payment","tags":["Draft payments"],"security":[{"bearerAuth":["draft-payments:write"]}],"x-sway-scope":"draft-payments:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"fields","in":"query","description":"Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.","schema":{"type":"string"},"example":"firestoreId,messageId,endToEndIds"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/DraftPayment"}},"required":["data"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"bankAccountId":{"type":"string","examples":["bacc_Q0gzMTA4NzY1NDM"],"description":"ID of the bank account."},"executionDate":{"type":"string","examples":["2026-03-02"]},"amount":{"type":"number","exclusiveMinimum":0},"currency":{"type":"string","description":"ISO 4217 currency code","examples":["CHF"]},"counterpartyId":{"type":"string","examples":["Cp2nG7vB4xLq9wRt5hMz"],"description":"ID of the counterparty."},"counterpartyCashAccountId":{"type":"string"},"reference":{"type":"string"},"communication":{"type":"string"},"invoiceId":{"type":"string","examples":["Iv5zP2nK7wRt3xMq9bLd"],"description":"ID of the invoice."}},"required":["bankAccountId","executionDate","amount","counterpartyId","counterpartyCashAccountId","communication"]}}}}}},"/workspaces/{workspaceId}/draft-payments/{draftPaymentId}/draft-transfers":{"get":{"operationId":"draftPayments-transfers-list","summary":"List transfers belonging to a draft payment","tags":["Draft payments"],"security":[{"bearerAuth":["draft-payments:read"]}],"x-sway-scope":"draft-payments:read","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/DraftPaymentId"},{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/StartAfter"},{"name":"fields","in":"query","description":"Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.","schema":{"type":"string"},"example":"firestoreId,workspaceId,draftPaymentId"},{"$ref":"#/components/parameters/Ids"}],"responses":{"200":{"description":"List of items","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","description":"Items of the page, in list order.","items":{"$ref":"#/components/schemas/DraftPaymentTransfer"}},"limit":{"type":"integer","description":"Page size of the request, or the number of requested `ids`."},"nextCursor":{"type":"string","description":"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."}},"required":["data","limit"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspaces/{workspaceId}/draft-payments/search":{"get":{"operationId":"draftPayments-search","summary":"Search draft payments by attributes","tags":["Draft payments"],"security":[{"bearerAuth":["draft-payments:read"]}],"x-sway-scope":"draft-payments:read","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"fields","in":"query","description":"Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.","schema":{"type":"string"},"example":"firestoreId,messageId,endToEndIds"},{"name":"query","in":"query","schema":{"type":"string"},"required":true},{"name":"page","in":"query","schema":{"default":0,"type":"integer","minimum":0},"example":0},{"name":"size","in":"query","schema":{"default":20,"type":"integer","minimum":1,"maximum":100},"example":20}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/DraftPayment"}}},"required":["data"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspaces/{workspaceId}/initiated-payments":{"get":{"operationId":"initiatedPayments-list","summary":"List initiated payments in the workspace","tags":["Initiated payments"],"security":[{"bearerAuth":["initiated-payments:read"]}],"x-sway-scope":"initiated-payments:read","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/StartAfter"},{"name":"fields","in":"query","description":"Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.","schema":{"type":"string"},"example":"firestoreId,transferIds,workspaceId"},{"$ref":"#/components/parameters/Ids"}],"responses":{"200":{"description":"List of items","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","description":"Items of the page, in list order.","items":{"$ref":"#/components/schemas/InitiatedPayment"}},"limit":{"type":"integer","description":"Page size of the request, or the number of requested `ids`."},"nextCursor":{"type":"string","description":"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."}},"required":["data","limit"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"operationId":"initiatedPayments-create","summary":"Create and send an initiated payment","tags":["Initiated payments"],"security":[{"bearerAuth":["initiated-payments:write"]}],"x-sway-scope":"initiated-payments:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"fields","in":"query","description":"Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.","schema":{"type":"string"},"example":"firestoreId,transferIds,workspaceId"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/InitiatedPayment"}},"required":["data"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"consentId":{"type":"string","examples":["3f2c8a1e-6b4d-4e7a-9c15-8d2b7f0e4a61"]}},"required":["consentId"]},"examples":{"default":{"summary":"Example request","value":{"consentId":"3f2c8a1e-6b4d-4e7a-9c15-8d2b7f0e4a61"}}}}}}}},"/workspaces/{workspaceId}/initiated-payments/{initiatedPaymentId}/initiated-transfers":{"get":{"operationId":"initiatedPayments-transfers-list","summary":"List transfers belonging to an initiated payment","tags":["Initiated payments"],"security":[{"bearerAuth":["initiated-payments:read"]}],"x-sway-scope":"initiated-payments:read","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"$ref":"#/components/parameters/InitiatedPaymentId"},{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/StartAfter"},{"name":"fields","in":"query","description":"Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.","schema":{"type":"string"},"example":"firestoreId,workspaceId,initiatedPaymentId"},{"$ref":"#/components/parameters/Ids"}],"responses":{"200":{"description":"List of items","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","description":"Items of the page, in list order.","items":{"$ref":"#/components/schemas/InitiatedPaymentTransfer"}},"limit":{"type":"integer","description":"Page size of the request, or the number of requested `ids`."},"nextCursor":{"type":"string","description":"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."}},"required":["data","limit"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/workspaces":{"get":{"operationId":"workspaces-list","summary":"List workspaces accessible to the authenticated user","tags":["Workspaces"],"security":[{"bearerAuth":["workspaces:read"]}],"x-sway-scope":"workspaces:read","parameters":[{"name":"fields","in":"query","description":"Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.","schema":{"type":"string"},"example":"firestoreId,billingAccountId,name"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Workspace"}}},"required":["data"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"500":{"$ref":"#/components/responses/InternalError"}}},"post":{"operationId":"workspaces-create","summary":"Create a new workspace","tags":["Workspaces"],"security":[{"bearerAuth":["workspaces:write"]}],"x-sway-scope":"workspaces:write","parameters":[{"name":"fields","in":"query","description":"Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.","schema":{"type":"string"},"example":"firestoreId,billingAccountId,name"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Workspace"}},"required":["data"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"500":{"$ref":"#/components/responses/InternalError"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"description":"Name of the workspace.","type":"string","minLength":1,"maxLength":300},"foundationDate":{"type":"string","examples":["1990-05-14"]},"size":{"type":"string","enum":["lessFive","fiveToTen","elevenToFifty","fiftyOneToOneHundred","oneHundredToTwoHundredFifty","moreThanTwoHundredFifty"],"description":"Number of employees of the company.","x-enumDescriptions":{"lessFive":"Fewer than 5 employees.","fiveToTen":"5 to 10 employees.","elevenToFifty":"11 to 50 employees.","fiftyOneToOneHundred":"51 to 100 employees.","oneHundredToTwoHundredFifty":"100 to 250 employees.","moreThanTwoHundredFifty":"More than 250 employees."}},"industry":{"type":"string","enum":["agriculturePisciculture","businessServices","chemical","commerce","communication","construction","cultureEntertainment","defense","education","energy","finance","food","forestry","health","hospitalityCatering","insurance","legal","manufacturing","mediaInformation","miningOilGas","personalServices","publicService","realEstate","sportFitness","technology","textileLifeStyle","tourism","transportation","other"],"description":"Industry of the company.","x-enumDescriptions":{"agriculturePisciculture":"Agriculture and fish farming.","businessServices":"Business services.","chemical":"Chemical industry.","commerce":"Commerce.","communication":"Communication.","construction":"Construction.","cultureEntertainment":"Culture and entertainment.","defense":"Defense.","education":"Education.","energy":"Energy.","finance":"Finance.","food":"Food.","forestry":"Forestry.","health":"Health.","hospitalityCatering":"Hospitality and catering.","insurance":"Insurance.","legal":"Legal services.","manufacturing":"Manufacturing.","mediaInformation":"Media and information.","miningOilGas":"Mining, oil and gas.","personalServices":"Personal services.","publicService":"Public service.","realEstate":"Real estate.","sportFitness":"Sport and fitness.","technology":"Technology.","textileLifeStyle":"Textile and lifestyle.","tourism":"Tourism.","transportation":"Transportation.","other":"Another industry."}},"address":{"$ref":"#/components/schemas/PostalAddress"}},"required":["name"]}}}}}},"/workspaces/{workspaceId}":{"patch":{"operationId":"workspaces-update","summary":"Update a workspace","tags":["Workspaces"],"security":[{"bearerAuth":["workspaces:write"]}],"x-sway-scope":"workspaces:write","parameters":[{"$ref":"#/components/parameters/WorkspaceId"},{"name":"fields","in":"query","description":"Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.","schema":{"type":"string"},"example":"firestoreId,billingAccountId,name"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Workspace"}},"required":["data"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"description":"Name of the workspace.","type":"string","minLength":1,"maxLength":300},"vat":{"type":"object","properties":{"scheme":{"type":"string","enum":["cash_basis","accrual_basis","net_tax_rate","flat_tax_rate"]},"identificationNumber":{"type":"string","maxLength":50},"rates":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["standard","reduced","special","fixed"]},"rate":{"type":"number","minimum":0,"maximum":100}},"required":["type","rate"]}}}},"allowedDomainsArrayOperation":{"type":"object","properties":{"operation":{"type":"string","enum":["union","remove"]},"items":{"type":"array","items":{"type":"string","minLength":1,"pattern":"^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\\.)+[a-zA-Z]{2,}$"}}},"required":["operation","items"]},"allowedEmailsArrayOperation":{"type":"object","properties":{"operation":{"type":"string","enum":["union","remove"]},"items":{"type":"array","items":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$","examples":["anna.meier@example.com"]}}},"required":["operation","items"]},"aiBasedAccountCodingEnabled":{"type":"boolean"},"ruleBasedAccountCodingEnabled":{"type":"boolean"},"entityInformation":{"type":"object","properties":{"entityType":{"type":"string","enum":["individual","organization"],"description":"Kind of entity: an individual or an organization.","x-enumDescriptions":{"individual":"A natural person.","organization":"A company or another organization."}},"legalName":{"type":"string","minLength":1},"phones":{"type":"array","items":{"type":"string"}},"emails":{"type":"array","items":{"type":"string"}},"addresses":{"type":"array","items":{"$ref":"#/components/schemas/PostalAddress"}}},"required":["entityType","legalName","phones","emails","addresses"]},"baseCurrency":{"type":"string","description":"ISO 4217 currency code","examples":["CHF"]}}},"examples":{"default":{"summary":"Example request","value":{"vat":{"scheme":"cash_basis"},"allowedEmailsArrayOperation":{"operation":"union","items":["anna.meier@example.com"]},"baseCurrency":"CHF"}}}}}}}},"/users/me":{"get":{"operationId":"users-me-get","summary":"Get the authenticated user profile","tags":["Users"],"security":[{"bearerAuth":["users:read"]}],"x-sway-scope":"users:read","parameters":[{"name":"fields","in":"query","description":"Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.","schema":{"type":"string"},"example":"firestoreId,firstName,lastName"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/User"}},"required":["data"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"500":{"$ref":"#/components/responses/InternalError"}}},"patch":{"operationId":"users-me-update","summary":"Update the authenticated user profile","tags":["Users"],"security":[{"bearerAuth":["users:write"]}],"x-sway-scope":"users:write","parameters":[{"name":"fields","in":"query","description":"Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.","schema":{"type":"string"},"example":"firestoreId,firstName,lastName"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/User"}},"required":["data"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"500":{"$ref":"#/components/responses/InternalError"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"firstName":{"type":"string"},"lastName":{"type":"string"},"position":{"type":"string","enum":["ceo","cfo","otherCLevel","businessAdministrative","accountant","other"],"description":"Position of the user in the company.","x-enumDescriptions":{"ceo":"Chief executive officer.","cfo":"Chief financial officer.","otherCLevel":"Another C-level executive.","businessAdministrative":"Business or administrative staff.","accountant":"Accountant.","other":"Another position."}},"birthdate":{"type":"string","examples":["1990-05-14"]},"phone":{"type":"string","minLength":3,"examples":["+41791234567"]},"locale":{"type":"string"}}},"examples":{"default":{"summary":"Example request","value":{"position":"ceo","birthdate":"1990-05-14","phone":"+41791234567"}}}}}}}},"/users/me/permissions":{"get":{"operationId":"users-me-getPermissions","summary":"Get the permissions granted to the authenticated user","tags":["Users"],"security":[{"bearerAuth":["users:read"]}],"x-sway-scope":"users:read","parameters":[{"name":"fields","in":"query","description":"Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.","schema":{"type":"string"},"example":"v,ws,ba"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/UserPermissions"}},"required":["data"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/billing-accounts/{billingAccountId}":{"patch":{"operationId":"billingAccounts-update","summary":"Update a billing account","tags":["Billing accounts"],"security":[{"bearerAuth":["billing-accounts:write"]}],"x-sway-scope":"billing-accounts:write","parameters":[{"$ref":"#/components/parameters/BillingAccountId"},{"name":"fields","in":"query","description":"Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.","schema":{"type":"string"},"example":"firestoreId,type,owner"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/BillingAccount"}},"required":["data"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"address":{"$ref":"#/components/schemas/PostalAddress"}},"required":["address"]},"examples":{"default":{"summary":"Example request","value":{"address":{"country":"CH","postCode":"8001","townName":"Zürich","streetName":"Bahnhofstrasse","buildingNumber":"10","name":"Haus zur Linde","postBox":"Postfach 1234","administrativeArea":"Zürich","recipients":["Anna Meier"],"organization":"Muster AG","source":["Muster AG","Bahnhofstrasse 10","8001 Zürich"]}}}}}}}}},"/currency-exchanges/{currency}":{"get":{"operationId":"currencyExchanges-get","summary":"Get exchange rates for one base currency","description":"The currency is an uppercase ISO 4217 code (e.g. CHF). Unknown currencies return a 404.","tags":["Currency exchanges"],"security":[{"bearerAuth":["currency-exchanges:read"]}],"x-sway-scope":"currency-exchanges:read","parameters":[{"$ref":"#/components/parameters/Currency"},{"name":"fields","in":"query","description":"Comma-separated property paths to include in the response, or in each item of a list. Use dots for nested paths.","schema":{"type":"string"},"example":"baseCurrency,timestamp,rates"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CurrencyExchange"}},"required":["data"]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalError"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Send an API key as `Authorization: Bearer <key>`. Each operation lists the scope the key needs."}},"schemas":{"MonetaryAmount":{"type":"object","properties":{"amount":{"type":"number","description":"Amount in the main unit of the currency, such as francs.","examples":[1250.5]},"currency":{"description":"Currency of the amount, when known.","anyOf":[{"type":"string","description":"ISO 4217 currency code","examples":["CHF"]},{"type":"null"}]}},"required":["amount"],"additionalProperties":false},"PostalAddress":{"type":"object","properties":{"country":{"type":"string","description":"ISO 3166-1 alpha-2 country code","examples":["CH"]},"postCode":{"examples":["8001"],"description":"Post code of the address.","type":"string","minLength":2},"townName":{"description":"Name of the town or city.","examples":["Zürich"],"type":"string","minLength":1},"streetName":{"description":"Name of the street.","examples":["Bahnhofstrasse"],"type":"string"},"buildingNumber":{"description":"Number of the building in the street.","examples":["10"],"type":"string"},"name":{"description":"Name of the building or place.","examples":["Haus zur Linde"],"type":"string"},"sortingCode":{"description":"Additional sorting code of the postal service, used in a few countries such as France.","type":"string"},"postBox":{"description":"Post office box.","examples":["Postfach 1234"],"type":"string"},"administrativeArea":{"description":"Region of the country, such as a canton or a state.","examples":["Zürich"],"type":"string"},"recipients":{"type":"array","items":{"type":"string"},"description":"Names of the people the address is for.","examples":[["Anna Meier"]]},"organization":{"description":"Name of the organization at the address.","examples":["Muster AG"],"type":"string"},"source":{"type":"array","items":{"type":"string"},"description":"Text the address was read from, one item per line.","examples":[["Muster AG","Bahnhofstrasse 10","8001 Zürich"]]}},"required":["country","postCode","townName"],"additionalProperties":false,"description":"Postal address, with the parts of an ISO 20022 postal address."},"AddressField":{"type":"object","properties":{"country":{"anyOf":[{"type":"string","description":"ISO 3166-1 alpha-2 country code","examples":["CH"]},{"type":"null"}],"description":"ISO 3166-1 alpha-2 country code"},"postCode":{"anyOf":[{"examples":["8001"],"description":"Post code of the address.","type":"string","minLength":2},{"type":"null"}],"description":"Post code of the address."},"townName":{"anyOf":[{"description":"Name of the town or city.","examples":["Zürich"],"type":"string","minLength":1},{"type":"null"}],"description":"Name of the town or city."},"streetName":{"anyOf":[{"description":"Name of the street.","examples":["Bahnhofstrasse"],"type":"string"},{"type":"null"}],"description":"Name of the street."},"buildingNumber":{"anyOf":[{"description":"Number of the building in the street.","examples":["10"],"type":"string"},{"type":"null"}],"description":"Number of the building in the street."},"name":{"anyOf":[{"description":"Name of the building or place.","examples":["Haus zur Linde"],"type":"string"},{"type":"null"}],"description":"Name of the building or place."},"sortingCode":{"anyOf":[{"description":"Additional sorting code of the postal service, used in a few countries such as France.","type":"string"},{"type":"null"}],"description":"Additional sorting code of the postal service, used in a few countries such as France."},"postBox":{"anyOf":[{"description":"Post office box.","examples":["Postfach 1234"],"type":"string"},{"type":"null"}],"description":"Post office box."},"administrativeArea":{"anyOf":[{"description":"Region of the country, such as a canton or a state.","examples":["Zürich"],"type":"string"},{"type":"null"}],"description":"Region of the country, such as a canton or a state."},"recipients":{"anyOf":[{"type":"array","items":{"type":"string"},"description":"Names of the people the address is for.","examples":[["Anna Meier"]]},{"type":"null"}],"description":"Names of the people the address is for."},"organization":{"anyOf":[{"description":"Name of the organization at the address.","examples":["Muster AG"],"type":"string"},{"type":"null"}],"description":"Name of the organization at the address."},"source":{"anyOf":[{"type":"array","items":{"type":"string"},"description":"Text the address was read from, one item per line.","examples":[["Muster AG","Bahnhofstrasse 10","8001 Zürich"]]},{"type":"null"}],"description":"Text the address was read from, one item per line."}},"additionalProperties":false,"description":"Postal address on a document, in which any part can be missing."},"BankAccountField":{"type":"object","properties":{"bankName":{"anyOf":[{"type":"string"},{"type":"null"}]},"bankAddress":{"anyOf":[{"$ref":"#/components/schemas/AddressField"},{"type":"null"}]},"bic":{"anyOf":[{"type":"string"},{"type":"null"}]},"currency":{"anyOf":[{"type":"string","description":"ISO 4217 currency code","examples":["CHF"]},{"type":"null"}],"description":"ISO 4217 currency code"},"accountIdentification":{"anyOf":[{"type":"string"},{"type":"null"}]},"accountSecondaryIdentification":{"anyOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false},"ReadConsent":{"type":"object","properties":{"firestoreId":{"type":"string","examples":["rcons_UkVBRC0wMDQy"],"description":"ID of the read consent."},"expirationDateTime":{"type":"string","format":"date-time"},"authorizationStatus":{"type":"object","properties":{"status":{"type":"string","enum":["pending","authorised","rejected","revoked","consumed","expired"]},"updateDateTime":{"examples":["2026-03-02T09:30:00.000Z"],"type":"string","format":"date-time"}},"required":["status","updateDateTime"],"additionalProperties":false},"products":{"type":"array","items":{"type":"string","enum":["identity","read_consents","write_consents","accounts","beneficiaries","balances","transactions","statements","cards","variable_recurring_payments","direct_debits","draft_payments","single_payments","scheduled_payments","standing_order_payments"],"description":"Banking product, a group of bank services that a consent can cover.","x-enumDescriptions":{"identity":"Identity of the account holder.","read_consents":"Consents that give read access to account data.","write_consents":"Consents that allow payments.","accounts":"Bank accounts and their details.","beneficiaries":"Payees saved at the bank.","balances":"Balances of the accounts.","transactions":"Transactions of the accounts.","statements":"Statements of the accounts.","cards":"Payment cards of the accounts.","variable_recurring_payments":"Recurring payments with variable amounts.","direct_debits":"Direct debits of the accounts.","draft_payments":"Payments submitted to the bank and approved by the account holder in e-banking.","single_payments":"One-time payments that the bank executes.","scheduled_payments":"Payments that the bank executes at a later date.","standing_order_payments":"Standing orders, recurring payments of a fixed amount."}}},"features":{"type":"array","items":{"type":"string","enum":["identity.details","read_consents.multiple_consents_allowed","read_consents.single_consent_allowed","read_consents.redirect","read_consents.embedded","write_consents.redirect","write_consents.embedded","accounts.list","accounts.details","beneficiaries.list","beneficiaries.details","balances.intraday","balances.closing","transactions.intraday","transactions.history","statements.list","statements.iso_camt053_xml","statements.pdf","direct_debits.list","direct_debits.details","draft_payments.revolut_csv","draft_payments.iso_pain001_ch_xml","draft_payments.iso_pain001_xml","draft_payments.domestic","draft_payments.international","draft_payments.bulk","draft_payments.list","draft_payments.details","single_payments.domestic","single_payments.international","single_payments.instant","single_payments.bulk","single_payments.list","single_payments.details","scheduled_payments.domestic","scheduled_payments.international","scheduled_payments.bulk","scheduled_payments.list","scheduled_payments.details","standing_order_payments.domestic","standing_order_payments.international","standing_order_payments.bulk","standing_order_payments.list","standing_order_payments.details"],"description":"Banking feature, a capability of the banking product named before the dot.","x-enumDescriptions":{"identity.details":"Reads the identity details of the account holder.","read_consents.multiple_consents_allowed":"Allows several read consents at the bank, each for its own accounts.","read_consents.single_consent_allowed":"Allows one read consent at the bank; a new consent replaces the previous one.","read_consents.redirect":"Authorises read consents on the website or app of the bank.","read_consents.embedded":"Authorises read consents without leaving Sway.","write_consents.redirect":"Authorises payment consents on the website or app of the bank.","write_consents.embedded":"Authorises payment consents without leaving Sway.","accounts.list":"Lists the bank accounts.","accounts.details":"Reads the details of a bank account.","beneficiaries.list":"Lists the payees saved at the bank.","beneficiaries.details":"Reads the details of a saved payee.","balances.intraday":"Reads the balance during the day.","balances.closing":"Reads the closing balance of each day.","transactions.intraday":"Reads the transactions of the current day.","transactions.history":"Reads the past transactions.","statements.list":"Lists the account statements.","statements.iso_camt053_xml":"Provides account statements as ISO 20022 camt.053 XML files.","statements.pdf":"Provides account statements as PDF files.","direct_debits.list":"Lists the direct debits.","direct_debits.details":"Reads the details of a direct debit.","draft_payments.revolut_csv":"Submits payments as a CSV file in the Revolut format.","draft_payments.iso_pain001_ch_xml":"Submits payments as an ISO 20022 pain.001 XML file in the Swiss variant.","draft_payments.iso_pain001_xml":"Submits payments as an ISO 20022 pain.001 XML file.","draft_payments.domestic":"Submits domestic payments.","draft_payments.international":"Submits international payments.","draft_payments.bulk":"Submits several payments at once.","draft_payments.list":"Lists the submitted payments.","draft_payments.details":"Reads the details of a submitted payment.","single_payments.domestic":"Executes domestic one-time payments.","single_payments.international":"Executes international one-time payments.","single_payments.instant":"Executes domestic instant payments.","single_payments.bulk":"Executes several one-time payments at once.","single_payments.list":"Lists the one-time payments.","single_payments.details":"Reads the details of a one-time payment.","scheduled_payments.domestic":"Schedules domestic payments.","scheduled_payments.international":"Schedules international payments.","scheduled_payments.bulk":"Schedules several payments at once.","scheduled_payments.list":"Lists the scheduled payments.","scheduled_payments.details":"Reads the details of a scheduled payment.","standing_order_payments.domestic":"Sets up domestic standing orders.","standing_order_payments.international":"Sets up international standing orders.","standing_order_payments.bulk":"Sets up several standing orders at once.","standing_order_payments.list":"Lists the standing orders.","standing_order_payments.details":"Reads the details of a standing order."}}},"range":{"type":"object","properties":{"fromDateTime":{"examples":["2026-03-02T09:30:00.000Z"],"type":"string","format":"date-time"},"toDateTime":{"examples":["2026-03-02T09:30:00.000Z"],"type":"string","format":"date-time"}},"additionalProperties":false},"reference":{"type":"string"},"serviceProviderId":{"type":"string","examples":["sprov_SUlEUDAwMjMw"],"description":"ID of the service provider."},"workspaceId":{"type":"string","examples":["Wk7fQ2xR9bLm4tZp8sNv"],"description":"ID of the workspace."},"creation":{"type":"object","properties":{"creationDateTime":{"examples":["2026-03-02T09:15:00.000Z"],"description":"Date and time when the resource was created.","type":"string","format":"date-time"},"createdBy":{"type":"string","description":"ID of the user who created the resource, when recorded.","examples":["Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"]}},"required":["creationDateTime"],"additionalProperties":false,"description":"When and by whom the resource was created."},"solved":{"type":"boolean"}},"required":["firestoreId","authorizationStatus","products","features","reference","serviceProviderId","workspaceId","creation","solved"],"additionalProperties":false},"AccountType":{"type":"string","enum":["BANK","CURRENT_ASSET","FIXED_ASSET","INVENTORY","NON_CURRENT_ASSET","PREPAYMENT","CURRENT_LIABILITY","LIABILITY","NON_CURRENT_LIABILITY","EQUITY","REVENUE","SALES","OTHER_INCOME","DIRECT_COST","OVERHEAD","EXPENSE","DEPRECIATION","SUSPENSE"]},"Counterparty":{"type":"object","properties":{"firestoreId":{"type":"string","examples":["Cp2nG7vB4xLq9wRt5hMz"],"description":"ID of the counterparty."},"workspaceId":{"type":"string","examples":["Wk7fQ2xR9bLm4tZp8sNv"],"description":"ID of the workspace."},"creation":{"type":"object","properties":{"creationDateTime":{"examples":["2026-03-02T09:15:00.000Z"],"description":"Date and time when the resource was created.","type":"string","format":"date-time"},"createdBy":{"type":"string","description":"ID of the user who created the resource, when recorded.","examples":["Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"]}},"required":["creationDateTime"],"additionalProperties":false,"description":"When and by whom the resource was created."},"activation":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Whether the resource is enabled.","examples":[true]},"updateDateTime":{"examples":["2026-03-02T09:15:00.000Z"],"description":"Date and time when `enabled` was last set.","type":"string","format":"date-time"},"updatedBy":{"type":"string","description":"ID of the user who last set `enabled`, when recorded.","examples":["Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"]}},"required":["enabled","updateDateTime"],"additionalProperties":false,"description":"Whether the resource is enabled, and when and by whom it was last enabled or disabled."},"entityType":{"type":"string","enum":["individual","organization"],"description":"Kind of entity: an individual or an organization.","x-enumDescriptions":{"individual":"A natural person.","organization":"A company or another organization."}},"name":{"type":"string","minLength":1},"phones":{"type":"array","items":{"type":"string"}},"emails":{"type":"array","items":{"type":"string"}},"address":{"$ref":"#/components/schemas/PostalAddress"},"contactPersons":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"phone":{"type":"string"},"email":{"type":"string"}},"required":["name"],"additionalProperties":false}},"taxIdentification":{"type":"string"},"notes":{"type":"string"},"cashAccounts":{"type":"array","items":{"type":"object","properties":{"identifications":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["bic","sortCode","iban","bban","accountNumber","pan","email","msisdn","virtualAccountId","globalWallet","clabe","bitcoinAddress","bitcoinXpub","other"],"description":"Kind of identifier of a bank account or of its bank.","x-enumDescriptions":{"bic":"Bank Identifier Code of the bank.","sortCode":"Six-digit code of a bank and branch in the United Kingdom.","iban":"International Bank Account Number.","bban":"Basic Bank Account Number, the country-specific format of an account number.","accountNumber":"Account number that the bank assigns, unique within the bank or the branch.","pan":"Primary Account Number, the number of a credit or debit card.","email":"Email address that identifies the account.","msisdn":"Mobile phone number that identifies the account.","virtualAccountId":"Identifier of a virtual sub-account of a main account.","globalWallet":"Identifier of a digital wallet that holds and pays in several currencies.","clabe":"CLABE, the 18-digit standardized bank code of a Mexican bank account.","bitcoinAddress":"Single Bitcoin address, the only address the account tracks.","bitcoinXpub":"Bitcoin extended public key (xpub, ypub or zpub), from which the addresses of the wallet are derived.","other":"Another kind of identifier."}},"value":{"description":"Value of the identifier, for example the IBAN or the BIC.","type":"string"}},"required":["type","value"],"additionalProperties":false}},"currency":{"type":"string","description":"ISO 4217 currency code","examples":["CHF"]},"bankAddress":{"type":"object","properties":{"country":{"type":"string","description":"ISO 3166-1 alpha-2 country code","examples":["CH"]},"postCode":{"examples":["8001"],"description":"Post code of the address.","type":"string","minLength":2},"townName":{"description":"Name of the town or city.","examples":["Zürich"],"type":"string","minLength":1},"streetName":{"description":"Name of the street.","examples":["Bahnhofstrasse"],"type":"string"},"buildingNumber":{"description":"Number of the building in the street.","examples":["10"],"type":"string"},"name":{"description":"Name of the building or place.","examples":["Haus zur Linde"],"type":"string"},"sortingCode":{"description":"Additional sorting code of the postal service, used in a few countries such as France.","type":"string"},"postBox":{"description":"Post office box.","examples":["Postfach 1234"],"type":"string"},"administrativeArea":{"description":"Region of the country, such as a canton or a state.","examples":["Zürich"],"type":"string"},"recipients":{"type":"array","items":{"type":"string"},"description":"Names of the people the address is for.","examples":[["Anna Meier"]]},"organization":{"description":"Name of the organization at the address.","examples":["Muster AG"],"type":"string"},"source":{"type":"array","items":{"type":"string"},"description":"Text the address was read from, one item per line.","examples":[["Muster AG","Bahnhofstrasse 10","8001 Zürich"]]}},"required":["country"],"additionalProperties":false},"internalId":{"type":"string"},"nickname":{"type":"string","minLength":1},"verification":{"type":"object","properties":{"id":{"type":"string","examples":["3f2c8a1e-6b4d-4e7a-9c15-8d2b7f0e4a61"]},"status":{"type":"string","enum":["verified","pending","rejected"]},"holderName":{"type":"string","minLength":1},"dateTime":{"examples":["2026-03-02T09:30:00.000Z"],"type":"string","format":"date-time"}},"required":["id","status","holderName","dateTime"],"additionalProperties":false}},"required":["identifications","currency","bankAddress","internalId"],"additionalProperties":false}},"cashAccountIdentifications":{"type":"array","items":{"type":"string"}},"approvedCashAccountIds":{"type":"array","items":{"type":"string"}},"bankAccountId":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["firestoreId","workspaceId","creation","activation","name","phones","emails","contactPersons","cashAccounts","cashAccountIdentifications","approvedCashAccountIds","bankAccountId"],"additionalProperties":false},"BankAccount":{"type":"object","properties":{"firestoreId":{"type":"string","examples":["bacc_Q0gzMTA4NzY1NDM"],"description":"ID of the bank account."},"name":{"type":"string"},"products":{"type":"array","items":{"type":"string","enum":["identity","accounts","beneficiaries","balances","transactions","statements","direct_debits","draft_payments","single_payments","scheduled_payments","standing_order_payments"]}},"features":{"type":"array","items":{"type":"string","enum":["identity.details","accounts.list","accounts.details","beneficiaries.list","beneficiaries.details","balances.intraday","balances.closing","transactions.intraday","transactions.history","statements.list","statements.iso_camt053_xml","statements.pdf","direct_debits.list","direct_debits.details","draft_payments.revolut_csv","draft_payments.iso_pain001_ch_xml","draft_payments.iso_pain001_xml","draft_payments.domestic","draft_payments.international","draft_payments.bulk","draft_payments.list","draft_payments.details","single_payments.domestic","single_payments.international","single_payments.instant","single_payments.bulk","single_payments.list","single_payments.details","scheduled_payments.domestic","scheduled_payments.international","scheduled_payments.bulk","scheduled_payments.list","scheduled_payments.details","standing_order_payments.domestic","standing_order_payments.international","standing_order_payments.bulk","standing_order_payments.list","standing_order_payments.details"]}},"usage":{"type":"string","enum":["individual","organization"],"description":"Kind of entity: an individual or an organization.","x-enumDescriptions":{"individual":"A natural person.","organization":"A company or another organization."}},"workspaceId":{"type":"string","examples":["Wk7fQ2xR9bLm4tZp8sNv"],"description":"ID of the workspace."},"serviceProviderId":{"type":"string","examples":["sprov_SUlEUDAwMjMw"],"description":"ID of the service provider."},"consentId":{"type":"string","examples":["rcons_UkVBRC0wMDQy"],"description":"ID of the read consent."},"creation":{"type":"object","properties":{"creationDateTime":{"examples":["2026-03-02T09:15:00.000Z"],"description":"Date and time when the resource was created.","type":"string","format":"date-time"},"createdBy":{"type":"string","description":"ID of the user who created the resource, when recorded.","examples":["Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"]}},"required":["creationDateTime"],"additionalProperties":false,"description":"When and by whom the resource was created."},"activation":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Whether the resource is enabled.","examples":[true]},"updateDateTime":{"examples":["2026-03-02T09:15:00.000Z"],"description":"Date and time when `enabled` was last set.","type":"string","format":"date-time"},"updatedBy":{"type":"string","description":"ID of the user who last set `enabled`, when recorded.","examples":["Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"]}},"required":["enabled","updateDateTime"],"additionalProperties":false,"description":"Whether the resource is enabled, and when and by whom it was last enabled or disabled."},"archived":{"type":"boolean"},"isOffline":{"type":"boolean"},"enrichWithCamt":{"type":"boolean"},"tasks":{"type":"number"},"lastRequestedDateForBalances":{"type":"string","format":"date-time"},"lastRequestedDateForTransactions":{"type":"string","format":"date-time"},"lastTaskRunDateForBalances":{"type":"string","format":"date-time"},"lastTaskRunDateForTransactions":{"type":"string","format":"date-time"},"lastAvailableDateForBalances":{"type":"string","examples":["2026-03-02"]},"lastAvailableDateForTransactions":{"type":"string","examples":["2026-03-02"]},"cashAccounts":{"type":"array","items":{"type":"object","properties":{"accountIdentifications":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["bic","sortCode","iban","bban","accountNumber","pan","email","msisdn","virtualAccountId","globalWallet","clabe","bitcoinAddress","bitcoinXpub","other"],"description":"Kind of identifier of a bank account or of its bank.","x-enumDescriptions":{"bic":"Bank Identifier Code of the bank.","sortCode":"Six-digit code of a bank and branch in the United Kingdom.","iban":"International Bank Account Number.","bban":"Basic Bank Account Number, the country-specific format of an account number.","accountNumber":"Account number that the bank assigns, unique within the bank or the branch.","pan":"Primary Account Number, the number of a credit or debit card.","email":"Email address that identifies the account.","msisdn":"Mobile phone number that identifies the account.","virtualAccountId":"Identifier of a virtual sub-account of a main account.","globalWallet":"Identifier of a digital wallet that holds and pays in several currencies.","clabe":"CLABE, the 18-digit standardized bank code of a Mexican bank account.","bitcoinAddress":"Single Bitcoin address, the only address the account tracks.","bitcoinXpub":"Bitcoin extended public key (xpub, ypub or zpub), from which the addresses of the wallet are derived.","other":"Another kind of identifier."}},"identification":{"type":"string"}},"required":["type","identification"],"additionalProperties":false}},"currency":{"type":"string"},"name":{"type":"string"},"ownerName":{"type":"string"}},"required":["accountIdentifications"],"additionalProperties":false}},"relationships":{"type":"object","properties":{"readConsent":{"$ref":"#/components/schemas/ReadConsent"},"counterparty":{"$ref":"#/components/schemas/Counterparty"},"latestBalance":{"type":"object","properties":{"date":{"type":"string","examples":["2026-03-02"]},"balance":{"type":"object","properties":{"dateTime":{"type":"string","format":"date-time"},"currency":{"type":"string"},"amount":{"type":"number"},"isClosing":{"type":"boolean"}},"required":["dateTime","currency","amount","isClosing"],"additionalProperties":false}},"required":["date","balance"],"additionalProperties":false},"recentBalances":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"date":{"type":"string","examples":["2026-03-02"]},"balance":{"type":"object","properties":{"dateTime":{"type":"string","format":"date-time"},"currency":{"type":"string"},"amount":{"type":"number"},"isClosing":{"type":"boolean"}},"required":["dateTime","currency","amount","isClosing"],"additionalProperties":false}},"required":["date","balance"],"additionalProperties":false}}},"additionalProperties":false}},"required":["firestoreId","name","products","features","workspaceId","serviceProviderId","creation","activation","archived","isOffline","tasks","cashAccounts","relationships"],"additionalProperties":false},"CreditTransfer":{"type":"object","properties":{"instructionId":{"type":"string"},"endToEndId":{"type":"string"},"amount":{"type":"number"},"currency":{"type":"string"},"creditorName":{"type":"string"},"creditorIban":{"type":"string"},"communication":{"type":"string"},"structuredReference":{"type":"string"}},"required":["endToEndId"],"additionalProperties":false},"AccountCodingRule":{"type":"object","properties":{"firestoreId":{"type":"string","examples":["Ru7bX2kQ9mWp4tLz6nHc"],"description":"ID of the account coding rule."},"workspaceId":{"type":"string","examples":["Wk7fQ2xR9bLm4tZp8sNv"],"description":"ID of the workspace."},"name":{"type":"string","minLength":1,"maxLength":100},"description":{"type":"string","maxLength":500},"bankAccountId":{"type":"string","examples":["bacc_Q0gzMTA4NzY1NDM"],"description":"ID of the bank account."},"conditionsOperator":{"type":"string","enum":["AND","OR"]},"conditions":{"minItems":1,"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"field":{"type":"string","const":"TEXT"},"operator":{"type":"string","enum":["CONTAINS","NOT_CONTAINS"]},"value":{"type":"string"}},"required":["id","field","operator","value"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"field":{"type":"string","const":"MILLI_AMOUNT"},"operator":{"type":"string","enum":["LT","GT","LTE","GTE","EQ","NEQ"]},"value":{"type":"number"}},"required":["id","field","operator","value"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string"},"field":{"type":"string","const":"CURRENCY"},"operator":{"type":"string","enum":["EQ","NEQ"]},"value":{"type":"string","description":"ISO 4217 currency code","examples":["CHF"]}},"required":["id","field","operator","value"],"additionalProperties":false}]}},"actions":{"minItems":1,"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["ASSIGN_ACCOUNT","ASSIGN_TAX_TYPE","SET_ENTRY_DESCRIPTION"]},"value":{"type":"string"}},"required":["id","type","value"],"additionalProperties":false}},"order":{"type":"number"},"creation":{"type":"object","properties":{"creationDateTime":{"examples":["2026-03-02T09:15:00.000Z"],"description":"Date and time when the resource was created.","type":"string","format":"date-time"},"createdBy":{"type":"string","description":"ID of the user who created the resource, when recorded.","examples":["Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"]}},"required":["creationDateTime"],"additionalProperties":false,"description":"When and by whom the resource was created."},"activation":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Whether the resource is enabled.","examples":[true]},"updateDateTime":{"examples":["2026-03-02T09:15:00.000Z"],"description":"Date and time when `enabled` was last set.","type":"string","format":"date-time"},"updatedBy":{"type":"string","description":"ID of the user who last set `enabled`, when recorded.","examples":["Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"]}},"required":["enabled","updateDateTime"],"additionalProperties":false,"description":"Whether the resource is enabled, and when and by whom it was last enabled or disabled."}},"required":["firestoreId","workspaceId","name","conditionsOperator","conditions","actions","order","creation","activation"],"additionalProperties":false},"BalanceHistory":{"type":"object","properties":{"firestoreId":{"type":"string","examples":["2026"],"description":"ID of the balance history."},"bankAccountId":{"type":"string","examples":["bacc_Q0gzMTA4NzY1NDM"],"description":"ID of the bank account."},"workspaceId":{"type":"string","examples":["Wk7fQ2xR9bLm4tZp8sNv"],"description":"ID of the workspace."},"year":{"type":"number"},"balances":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"dateTime":{"type":"string","format":"date-time"},"currency":{"type":"string"},"amount":{"type":"number"},"isClosing":{"type":"boolean"}},"required":["dateTime","currency","amount","isClosing"],"additionalProperties":false}}},"required":["firestoreId","bankAccountId","workspaceId","year","balances"],"additionalProperties":false},"BankTransaction":{"type":"object","properties":{"firestoreId":{"type":"string","examples":["trx_MjAyNjAzMDJUMDk"],"description":"ID of the bank transaction."},"dateTime":{"examples":["2026-03-02T09:30:00.000Z"],"type":"string","format":"date-time"},"executionStatus":{"type":"string","enum":["booked","pending","rejected"],"description":"Execution status of the transaction at the bank.","x-enumDescriptions":{"booked":"The bank booked the transaction on the account.","pending":"The bank has not booked the transaction yet; the transaction is removed when the bank stops reporting it.","rejected":"The bank did not execute the transaction."}},"workspaceId":{"type":"string","examples":["Wk7fQ2xR9bLm4tZp8sNv"],"description":"ID of the workspace."},"bankAccountId":{"type":"string","examples":["bacc_Q0gzMTA4NzY1NDM"],"description":"ID of the bank account."},"serviceProviderId":{"type":"string","examples":["sprov_SUlEUDAwMjMw"],"description":"ID of the service provider."},"reconciled":{"type":"boolean"},"milliAmount":{"type":"number"},"instructedMilliAmount":{"type":"number"},"accountingStatus":{"type":"string","enum":["pending","partially_booked","booked"]},"accountingSuggestion":{"type":"object","properties":{"score":{"type":"string","enum":["high","medium","low"]},"historicalMatchingBankTransaction":{"type":"object","properties":{"firestoreId":{"type":"string","examples":["trx_MjAyNjAzMDJUMDk"],"description":"ID of the bank transaction."},"bankAccountId":{"type":"string","examples":["bacc_Q0gzMTA4NzY1NDM"],"description":"ID of the bank account."}},"required":["firestoreId","bankAccountId"],"additionalProperties":false},"rationale":{"type":"string"},"entries":{"type":"array","items":{"type":"object","properties":{"accountCode":{"type":"string"},"creditAccount":{"type":"string"},"debitAccount":{"type":"string"},"description":{"type":"string"},"milliAmount":{"type":"number"}},"additionalProperties":false}}},"required":["entries"],"additionalProperties":false},"accountingSuggestionStatus":{"type":"string","enum":["pending","processed"]},"transaction":{"type":"object","properties":{"bookingDate":{"type":"string"},"bookingDateTime":{"type":"string"},"valueDate":{"type":"string"},"valueDateTime":{"type":"string"},"currency":{"type":"string"},"instructedMilliAmount":{"type":"number"},"instructedCurrency":{"type":"string"},"feesAmount":{"type":"number"},"feesCurrency":{"type":"string"},"exchangeRate":{"type":"number"},"exchangeRateText":{"type":"string"},"counterpartyName":{"type":"string"},"reference":{"type":"string"},"communication":{"type":"string"},"additionalInformation":{"type":"string"}},"additionalProperties":false},"cashBalance":{"type":"object","properties":{"dateTime":{"type":"string","format":"date-time"},"currency":{"type":"string"},"amount":{"type":"number"},"isClosing":{"type":"boolean"}},"required":["dateTime","currency","amount","isClosing"],"additionalProperties":false},"address":{"$ref":"#/components/schemas/PostalAddress"},"invoiceCandidateMatchIds":{"type":"array","items":{"type":"string"}},"invoiceConfirmedMatchIds":{"type":"array","items":{"type":"string"}},"invoiceCandidateMatches":{"type":"array","items":{"$ref":"#/components/schemas/InvoiceMatch"}},"invoiceConfirmedMatches":{"type":"array","items":{"$ref":"#/components/schemas/InvoiceMatch"}}},"required":["firestoreId","dateTime","executionStatus","workspaceId","bankAccountId","serviceProviderId","reconciled","milliAmount","transaction"],"additionalProperties":false},"BillingAccount":{"type":"object","properties":{"firestoreId":{"type":"string","examples":["Bl6tW3mQ8xKp2vNr7zHs"],"description":"ID of the billing account."},"type":{"type":"string","enum":["individual","organization"],"description":"Kind of holder of the billing account.","x-enumDescriptions":{"individual":"The billing account belongs to a person, described in `individual`.","organization":"The billing account belongs to an organization, described in `organization`."}},"owner":{"type":"string"},"individual":{"type":"object","properties":{"firstName":{"type":"string"},"lastName":{"type":"string"},"email":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$","examples":["anna.meier@example.com"]},"phone":{"type":"string","minLength":3,"examples":["+41791234567"]},"address":{"$ref":"#/components/schemas/PostalAddress"}},"required":["firstName","lastName","email","phone"],"additionalProperties":false},"organization":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$","examples":["anna.meier@example.com"]},"phone":{"type":"string","minLength":3,"examples":["+41791234567"]},"address":{"$ref":"#/components/schemas/PostalAddress"},"contact":{"type":"object","properties":{"firstName":{"type":"string"},"lastName":{"type":"string"},"email":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$","examples":["anna.meier@example.com"]},"phone":{"type":"string","minLength":3,"examples":["+41791234567"]}},"required":["email"],"additionalProperties":false},"metadata":{"type":"object","properties":{"foundationDate":{"type":"string","examples":["1990-05-14"]},"size":{"type":"string","enum":["lessFive","fiveToTen","elevenToFifty","fiftyOneToOneHundred","oneHundredToTwoHundredFifty","moreThanTwoHundredFifty"],"description":"Number of employees of the company.","x-enumDescriptions":{"lessFive":"Fewer than 5 employees.","fiveToTen":"5 to 10 employees.","elevenToFifty":"11 to 50 employees.","fiftyOneToOneHundred":"51 to 100 employees.","oneHundredToTwoHundredFifty":"100 to 250 employees.","moreThanTwoHundredFifty":"More than 250 employees."}},"industry":{"type":"string","enum":["agriculturePisciculture","businessServices","chemical","commerce","communication","construction","cultureEntertainment","defense","education","energy","finance","food","forestry","health","hospitalityCatering","insurance","legal","manufacturing","mediaInformation","miningOilGas","personalServices","publicService","realEstate","sportFitness","technology","textileLifeStyle","tourism","transportation","other"],"description":"Industry of the company.","x-enumDescriptions":{"agriculturePisciculture":"Agriculture and fish farming.","businessServices":"Business services.","chemical":"Chemical industry.","commerce":"Commerce.","communication":"Communication.","construction":"Construction.","cultureEntertainment":"Culture and entertainment.","defense":"Defense.","education":"Education.","energy":"Energy.","finance":"Finance.","food":"Food.","forestry":"Forestry.","health":"Health.","hospitalityCatering":"Hospitality and catering.","insurance":"Insurance.","legal":"Legal services.","manufacturing":"Manufacturing.","mediaInformation":"Media and information.","miningOilGas":"Mining, oil and gas.","personalServices":"Personal services.","publicService":"Public service.","realEstate":"Real estate.","sportFitness":"Sport and fitness.","technology":"Technology.","textileLifeStyle":"Textile and lifestyle.","tourism":"Tourism.","transportation":"Transportation.","other":"Another industry."}}},"additionalProperties":false}},"required":["name","email","contact","metadata"],"additionalProperties":false},"workspaceIds":{"type":"array","items":{"type":"string"}},"creation":{"type":"object","properties":{"creationDateTime":{"examples":["2026-03-02T09:15:00.000Z"],"description":"Date and time when the resource was created.","type":"string","format":"date-time"},"createdBy":{"type":"string","description":"ID of the user who created the resource, when recorded.","examples":["Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"]}},"required":["creationDateTime"],"additionalProperties":false,"description":"When and by whom the resource was created."},"activation":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Whether the resource is enabled.","examples":[true]},"updateDateTime":{"examples":["2026-03-02T09:15:00.000Z"],"description":"Date and time when `enabled` was last set.","type":"string","format":"date-time"},"updatedBy":{"type":"string","description":"ID of the user who last set `enabled`, when recorded.","examples":["Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"]}},"required":["enabled","updateDateTime"],"additionalProperties":false,"description":"Whether the resource is enabled, and when and by whom it was last enabled or disabled."}},"required":["firestoreId","type","owner","workspaceIds","creation","activation"],"additionalProperties":false},"ChartOfAccount":{"type":"object","properties":{"firestoreId":{"type":"string","examples":["Ca6yH3kN8pTr1vWx4bQs"],"description":"ID of the chart of accounts."},"workspaceId":{"type":"string","examples":["Wk7fQ2xR9bLm4tZp8sNv"],"description":"ID of the workspace."},"validFrom":{"type":"string"},"validUntil":{"type":"string"},"title":{"type":"string"},"groups":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"parentId":{"type":"string"}},"required":["id","name"],"additionalProperties":false}},"accounts":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"groupId":{"type":"string"},"taxTypeId":{"type":"string","examples":["Tt9mC5rL2wQz7nVb4kHp"],"description":"ID of the tax type."},"bankAccountId":{"type":"string","examples":["bacc_Q0gzMTA4NzY1NDM"],"description":"ID of the bank account."},"type":{"$ref":"#/components/schemas/AccountType"},"currency":{"type":"string","description":"ISO 4217 currency code","examples":["CHF"]}},"required":["code","name","groupId"],"additionalProperties":false}},"creation":{"type":"object","properties":{"creationDateTime":{"examples":["2026-03-02T09:15:00.000Z"],"description":"Date and time when the resource was created.","type":"string","format":"date-time"},"createdBy":{"type":"string","description":"ID of the user who created the resource, when recorded.","examples":["Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"]}},"required":["creationDateTime"],"additionalProperties":false,"description":"When and by whom the resource was created."}},"required":["firestoreId","workspaceId","title","groups","accounts","creation"],"additionalProperties":false},"CurrencyExchange":{"type":"object","properties":{"baseCurrency":{"type":"string"},"timestamp":{"examples":["2026-03-02T09:30:00.000Z"],"type":"string","format":"date-time"},"rates":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}}},"required":["baseCurrency","timestamp","rates"],"additionalProperties":false},"DraftPayment":{"type":"object","properties":{"firestoreId":{"type":"string","examples":["dpay_RFAtMjAyNjAzMDI"],"description":"ID of the draft payment."},"messageId":{"type":"string"},"endToEndIds":{"type":"array","items":{"type":"string"}},"transferIds":{"type":"array","items":{"type":"string"}},"workspaceId":{"type":"string","examples":["Wk7fQ2xR9bLm4tZp8sNv"],"description":"ID of the workspace."},"bankAccountId":{"type":"string","examples":["bacc_Q0gzMTA4NzY1NDM"],"description":"ID of the bank account."},"counterpartyIds":{"type":"array","items":{"type":"string"}},"transferCounterpartyIds":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"creation":{"type":"object","properties":{"creationDateTime":{"examples":["2026-03-02T09:15:00.000Z"],"description":"Date and time when the resource was created.","type":"string","format":"date-time"},"createdBy":{"type":"string","description":"ID of the user who created the resource, when recorded.","examples":["Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"]}},"required":["creationDateTime"],"additionalProperties":false,"description":"When and by whom the resource was created."},"invoiceIds":{"type":"array","items":{"type":"string"}},"instruction":{"type":"object","properties":{"executionDate":{"type":"string"},"paymentMethod":{"type":"string"},"paymentInformationId":{"type":"string"},"debtorName":{"type":"string"},"debtorIban":{"type":"string"},"debtorCurrency":{"type":"string"},"debtorBic":{"type":"string"}},"additionalProperties":false},"submissionStatus":{"type":"object","properties":{"status":{"type":"string"},"creationDateTime":{"type":"string"}},"additionalProperties":false},"instructionStatus":{"type":"object","properties":{"status":{"type":"string"}},"additionalProperties":false},"relationships":{"type":"object","properties":{"firstTransfers":{"type":"array","items":{"$ref":"#/components/schemas/DraftPaymentTransfer"}}},"required":["firstTransfers"],"additionalProperties":false}},"required":["firestoreId","messageId","endToEndIds","transferIds","workspaceId","bankAccountId","counterpartyIds","transferCounterpartyIds","creation","instruction","relationships"],"additionalProperties":false},"DraftPaymentTransfer":{"type":"object","properties":{"firestoreId":{"type":"string","examples":["dtrans_RFQtMjAyNjAzMDI"],"description":"ID of the draft payment transfer."},"workspaceId":{"type":"string","examples":["Wk7fQ2xR9bLm4tZp8sNv"],"description":"ID of the workspace."},"draftPaymentId":{"type":"string","examples":["dpay_RFAtMjAyNjAzMDI"],"description":"ID of the draft payment."},"bankAccountId":{"type":"string","examples":["bacc_Q0gzMTA4NzY1NDM"],"description":"ID of the bank account."},"counterpartyId":{"type":"string","examples":["Cp2nG7vB4xLq9wRt5hMz"],"description":"ID of the counterparty."},"transfer":{"$ref":"#/components/schemas/CreditTransfer"},"transferStatus":{"type":"object","properties":{"status":{"type":"string"},"acceptanceDateTime":{"type":"string"}},"additionalProperties":false},"relationships":{"type":"object","properties":{"counterparty":{"$ref":"#/components/schemas/Counterparty"}},"required":["counterparty"],"additionalProperties":false}},"required":["firestoreId","workspaceId","draftPaymentId","bankAccountId","counterpartyId","transfer","relationships"],"additionalProperties":false},"InitiatedPayment":{"type":"object","properties":{"firestoreId":{"type":"string","examples":["ipay_SVAtMjAyNjAzMDI"],"description":"ID of the initiated payment."},"transferIds":{"type":"array","items":{"type":"string"}},"workspaceId":{"type":"string","examples":["Wk7fQ2xR9bLm4tZp8sNv"],"description":"ID of the workspace."},"bankAccountId":{"type":"string","examples":["bacc_Q0gzMTA4NzY1NDM"],"description":"ID of the bank account."},"writeConsentId":{"type":"string","examples":["wcons_V1JJVEUtMDA0Mg"],"description":"ID of the write consent."},"counterpartyIds":{"type":"array","items":{"type":"string"}},"transferCounterpartyIds":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"creation":{"type":"object","properties":{"creationDateTime":{"examples":["2026-03-02T09:15:00.000Z"],"description":"Date and time when the resource was created.","type":"string","format":"date-time"},"createdBy":{"type":"string","description":"ID of the user who created the resource, when recorded.","examples":["Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"]}},"required":["creationDateTime"],"additionalProperties":false,"description":"When and by whom the resource was created."},"invoiceIds":{"type":"array","items":{"type":"string"}},"instruction":{"type":"object","properties":{"executionDate":{"type":"string"},"paymentMethod":{"type":"string"},"paymentInformationId":{"type":"string"},"debtorName":{"type":"string"},"debtorIban":{"type":"string"},"debtorCurrency":{"type":"string"},"debtorBic":{"type":"string"}},"additionalProperties":false},"submissionStatus":{"type":"object","properties":{"status":{"type":"string"},"creationDateTime":{"type":"string"}},"additionalProperties":false},"instructionStatus":{"type":"object","properties":{"status":{"type":"string"}},"additionalProperties":false},"relationships":{"type":"object","properties":{"firstTransfers":{"type":"array","items":{"$ref":"#/components/schemas/InitiatedPaymentTransfer"}}},"required":["firstTransfers"],"additionalProperties":false}},"required":["firestoreId","transferIds","workspaceId","bankAccountId","counterpartyIds","transferCounterpartyIds","creation","instruction","relationships"],"additionalProperties":false},"InitiatedPaymentTransfer":{"type":"object","properties":{"firestoreId":{"type":"string","examples":["itrans_SVQtMjAyNjAzMDI"],"description":"ID of the initiated payment transfer."},"workspaceId":{"type":"string","examples":["Wk7fQ2xR9bLm4tZp8sNv"],"description":"ID of the workspace."},"initiatedPaymentId":{"type":"string","examples":["ipay_SVAtMjAyNjAzMDI"],"description":"ID of the initiated payment."},"bankAccountId":{"type":"string","examples":["bacc_Q0gzMTA4NzY1NDM"],"description":"ID of the bank account."},"counterpartyId":{"type":"string","examples":["Cp2nG7vB4xLq9wRt5hMz"],"description":"ID of the counterparty."},"transfer":{"$ref":"#/components/schemas/CreditTransfer"},"transferStatus":{"type":"object","properties":{"status":{"type":"string"},"acceptanceDateTime":{"type":"string"}},"additionalProperties":false},"relationships":{"type":"object","properties":{"counterparty":{"$ref":"#/components/schemas/Counterparty"}},"required":["counterparty"],"additionalProperties":false}},"required":["firestoreId","workspaceId","initiatedPaymentId","bankAccountId","counterpartyId","transfer","transferStatus","relationships"],"additionalProperties":false},"Invitation":{"type":"object","properties":{"firestoreId":{"type":"string","examples":["In8rD4sF7jPw2yKm6tQb"],"description":"ID of the invitation."},"workspaceId":{"type":"string","examples":["Wk7fQ2xR9bLm4tZp8sNv"],"description":"ID of the workspace."},"inviterId":{"type":"string","examples":["Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"],"description":"ID of the user."},"status":{"type":"string","enum":["pending","consumed"],"description":"Status of the invitation.","x-enumDescriptions":{"pending":"The invitation waits for the invited person to accept it.","consumed":"The invited person accepted the invitation and became a member of the workspace."}},"role":{"type":"string","enum":["ws.owner","ws.admin","ws.member","ws.viewer","ws.support","ba.owner","ba.admin","ba.member"],"description":"Role of the user, which sets its permissions in a workspace (`ws.`) or a billing account (`ba.`).","x-enumDescriptions":{"ws.owner":"Owner of the workspace, with every permission, including deleting the workspace and managing owners.","ws.admin":"Administrator of the workspace, with every permission except managing owners and deleting the workspace or its files.","ws.member":"Member of the workspace, who works on its transactions, invoices, payments and accounting but manages neither its bank accounts nor its members.","ws.viewer":"Viewer of the workspace, a role that grants no permission.","ws.support":"Sway support access, granted when you invite the Sway bot.","ba.owner":"Owner of the billing account, with every permission, including deleting it.","ba.admin":"Administrator of the billing account, who reads and updates it but cannot delete it.","ba.member":"Member of the billing account, who can only read it."}},"email":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$","examples":["anna.meier@example.com"]},"expirationDateTime":{"examples":["2026-03-02T09:30:00.000Z"],"type":"string","format":"date-time"}},"required":["firestoreId","workspaceId","inviterId","status","role","email"],"additionalProperties":false},"DetailedInvitation":{"type":"object","properties":{"firestoreId":{"type":"string","examples":["In8rD4sF7jPw2yKm6tQb"],"description":"ID of the invitation."},"workspaceId":{"type":"string","examples":["Wk7fQ2xR9bLm4tZp8sNv"],"description":"ID of the workspace."},"inviterId":{"type":"string","examples":["Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"],"description":"ID of the user."},"status":{"type":"string","enum":["pending","consumed"],"description":"Status of the invitation.","x-enumDescriptions":{"pending":"The invitation waits for the invited person to accept it.","consumed":"The invited person accepted the invitation and became a member of the workspace."}},"role":{"type":"string","enum":["ws.owner","ws.admin","ws.member","ws.viewer","ws.support","ba.owner","ba.admin","ba.member"],"description":"Role of the user, which sets its permissions in a workspace (`ws.`) or a billing account (`ba.`).","x-enumDescriptions":{"ws.owner":"Owner of the workspace, with every permission, including deleting the workspace and managing owners.","ws.admin":"Administrator of the workspace, with every permission except managing owners and deleting the workspace or its files.","ws.member":"Member of the workspace, who works on its transactions, invoices, payments and accounting but manages neither its bank accounts nor its members.","ws.viewer":"Viewer of the workspace, a role that grants no permission.","ws.support":"Sway support access, granted when you invite the Sway bot.","ba.owner":"Owner of the billing account, with every permission, including deleting it.","ba.admin":"Administrator of the billing account, who reads and updates it but cannot delete it.","ba.member":"Member of the billing account, who can only read it."}},"email":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$","examples":["anna.meier@example.com"]},"expirationDateTime":{"examples":["2026-03-02T09:30:00.000Z"],"type":"string","format":"date-time"},"details":{"type":"object","properties":{"inviterName":{"type":"string"},"workspaceName":{"type":"string"},"workspacePhotoUrl":{"type":"string","format":"uri"}},"required":["inviterName","workspaceName"],"additionalProperties":false}},"required":["firestoreId","workspaceId","inviterId","status","role","email","details"],"additionalProperties":false},"Invoice":{"type":"object","properties":{"firestoreId":{"type":"string","examples":["Iv5zP2nK7wRt3xMq9bLd"],"description":"ID of the invoice."},"workspaceId":{"type":"string","examples":["Wk7fQ2xR9bLm4tZp8sNv"],"description":"ID of the workspace."},"creation":{"type":"object","properties":{"creationDateTime":{"examples":["2026-03-02T09:15:00.000Z"],"description":"Date and time when the resource was created.","type":"string","format":"date-time"},"createdBy":{"type":"string","description":"ID of the user who created the resource, when recorded.","examples":["Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"]}},"required":["creationDateTime"],"additionalProperties":false,"description":"When and by whom the resource was created."},"invoiceStatus":{"type":"string","enum":["drafted","created","deleted","authorised","paid","voided"],"description":"Status of the invoice in its lifecycle.","x-enumDescriptions":{"drafted":"Draft that may lack mandatory fields; an uploaded invoice starts here and moves to `created` once its data passes validation.","created":"Validated invoice, whose mandatory fields are all present and valid.","deleted":"Deleted invoice, which can no longer change status and is left out of transaction matching.","authorised":"Validated invoice that a user approved.","paid":"Validated invoice settled in full by matched bank transactions or marked as paid by a user; its mandatory fields can no longer change.","voided":"Cancelled invoice, left out of transaction matching."}},"processingStatus":{"type":"string","enum":["uploaded","parsed","failed"],"description":"Progress of the data extraction from the invoice file.","x-enumDescriptions":{"uploaded":"The file is uploaded and its data is not extracted yet.","parsed":"The data is extracted from the file, or the invoice was imported without a file.","failed":"The data could not be extracted from the file, for example because the file is too large."}},"accountingType":{"type":"string","enum":["payable","receivable"],"description":"Direction of the invoice: a supplier bill to pay or a sales invoice to collect.","x-enumDescriptions":{"payable":"A bill received from a supplier, which the workspace pays.","receivable":"An invoice issued to a customer, which the workspace collects."}},"reconciled":{"type":"boolean"},"processed":{"type":"boolean"},"paymentSubmitted":{"type":"boolean"},"sentDateTime":{"type":"string","format":"date-time"},"paymentMethod":{"type":"string","enum":["creditCard","debitCard","directDebit","bankTransfer","cash","voucher","check","paypal","stripe","applePay","googlePay","samsungPay","unknown"],"description":"Payment method of the invoice.","x-enumDescriptions":{"creditCard":"Credit card.","debitCard":"Debit card.","directDebit":"Direct debit.","bankTransfer":"Bank transfer.","cash":"Cash.","voucher":"Voucher.","check":"Check.","paypal":"PayPal.","stripe":"Stripe.","applePay":"Apple Pay.","googlePay":"Google Pay.","samsungPay":"Samsung Pay.","unknown":"The payment method is not known."}},"supplierCounterpartyId":{"anyOf":[{"type":"string","examples":["Cp2nG7vB4xLq9wRt5hMz"],"description":"ID of the counterparty."},{"type":"null"}],"description":"ID of the counterparty."},"receiverCounterpartyId":{"anyOf":[{"type":"string","examples":["Cp2nG7vB4xLq9wRt5hMz"],"description":"ID of the counterparty."},{"type":"null"}],"description":"ID of the counterparty."},"storagePath":{"type":"string"},"fileChecksumMd5":{"type":"string"},"fileChecksumCrc32c":{"type":"string"},"amountDue":{"anyOf":[{"$ref":"#/components/schemas/MonetaryAmount"},{"type":"null"}]},"amountPaidSinceLastInvoice":{"anyOf":[{"$ref":"#/components/schemas/MonetaryAmount"},{"type":"null"}]},"clientId":{"anyOf":[{"type":"string"},{"type":"null"}]},"currency":{"anyOf":[{"type":"string","description":"ISO 4217 currency code","examples":["CHF"]},{"type":"null"}],"description":"ISO 4217 currency code"},"dueDate":{"anyOf":[{"type":"string","examples":["2026-03-02"]},{"type":"null"}]},"invoiceDate":{"anyOf":[{"type":"string","examples":["2026-03-02"]},{"type":"null"}]},"invoiceId":{"anyOf":[{"type":"string"},{"type":"null"}]},"isUnpaidReminder":{"anyOf":[{"type":"number"},{"type":"null"}]},"netAmount":{"anyOf":[{"$ref":"#/components/schemas/MonetaryAmount"},{"type":"null"}]},"paymentTerms":{"anyOf":[{"type":"string"},{"type":"null"}]},"purchaseOrder":{"anyOf":[{"type":"string"},{"type":"null"}]},"receiverAddress":{"anyOf":[{"$ref":"#/components/schemas/AddressField"},{"type":"null"}]},"receiverBankAccount":{"anyOf":[{"$ref":"#/components/schemas/BankAccountField"},{"type":"null"}]},"receiverContactName":{"anyOf":[{"type":"string"},{"type":"null"}]},"receiverEmail":{"anyOf":[{"type":"string"},{"type":"null"}]},"receiverName":{"anyOf":[{"type":"string"},{"type":"null"}]},"receiverPhone":{"anyOf":[{"type":"string"},{"type":"null"}]},"receiverTaxId":{"anyOf":[{"type":"string"},{"type":"null"}]},"remitToAddress":{"anyOf":[{"$ref":"#/components/schemas/AddressField"},{"type":"null"}]},"remitToName":{"anyOf":[{"type":"string"},{"type":"null"}]},"shipToAddress":{"anyOf":[{"$ref":"#/components/schemas/AddressField"},{"type":"null"}]},"shipToName":{"anyOf":[{"type":"string"},{"type":"null"}]},"supplierAddress":{"anyOf":[{"$ref":"#/components/schemas/AddressField"},{"type":"null"}]},"supplierBankAccounts":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/BankAccountField"}},{"type":"null"}]},"supplierContactName":{"anyOf":[{"type":"string"},{"type":"null"}]},"supplierEmail":{"anyOf":[{"type":"string"},{"type":"null"}]},"supplierName":{"anyOf":[{"type":"string"},{"type":"null"}]},"supplierPaymentRef":{"anyOf":[{"type":"string"},{"type":"null"}]},"supplierPhone":{"anyOf":[{"type":"string"},{"type":"null"}]},"supplierTaxId":{"anyOf":[{"type":"string"},{"type":"null"}]},"supplierWebsite":{"anyOf":[{"type":"string"},{"type":"null"}]},"totalAmount":{"anyOf":[{"$ref":"#/components/schemas/MonetaryAmount"},{"type":"null"}]},"totalTaxAmount":{"anyOf":[{"$ref":"#/components/schemas/MonetaryAmount"},{"type":"null"}]},"items":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"amount":{"anyOf":[{"$ref":"#/components/schemas/MonetaryAmount"},{"type":"null"}]},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"discountAmount":{"anyOf":[{"$ref":"#/components/schemas/MonetaryAmount"},{"type":"null"}]},"discountRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"productCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"productId":{"anyOf":[{"type":"string","examples":["Pr4wJ8tM1xNq6zRb3vKf"],"description":"ID of the product."},{"type":"null"}],"description":"ID of the product."},"quantity":{"anyOf":[{"type":"number"},{"type":"null"}]},"taxAmount":{"anyOf":[{"$ref":"#/components/schemas/MonetaryAmount"},{"type":"null"}]},"taxRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"taxTypeId":{"anyOf":[{"type":"string","examples":["Tt9mC5rL2wQz7nVb4kHp"],"description":"ID of the tax type."},{"type":"null"}],"description":"ID of the tax type."},"unit":{"anyOf":[{"type":"string"},{"type":"null"}]},"unitPrice":{"anyOf":[{"$ref":"#/components/schemas/MonetaryAmount"},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]},"taxes":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"netAmountBeforeTax":{"anyOf":[{"$ref":"#/components/schemas/MonetaryAmount"},{"type":"null"}]},"taxAmount":{"anyOf":[{"$ref":"#/components/schemas/MonetaryAmount"},{"type":"null"}]},"taxCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"taxRate":{"anyOf":[{"type":"number"},{"type":"null"}]}},"additionalProperties":false}},{"type":"null"}]},"draftPaymentIds":{"type":"array","items":{"type":"string"}},"initiatedPaymentIds":{"type":"array","items":{"type":"string"}},"transactionCandidateMatchIds":{"type":"array","items":{"type":"string"}},"transactionConfirmedMatchIds":{"type":"array","items":{"type":"string"}},"transactionCandidateMatches":{"type":"array","items":{"$ref":"#/components/schemas/InvoiceMatch"}},"transactionConfirmedMatches":{"type":"array","items":{"$ref":"#/components/schemas/InvoiceMatch"}}},"required":["firestoreId","workspaceId","creation","invoiceStatus","processingStatus","reconciled","processed","paymentSubmitted"],"additionalProperties":false},"LedgerEntry":{"type":"object","properties":{"firestoreId":{"type":"string","examples":["Le3wN8qT5xKr1mZv7pBd"],"description":"ID of the ledger entry."},"workspaceId":{"type":"string","examples":["Wk7fQ2xR9bLm4tZp8sNv"],"description":"ID of the workspace."},"milliAmount":{"type":"number","minimum":0},"creditAccount":{"type":"string"},"creditAccountSource":{"type":"string","enum":["manual","ai","bank_account","import","rule"]},"creditBankTransaction":{"type":"object","properties":{"firestoreId":{"type":"string","examples":["trx_MjAyNjAzMDJUMDk"],"description":"ID of the bank transaction."},"bankAccountId":{"type":"string","examples":["bacc_Q0gzMTA4NzY1NDM"],"description":"ID of the bank account."},"order":{"type":"integer","minimum":0}},"required":["firestoreId","bankAccountId","order"],"additionalProperties":false},"debitAccount":{"type":"string"},"debitAccountSource":{"type":"string","enum":["manual","ai","bank_account","import","rule"]},"debitBankTransaction":{"type":"object","properties":{"firestoreId":{"type":"string","examples":["trx_MjAyNjAzMDJUMDk"],"description":"ID of the bank transaction."},"bankAccountId":{"type":"string","examples":["bacc_Q0gzMTA4NzY1NDM"],"description":"ID of the bank account."},"order":{"type":"integer","minimum":0}},"required":["firestoreId","bankAccountId","order"],"additionalProperties":false},"taxRate":{"type":"number"},"taxMilliAmount":{"type":"number","minimum":0},"taxCode":{"type":"string"},"taxId":{"type":"string"},"taxAccount":{"type":"string"},"taxDirection":{"type":"string","enum":["credit","debit"]},"description":{"type":"string"},"date":{"type":"string","examples":["2026-03-02"]},"creation":{"type":"object","properties":{"creationDateTime":{"examples":["2026-03-02T09:15:00.000Z"],"description":"Date and time when the resource was created.","type":"string","format":"date-time"},"createdBy":{"type":"string","description":"ID of the user who created the resource, when recorded.","examples":["Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"]}},"required":["creationDateTime"],"additionalProperties":false,"description":"When and by whom the resource was created."}},"required":["firestoreId","workspaceId","milliAmount","date","creation"],"additionalProperties":false},"Membership":{"type":"object","properties":{"firestoreId":{"type":"string","examples":["Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"],"description":"ID of the membership, the same as the user ID of the member."},"workspaceId":{"type":"string","examples":["Wk7fQ2xR9bLm4tZp8sNv"],"description":"ID of the workspace."},"userId":{"type":"string","examples":["Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"],"description":"ID of the user."},"displayName":{"type":"string"},"email":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$","examples":["anna.meier@example.com"]},"photoUrl":{"type":"string","format":"uri"},"role":{"type":"string","enum":["ws.owner","ws.admin","ws.member","ws.viewer","ws.support","ba.owner","ba.admin","ba.member"],"description":"Role of the user, which sets its permissions in a workspace (`ws.`) or a billing account (`ba.`).","x-enumDescriptions":{"ws.owner":"Owner of the workspace, with every permission, including deleting the workspace and managing owners.","ws.admin":"Administrator of the workspace, with every permission except managing owners and deleting the workspace or its files.","ws.member":"Member of the workspace, who works on its transactions, invoices, payments and accounting but manages neither its bank accounts nor its members.","ws.viewer":"Viewer of the workspace, a role that grants no permission.","ws.support":"Sway support access, granted when you invite the Sway bot.","ba.owner":"Owner of the billing account, with every permission, including deleting it.","ba.admin":"Administrator of the billing account, who reads and updates it but cannot delete it.","ba.member":"Member of the billing account, who can only read it."}},"activation":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Whether the resource is enabled.","examples":[true]},"updateDateTime":{"examples":["2026-03-02T09:15:00.000Z"],"description":"Date and time when `enabled` was last set.","type":"string","format":"date-time"},"updatedBy":{"type":"string","description":"ID of the user who last set `enabled`, when recorded.","examples":["Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"]}},"required":["enabled","updateDateTime"],"additionalProperties":false,"description":"Whether the resource is enabled, and when and by whom it was last enabled or disabled."}},"required":["firestoreId","workspaceId","userId","displayName","email","role","activation"],"additionalProperties":false},"PaymentSummary":{"type":"object","properties":{"workspaceId":{"type":"string","examples":["Wk7fQ2xR9bLm4tZp8sNv"],"description":"ID of the workspace."},"type":{"type":"string","enum":["draft_payment","initiated_payment"],"description":"Kind of payment that the bank connection of the debtor account supports.","x-enumDescriptions":{"draft_payment":"A draft payment, which the account holder approves in e-banking.","initiated_payment":"An initiated payment, which Sway sends to the bank for execution."}},"scope":{"type":"string","enum":["domestic","international"],"description":"Scope of the payment, which depends on the countries and currencies of the debtor and creditor accounts.","x-enumDescriptions":{"domestic":"A GBP payment between two accounts in the United Kingdom, or a EUR payment between two accounts in SEPA countries.","international":"Any other payment, which needs the BIC of the creditor bank."}},"idempotencyId":{"type":"string"},"executionDate":{"type":"string"},"amount":{"type":"number"},"currency":{"type":"string"},"reference":{"type":"string"},"communication":{"type":"string"},"invoiceId":{"type":"string","examples":["Iv5zP2nK7wRt3xMq9bLd"],"description":"ID of the invoice."},"debtor":{"type":"object","properties":{"bankAccount":{"$ref":"#/components/schemas/BankAccount"},"name":{"type":"string"},"accountIdentifications":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["bic","sortCode","iban","bban","accountNumber","pan","email","msisdn","virtualAccountId","globalWallet","clabe","bitcoinAddress","bitcoinXpub","other"],"description":"Kind of identifier of a bank account or of its bank.","x-enumDescriptions":{"bic":"Bank Identifier Code of the bank.","sortCode":"Six-digit code of a bank and branch in the United Kingdom.","iban":"International Bank Account Number.","bban":"Basic Bank Account Number, the country-specific format of an account number.","accountNumber":"Account number that the bank assigns, unique within the bank or the branch.","pan":"Primary Account Number, the number of a credit or debit card.","email":"Email address that identifies the account.","msisdn":"Mobile phone number that identifies the account.","virtualAccountId":"Identifier of a virtual sub-account of a main account.","globalWallet":"Identifier of a digital wallet that holds and pays in several currencies.","clabe":"CLABE, the 18-digit standardized bank code of a Mexican bank account.","bitcoinAddress":"Single Bitcoin address, the only address the account tracks.","bitcoinXpub":"Bitcoin extended public key (xpub, ypub or zpub), from which the addresses of the wallet are derived.","other":"Another kind of identifier."}},"value":{"description":"Value of the identifier, for example the IBAN or the BIC.","type":"string"}},"required":["type","value"],"additionalProperties":false}},"currency":{"type":"string"}},"required":["bankAccount","name","accountIdentifications","currency"],"additionalProperties":false},"creditor":{"type":"object","properties":{"counterparty":{"$ref":"#/components/schemas/Counterparty"},"counterpartyCashAccountId":{"type":"string"},"name":{"type":"string"},"address":{"type":"object","properties":{"country":{"type":"string","description":"ISO 3166-1 alpha-2 country code","examples":["CH"]},"postCode":{"examples":["8001"],"description":"Post code of the address.","type":"string","minLength":2},"townName":{"description":"Name of the town or city.","examples":["Zürich"],"type":"string","minLength":1},"streetName":{"description":"Name of the street.","examples":["Bahnhofstrasse"],"type":"string"},"buildingNumber":{"description":"Number of the building in the street.","examples":["10"],"type":"string"},"name":{"description":"Name of the building or place.","examples":["Haus zur Linde"],"type":"string"},"sortingCode":{"description":"Additional sorting code of the postal service, used in a few countries such as France.","type":"string"},"postBox":{"description":"Post office box.","examples":["Postfach 1234"],"type":"string"},"administrativeArea":{"description":"Region of the country, such as a canton or a state.","examples":["Zürich"],"type":"string"},"recipients":{"type":"array","items":{"type":"string"},"description":"Names of the people the address is for.","examples":[["Anna Meier"]]},"organization":{"description":"Name of the organization at the address.","examples":["Muster AG"],"type":"string"},"source":{"type":"array","items":{"type":"string"},"description":"Text the address was read from, one item per line.","examples":[["Muster AG","Bahnhofstrasse 10","8001 Zürich"]]}},"additionalProperties":false},"accountIdentifications":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["bic","sortCode","iban","bban","accountNumber","pan","email","msisdn","virtualAccountId","globalWallet","clabe","bitcoinAddress","bitcoinXpub","other"],"description":"Kind of identifier of a bank account or of its bank.","x-enumDescriptions":{"bic":"Bank Identifier Code of the bank.","sortCode":"Six-digit code of a bank and branch in the United Kingdom.","iban":"International Bank Account Number.","bban":"Basic Bank Account Number, the country-specific format of an account number.","accountNumber":"Account number that the bank assigns, unique within the bank or the branch.","pan":"Primary Account Number, the number of a credit or debit card.","email":"Email address that identifies the account.","msisdn":"Mobile phone number that identifies the account.","virtualAccountId":"Identifier of a virtual sub-account of a main account.","globalWallet":"Identifier of a digital wallet that holds and pays in several currencies.","clabe":"CLABE, the 18-digit standardized bank code of a Mexican bank account.","bitcoinAddress":"Single Bitcoin address, the only address the account tracks.","bitcoinXpub":"Bitcoin extended public key (xpub, ypub or zpub), from which the addresses of the wallet are derived.","other":"Another kind of identifier."}},"value":{"description":"Value of the identifier, for example the IBAN or the BIC.","type":"string"}},"required":["type","value"],"additionalProperties":false}},"currency":{"type":"string"},"verification":{"type":"object","properties":{"id":{"type":"string","examples":["3f2c8a1e-6b4d-4e7a-9c15-8d2b7f0e4a61"]},"status":{"type":"string","enum":["verified","pending","rejected"]},"holderName":{"type":"string","minLength":1},"dateTime":{"examples":["2026-03-02T09:30:00.000Z"],"type":"string","format":"date-time"}},"required":["id","status","holderName","dateTime"],"additionalProperties":false},"requiresBic":{"type":"boolean"},"candidateBic":{"type":"string"}},"required":["counterparty","counterpartyCashAccountId","name","accountIdentifications","currency","requiresBic"],"additionalProperties":false}},"required":["workspaceId","type","executionDate","amount","currency","debtor","creditor"],"additionalProperties":false},"Product":{"type":"object","properties":{"firestoreId":{"type":"string","examples":["Pr4wJ8tM1xNq6zRb3vKf"],"description":"ID of the product."},"workspaceId":{"type":"string","examples":["Wk7fQ2xR9bLm4tZp8sNv"],"description":"ID of the workspace."},"creation":{"type":"object","properties":{"creationDateTime":{"examples":["2026-03-02T09:15:00.000Z"],"description":"Date and time when the resource was created.","type":"string","format":"date-time"},"createdBy":{"type":"string","description":"ID of the user who created the resource, when recorded.","examples":["Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"]}},"required":["creationDateTime"],"additionalProperties":false,"description":"When and by whom the resource was created."},"activation":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Whether the resource is enabled.","examples":[true]},"updateDateTime":{"examples":["2026-03-02T09:15:00.000Z"],"description":"Date and time when `enabled` was last set.","type":"string","format":"date-time"},"updatedBy":{"type":"string","description":"ID of the user who last set `enabled`, when recorded.","examples":["Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"]}},"required":["enabled","updateDateTime"],"additionalProperties":false,"description":"Whether the resource is enabled, and when and by whom it was last enabled or disabled."},"code":{"type":"string","minLength":1,"maxLength":50},"name":{"type":"object","properties":{"default":{"type":"string","minLength":1,"maxLength":100,"description":"Text in the default language."}},"required":["default"],"additionalProperties":false},"unit":{"type":"object","properties":{"default":{"type":"string","minLength":1,"maxLength":20,"description":"Text in the default language."}},"required":["default"],"additionalProperties":false},"purchaseName":{"type":"object","properties":{"default":{"type":"string","minLength":1,"maxLength":100,"description":"Text in the default language."}},"required":["default"],"additionalProperties":false},"purchaseCurrency":{"type":"string","description":"ISO 4217 currency code","examples":["CHF"]},"purchaseMilliAmount":{"type":"number","minimum":0},"purchaseDescription":{"type":"object","properties":{"default":{"type":"string","minLength":1,"maxLength":500,"description":"Text in the default language."}},"required":["default"],"additionalProperties":false},"purchaseAccount":{"type":"string","minLength":1,"maxLength":50,"description":"Code of an account in the chart of accounts.","examples":["1020"]},"purchaseTaxTypeId":{"type":"string","examples":["Tt9mC5rL2wQz7nVb4kHp"],"description":"ID of the tax type."},"saleName":{"type":"object","properties":{"default":{"type":"string","minLength":1,"maxLength":100,"description":"Text in the default language."}},"required":["default"],"additionalProperties":false},"saleCurrency":{"type":"string","description":"ISO 4217 currency code","examples":["CHF"]},"saleMilliAmount":{"type":"number","minimum":0},"saleDescription":{"type":"object","properties":{"default":{"type":"string","minLength":1,"maxLength":500,"description":"Text in the default language."}},"required":["default"],"additionalProperties":false},"saleAccount":{"type":"string","minLength":1,"maxLength":50,"description":"Code of an account in the chart of accounts.","examples":["1020"]},"saleTaxTypeId":{"type":"string","examples":["Tt9mC5rL2wQz7nVb4kHp"],"description":"ID of the tax type."},"supplierReferences":{"type":"array","items":{"type":"object","properties":{"counterpartyId":{"type":"string","examples":["Cp2nG7vB4xLq9wRt5hMz"],"description":"ID of the counterparty."},"code":{"type":"string","minLength":1,"maxLength":50},"name":{"type":"string","minLength":1,"maxLength":100}},"additionalProperties":false}},"tags":{"type":"array","items":{"type":"string","minLength":1,"maxLength":50}}},"required":["firestoreId","workspaceId","creation","activation","code","name","supplierReferences","tags"],"additionalProperties":false},"TaxType":{"type":"object","properties":{"firestoreId":{"type":"string","examples":["Tt9mC5rL2wQz7nVb4kHp"],"description":"ID of the tax type."},"workspaceId":{"type":"string","examples":["Wk7fQ2xR9bLm4tZp8sNv"],"description":"ID of the workspace."},"name":{"type":"string"},"description":{"type":"string"},"rate":{"type":"number"},"externalId":{"type":"string"},"code":{"type":"string"},"ledgerAccount":{"type":"string"},"milliRoundingFactor":{"type":"number"},"creation":{"type":"object","properties":{"creationDateTime":{"examples":["2026-03-02T09:15:00.000Z"],"description":"Date and time when the resource was created.","type":"string","format":"date-time"},"createdBy":{"type":"string","description":"ID of the user who created the resource, when recorded.","examples":["Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"]}},"required":["creationDateTime"],"additionalProperties":false,"description":"When and by whom the resource was created."}},"required":["firestoreId","workspaceId","name","rate","externalId","creation"],"additionalProperties":false},"User":{"type":"object","properties":{"firestoreId":{"type":"string","examples":["Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"],"description":"ID of the user."},"firstName":{"type":"string"},"lastName":{"type":"string"},"displayName":{"type":"string"},"email":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$","examples":["anna.meier@example.com"]},"status":{"type":"string","enum":["registered"],"description":"Status of the user account.","x-enumDescriptions":{"registered":"The user has signed up."}},"phone":{"type":"string","minLength":3,"examples":["+41791234567"]},"birthdate":{"type":"string","examples":["1990-05-14"]},"position":{"type":"string","enum":["ceo","cfo","otherCLevel","businessAdministrative","accountant","other"],"description":"Position of the user in the company.","x-enumDescriptions":{"ceo":"Chief executive officer.","cfo":"Chief financial officer.","otherCLevel":"Another C-level executive.","businessAdministrative":"Business or administrative staff.","accountant":"Accountant.","other":"Another position."}},"photoUrl":{"type":"string","format":"uri"},"locale":{"type":"string"},"creation":{"type":"object","properties":{"creationDateTime":{"examples":["2026-03-02T09:15:00.000Z"],"description":"Date and time when the resource was created.","type":"string","format":"date-time"},"createdBy":{"type":"string","description":"ID of the user who created the resource, when recorded.","examples":["Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"]}},"required":["creationDateTime"],"additionalProperties":false,"description":"When and by whom the resource was created."},"activation":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Whether the resource is enabled.","examples":[true]},"updateDateTime":{"examples":["2026-03-02T09:15:00.000Z"],"description":"Date and time when `enabled` was last set.","type":"string","format":"date-time"},"updatedBy":{"type":"string","description":"ID of the user who last set `enabled`, when recorded.","examples":["Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"]}},"required":["enabled","updateDateTime"],"additionalProperties":false,"description":"Whether the resource is enabled, and when and by whom it was last enabled or disabled."},"notifications":{"type":"object","properties":{"defaults":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"email":{"type":"boolean"},"push":{"type":"boolean"}},"required":["email","push"],"additionalProperties":false}},"workspaces":{"type":"object","propertyNames":{"type":"string","examples":["Wk7fQ2xR9bLm4tZp8sNv"],"description":"ID of the workspace."},"additionalProperties":{"type":"object","properties":{"mode":{"type":"string","enum":["default","custom","muted"],"description":"How the user receives the notifications of the workspace.","x-enumDescriptions":{"default":"The workspace follows the default notification settings of the user.","custom":"The workspace follows its own notification settings, in `custom`.","muted":"The user receives no notification for the workspace."}},"custom":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"email":{"type":"boolean"},"push":{"type":"boolean"}},"required":["email","push"],"additionalProperties":false}}},"required":["mode"],"additionalProperties":false}}},"additionalProperties":false},"relationships":{"type":"object","properties":{"lastAcceptedAgreements":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"firestoreId":{"type":"string","examples":["Ag4kR8tN2wQx6zLp3vMb"],"description":"ID of the agreement."},"userId":{"type":"string","examples":["Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"],"description":"ID of the user."},"acceptanceDateTime":{"examples":["2026-03-02T09:30:00.000Z"],"type":"string","format":"date-time"},"revision":{"type":"number"},"type":{"type":"string","enum":["termsAndConditions","privacyPolicy","cookiePolicy"],"description":"Legal document of Sway that the user accepts.","x-enumDescriptions":{"termsAndConditions":"Terms and conditions of Sway.","privacyPolicy":"Privacy policy of Sway.","cookiePolicy":"Cookie policy of Sway."}}},"required":["firestoreId","userId","acceptanceDateTime","revision","type"],"additionalProperties":false}}},"required":["lastAcceptedAgreements"],"additionalProperties":false}},"required":["firestoreId","email","status","creation","activation","relationships"],"additionalProperties":false},"Workspace":{"type":"object","properties":{"firestoreId":{"type":"string","examples":["Wk7fQ2xR9bLm4tZp8sNv"],"description":"ID of the workspace."},"billingAccountId":{"type":"string","examples":["Bl6tW3mQ8xKp2vNr7zHs"],"description":"ID of the billing account."},"name":{"type":"string","minLength":1},"normalizedName":{"type":"string","minLength":1},"photoUrl":{"type":"string","format":"uri"},"subscription":{"type":"object","properties":{"trialStartDateTime":{"type":"string","format":"date-time"},"trialEndDateTime":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["trialing","active","expired"],"description":"Status of the workspace subscription.","x-enumDescriptions":{"trialing":"The workspace is in its trial period.","active":"The workspace has a running paid subscription.","expired":"The trial or the subscription has ended, and the workspace is suspended."}},"startDateTime":{"type":"string","format":"date-time"},"endDateTime":{"type":"string","format":"date-time"}},"required":["trialStartDateTime","trialEndDateTime","status"],"additionalProperties":false},"creation":{"type":"object","properties":{"creationDateTime":{"examples":["2026-03-02T09:15:00.000Z"],"description":"Date and time when the resource was created.","type":"string","format":"date-time"},"createdBy":{"type":"string","description":"ID of the user who created the resource, when recorded.","examples":["Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"]}},"required":["creationDateTime"],"additionalProperties":false,"description":"When and by whom the resource was created."},"activation":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Whether the resource is enabled.","examples":[true]},"updateDateTime":{"examples":["2026-03-02T09:15:00.000Z"],"description":"Date and time when `enabled` was last set.","type":"string","format":"date-time"},"updatedBy":{"type":"string","description":"ID of the user who last set `enabled`, when recorded.","examples":["Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"]}},"required":["enabled","updateDateTime"],"additionalProperties":false,"description":"Whether the resource is enabled, and when and by whom it was last enabled or disabled."},"users":{"type":"array","items":{"type":"string"}},"vat":{"type":"object","properties":{"scheme":{"type":"string","enum":["cash_basis","accrual_basis","net_tax_rate","flat_tax_rate"]},"identificationNumber":{"type":"string","maxLength":50},"rates":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["standard","reduced","special","fixed"]},"rate":{"type":"number","minimum":0,"maximum":100}},"required":["type","rate"],"additionalProperties":false}}},"additionalProperties":false},"allowedDomains":{"type":"array","items":{"type":"string","minLength":1,"pattern":"^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\\.)+[a-zA-Z]{2,}$"}},"allowedEmails":{"type":"array","items":{"type":"string","format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$","examples":["anna.meier@example.com"]}},"aiBasedAccountCodingEnabled":{"default":true,"type":"boolean"},"ruleBasedAccountCodingEnabled":{"default":false,"type":"boolean"},"baseCurrency":{"type":"string","description":"ISO 4217 currency code","examples":["CHF"]}},"required":["firestoreId","billingAccountId","name","subscription","creation","activation","users"],"additionalProperties":false},"WorkspaceFile":{"type":"object","properties":{"firestoreId":{"type":"string"},"creation":{"type":"object","properties":{"creationDateTime":{"examples":["2026-03-02T09:15:00.000Z"],"description":"Date and time when the resource was created.","type":"string","format":"date-time"},"createdBy":{"type":"string","description":"ID of the user who created the resource, when recorded.","examples":["Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"]}},"required":["creationDateTime"],"additionalProperties":false,"description":"When and by whom the resource was created."},"workspaceId":{"type":"string","examples":["Wk7fQ2xR9bLm4tZp8sNv"],"description":"ID of the workspace."},"size":{"type":"integer","minimum":0},"mimeType":{"type":"string"},"filename":{"type":"string"},"gcsPath":{"type":"string"},"extension":{"type":"string"},"checksumMd5":{"type":"string"},"checksumCrc32c":{"type":"string"},"customMetadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"boolean"},{"type":"number"},{"type":"null"}]}},"scope":{"type":"string","enum":["workspace_attachment","bank_account_attachment","bank_transaction_attachment","bank_transaction_import","bank_transaction_export","draft_payment_attachment","initiated_payment_attachment","invoice_attachment"]},"targetDocumentPath":{"type":"string"},"targetDocumentId":{"type":"string","examples":["Hk2xNq8vR4tYw6ZbPj3c"]}},"required":["firestoreId","creation","workspaceId","size","mimeType","filename","gcsPath","extension","customMetadata","scope"],"additionalProperties":false},"WriteConsent":{"type":"object","properties":{"firestoreId":{"type":"string","examples":["wcons_V1JJVEUtMDA0Mg"],"description":"ID of the write consent."},"expirationDateTime":{"type":"string","format":"date-time"},"authorizationStatus":{"type":"object","properties":{"status":{"type":"string","enum":["pending","authorised","rejected","revoked","consumed","expired"]},"updateDateTime":{"examples":["2026-03-02T09:30:00.000Z"],"type":"string","format":"date-time"}},"required":["status","updateDateTime"],"additionalProperties":false},"authorizationUri":{"type":"string","format":"uri"},"products":{"type":"array","items":{"type":"string","enum":["identity","read_consents","write_consents","accounts","beneficiaries","balances","transactions","statements","cards","variable_recurring_payments","direct_debits","draft_payments","single_payments","scheduled_payments","standing_order_payments"],"description":"Banking product, a group of bank services that a consent can cover.","x-enumDescriptions":{"identity":"Identity of the account holder.","read_consents":"Consents that give read access to account data.","write_consents":"Consents that allow payments.","accounts":"Bank accounts and their details.","beneficiaries":"Payees saved at the bank.","balances":"Balances of the accounts.","transactions":"Transactions of the accounts.","statements":"Statements of the accounts.","cards":"Payment cards of the accounts.","variable_recurring_payments":"Recurring payments with variable amounts.","direct_debits":"Direct debits of the accounts.","draft_payments":"Payments submitted to the bank and approved by the account holder in e-banking.","single_payments":"One-time payments that the bank executes.","scheduled_payments":"Payments that the bank executes at a later date.","standing_order_payments":"Standing orders, recurring payments of a fixed amount."}}},"features":{"type":"array","items":{"type":"string","enum":["identity.details","read_consents.multiple_consents_allowed","read_consents.single_consent_allowed","read_consents.redirect","read_consents.embedded","write_consents.redirect","write_consents.embedded","accounts.list","accounts.details","beneficiaries.list","beneficiaries.details","balances.intraday","balances.closing","transactions.intraday","transactions.history","statements.list","statements.iso_camt053_xml","statements.pdf","direct_debits.list","direct_debits.details","draft_payments.revolut_csv","draft_payments.iso_pain001_ch_xml","draft_payments.iso_pain001_xml","draft_payments.domestic","draft_payments.international","draft_payments.bulk","draft_payments.list","draft_payments.details","single_payments.domestic","single_payments.international","single_payments.instant","single_payments.bulk","single_payments.list","single_payments.details","scheduled_payments.domestic","scheduled_payments.international","scheduled_payments.bulk","scheduled_payments.list","scheduled_payments.details","standing_order_payments.domestic","standing_order_payments.international","standing_order_payments.bulk","standing_order_payments.list","standing_order_payments.details"],"description":"Banking feature, a capability of the banking product named before the dot.","x-enumDescriptions":{"identity.details":"Reads the identity details of the account holder.","read_consents.multiple_consents_allowed":"Allows several read consents at the bank, each for its own accounts.","read_consents.single_consent_allowed":"Allows one read consent at the bank; a new consent replaces the previous one.","read_consents.redirect":"Authorises read consents on the website or app of the bank.","read_consents.embedded":"Authorises read consents without leaving Sway.","write_consents.redirect":"Authorises payment consents on the website or app of the bank.","write_consents.embedded":"Authorises payment consents without leaving Sway.","accounts.list":"Lists the bank accounts.","accounts.details":"Reads the details of a bank account.","beneficiaries.list":"Lists the payees saved at the bank.","beneficiaries.details":"Reads the details of a saved payee.","balances.intraday":"Reads the balance during the day.","balances.closing":"Reads the closing balance of each day.","transactions.intraday":"Reads the transactions of the current day.","transactions.history":"Reads the past transactions.","statements.list":"Lists the account statements.","statements.iso_camt053_xml":"Provides account statements as ISO 20022 camt.053 XML files.","statements.pdf":"Provides account statements as PDF files.","direct_debits.list":"Lists the direct debits.","direct_debits.details":"Reads the details of a direct debit.","draft_payments.revolut_csv":"Submits payments as a CSV file in the Revolut format.","draft_payments.iso_pain001_ch_xml":"Submits payments as an ISO 20022 pain.001 XML file in the Swiss variant.","draft_payments.iso_pain001_xml":"Submits payments as an ISO 20022 pain.001 XML file.","draft_payments.domestic":"Submits domestic payments.","draft_payments.international":"Submits international payments.","draft_payments.bulk":"Submits several payments at once.","draft_payments.list":"Lists the submitted payments.","draft_payments.details":"Reads the details of a submitted payment.","single_payments.domestic":"Executes domestic one-time payments.","single_payments.international":"Executes international one-time payments.","single_payments.instant":"Executes domestic instant payments.","single_payments.bulk":"Executes several one-time payments at once.","single_payments.list":"Lists the one-time payments.","single_payments.details":"Reads the details of a one-time payment.","scheduled_payments.domestic":"Schedules domestic payments.","scheduled_payments.international":"Schedules international payments.","scheduled_payments.bulk":"Schedules several payments at once.","scheduled_payments.list":"Lists the scheduled payments.","scheduled_payments.details":"Reads the details of a scheduled payment.","standing_order_payments.domestic":"Sets up domestic standing orders.","standing_order_payments.international":"Sets up international standing orders.","standing_order_payments.bulk":"Sets up several standing orders at once.","standing_order_payments.list":"Lists the standing orders.","standing_order_payments.details":"Reads the details of a standing order."}}},"range":{"type":"object","properties":{"fromDateTime":{"examples":["2026-03-02T09:30:00.000Z"],"type":"string","format":"date-time"},"toDateTime":{"examples":["2026-03-02T09:30:00.000Z"],"type":"string","format":"date-time"}},"additionalProperties":false},"reference":{"type":"string"},"serviceProviderId":{"type":"string","examples":["sprov_SUlEUDAwMjMw"],"description":"ID of the service provider."},"workspaceId":{"type":"string","examples":["Wk7fQ2xR9bLm4tZp8sNv"],"description":"ID of the workspace."},"creation":{"type":"object","properties":{"creationDateTime":{"examples":["2026-03-02T09:15:00.000Z"],"description":"Date and time when the resource was created.","type":"string","format":"date-time"},"createdBy":{"type":"string","description":"ID of the user who created the resource, when recorded.","examples":["Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"]}},"required":["creationDateTime"],"additionalProperties":false,"description":"When and by whom the resource was created."},"paymentData":{"type":"object","properties":{"scope":{"type":"string","enum":["domestic","international"],"description":"Scope of the payment, which depends on the countries and currencies of the debtor and creditor accounts.","x-enumDescriptions":{"domestic":"A GBP payment between two accounts in the United Kingdom, or a EUR payment between two accounts in SEPA countries.","international":"Any other payment, which needs the BIC of the creditor bank."}},"idempotencyId":{"type":"string"},"executionDate":{"type":"string","examples":["2026-03-02"]},"amount":{"type":"number"},"currency":{"type":"string"},"reference":{"type":"string"},"communication":{"type":"string"},"invoiceId":{"type":"string","examples":["Iv5zP2nK7wRt3xMq9bLd"],"description":"ID of the invoice."},"chargeBearer":{"type":"string","enum":["CRED","DEBT","SHAR","SLEV"]},"debtor":{"type":"object","properties":{"bankAccountId":{"type":"string","examples":["bacc_Q0gzMTA4NzY1NDM"],"description":"ID of the bank account."},"name":{"type":"string"},"accountIdentifications":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["bic","sortCode","iban","bban","accountNumber","pan","email","msisdn","virtualAccountId","globalWallet","clabe","bitcoinAddress","bitcoinXpub","other"],"description":"Kind of identifier of a bank account or of its bank.","x-enumDescriptions":{"bic":"Bank Identifier Code of the bank.","sortCode":"Six-digit code of a bank and branch in the United Kingdom.","iban":"International Bank Account Number.","bban":"Basic Bank Account Number, the country-specific format of an account number.","accountNumber":"Account number that the bank assigns, unique within the bank or the branch.","pan":"Primary Account Number, the number of a credit or debit card.","email":"Email address that identifies the account.","msisdn":"Mobile phone number that identifies the account.","virtualAccountId":"Identifier of a virtual sub-account of a main account.","globalWallet":"Identifier of a digital wallet that holds and pays in several currencies.","clabe":"CLABE, the 18-digit standardized bank code of a Mexican bank account.","bitcoinAddress":"Single Bitcoin address, the only address the account tracks.","bitcoinXpub":"Bitcoin extended public key (xpub, ypub or zpub), from which the addresses of the wallet are derived.","other":"Another kind of identifier."}},"value":{"description":"Value of the identifier, for example the IBAN or the BIC.","type":"string"}},"required":["type","value"],"additionalProperties":false}},"currency":{"type":"string"}},"required":["bankAccountId","name","accountIdentifications","currency"],"additionalProperties":false},"creditor":{"type":"object","properties":{"counterpartyId":{"type":"string","examples":["Cp2nG7vB4xLq9wRt5hMz"],"description":"ID of the counterparty."},"counterpartyCashAccountId":{"type":"string"},"name":{"type":"string"},"accountIdentifications":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["bic","sortCode","iban","bban","accountNumber","pan","email","msisdn","virtualAccountId","globalWallet","clabe","bitcoinAddress","bitcoinXpub","other"],"description":"Kind of identifier of a bank account or of its bank.","x-enumDescriptions":{"bic":"Bank Identifier Code of the bank.","sortCode":"Six-digit code of a bank and branch in the United Kingdom.","iban":"International Bank Account Number.","bban":"Basic Bank Account Number, the country-specific format of an account number.","accountNumber":"Account number that the bank assigns, unique within the bank or the branch.","pan":"Primary Account Number, the number of a credit or debit card.","email":"Email address that identifies the account.","msisdn":"Mobile phone number that identifies the account.","virtualAccountId":"Identifier of a virtual sub-account of a main account.","globalWallet":"Identifier of a digital wallet that holds and pays in several currencies.","clabe":"CLABE, the 18-digit standardized bank code of a Mexican bank account.","bitcoinAddress":"Single Bitcoin address, the only address the account tracks.","bitcoinXpub":"Bitcoin extended public key (xpub, ypub or zpub), from which the addresses of the wallet are derived.","other":"Another kind of identifier."}},"value":{"description":"Value of the identifier, for example the IBAN or the BIC.","type":"string"}},"required":["type","value"],"additionalProperties":false}},"currency":{"type":"string"},"address":{"type":"object","properties":{"country":{"type":"string","description":"ISO 3166-1 alpha-2 country code","examples":["CH"]},"postCode":{"examples":["8001"],"description":"Post code of the address.","type":"string","minLength":2},"townName":{"description":"Name of the town or city.","examples":["Zürich"],"type":"string","minLength":1},"streetName":{"description":"Name of the street.","examples":["Bahnhofstrasse"],"type":"string"},"buildingNumber":{"description":"Number of the building in the street.","examples":["10"],"type":"string"},"name":{"description":"Name of the building or place.","examples":["Haus zur Linde"],"type":"string"},"sortingCode":{"description":"Additional sorting code of the postal service, used in a few countries such as France.","type":"string"},"postBox":{"description":"Post office box.","examples":["Postfach 1234"],"type":"string"},"administrativeArea":{"description":"Region of the country, such as a canton or a state.","examples":["Zürich"],"type":"string"},"recipients":{"type":"array","items":{"type":"string"},"description":"Names of the people the address is for.","examples":[["Anna Meier"]]},"organization":{"description":"Name of the organization at the address.","examples":["Muster AG"],"type":"string"},"source":{"type":"array","items":{"type":"string"},"description":"Text the address was read from, one item per line.","examples":[["Muster AG","Bahnhofstrasse 10","8001 Zürich"]]}},"additionalProperties":false}},"required":["counterpartyId","counterpartyCashAccountId","name","accountIdentifications","currency"],"additionalProperties":false}},"required":["executionDate","amount","currency","debtor","creditor"],"additionalProperties":false}},"required":["firestoreId","authorizationStatus","products","features","serviceProviderId","workspaceId","creation","paymentData"],"additionalProperties":false},"AttachmentUploadUrl":{"type":"object","properties":{"uploadUrl":{"type":"string","format":"uri"},"contentType":{"type":"string"},"size":{"type":"integer","exclusiveMinimum":0},"attachmentId":{"type":"string"}},"required":["uploadUrl","contentType","size","attachmentId"],"additionalProperties":false},"BatchCodingResult":{"type":"object","properties":{"results":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"entries":{"type":"array","items":{"type":"object","properties":{"description":{"type":"string"},"taxRate":{"type":"number"},"taxMilliAmount":{"type":"number","minimum":0},"taxCode":{"type":"string"},"taxId":{"type":"string"},"taxAccount":{"type":"string"},"signedMilliAmount":{"type":"number"},"account":{"type":"string"},"ledgerEntryId":{"type":"string","examples":["Le3wN8qT5xKr1mZv7pBd"],"description":"ID of the ledger entry."},"order":{"type":"integer","minimum":0},"accountSource":{"type":"string","enum":["manual","ai","bank_account","import","rule"]}},"required":["signedMilliAmount","ledgerEntryId","order"],"additionalProperties":false}},"accountingStatus":{"type":"string","enum":["pending","partially_booked","booked"]},"bankTransactionId":{"type":"string","examples":["trx_MjAyNjAzMDJUMDk"],"description":"ID of the bank transaction."},"status":{"type":"string","const":"approved"}},"required":["entries","accountingStatus","bankTransactionId","status"],"additionalProperties":false},{"type":"object","properties":{"bankTransactionId":{"type":"string","examples":["trx_MjAyNjAzMDJUMDk"],"description":"ID of the bank transaction."},"status":{"type":"string","const":"skipped"},"reason":{"type":"string","enum":["out-of-date","cannot-accept-suggestion"]}},"required":["bankTransactionId","status","reason"],"additionalProperties":false},{"type":"object","properties":{"bankTransactionId":{"type":"string","examples":["trx_MjAyNjAzMDJUMDk"],"description":"ID of the bank transaction."},"status":{"type":"string","const":"failed"},"errorCode":{"type":"string"}},"required":["bankTransactionId","status","errorCode"],"additionalProperties":false}]}}},"required":["results"],"additionalProperties":false},"CashCodingResult":{"type":"object","properties":{"entries":{"type":"array","items":{"type":"object","properties":{"description":{"type":"string"},"taxRate":{"type":"number"},"taxMilliAmount":{"type":"number","minimum":0},"taxCode":{"type":"string"},"taxId":{"type":"string"},"taxAccount":{"type":"string"},"signedMilliAmount":{"type":"number"},"account":{"type":"string"},"ledgerEntryId":{"type":"string","examples":["Le3wN8qT5xKr1mZv7pBd"],"description":"ID of the ledger entry."},"order":{"type":"integer","minimum":0},"accountSource":{"type":"string","enum":["manual","ai","bank_account","import","rule"]}},"required":["signedMilliAmount","ledgerEntryId","order"],"additionalProperties":false}},"accountingStatus":{"type":"string","enum":["pending","partially_booked","booked"]}},"required":["entries","accountingStatus"],"additionalProperties":false},"ExportedFile":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether the file was produced; a failed file has no content."},"fromDate":{"description":"First day of the period the file covers.","type":"string","examples":["2026-03-02"]},"toDate":{"description":"Last day of the period the file covers, included.","type":"string","examples":["2026-03-02"]},"mimeType":{"description":"Media type of the file.","examples":["text/csv"],"type":"string"},"name":{"description":"Name of the file.","type":"string"},"content":{"description":"Content of the file, as text.","type":"string"},"encoding":{"description":"Character encoding of the file, when it is not UTF-8.","examples":["win1252"],"type":"string"}},"required":["success"],"additionalProperties":false},"FileDownloadUrl":{"type":"object","properties":{"downloadUrl":{"type":"string","description":"Time-limited URL to download the file."},"expiresAt":{"type":"string","examples":["2026-03-02T09:30:00.000Z"],"description":"Instant after which `downloadUrl` stops working."}},"required":["downloadUrl","expiresAt"],"additionalProperties":false},"FileUploadUrl":{"type":"object","properties":{"uploadUrl":{"type":"string","format":"uri"},"contentType":{"type":"string"},"size":{"type":"integer","exclusiveMinimum":0}},"required":["uploadUrl","contentType","size"],"additionalProperties":false},"InvoiceMatch":{"type":"object","properties":{"target":{"type":"string"},"data":{"type":"object","properties":{"confidence":{"type":"number"}},"required":["confidence"],"additionalProperties":false}},"required":["target","data"],"additionalProperties":false},"LedgerEntryExportCheck":{"type":"object","properties":{"uncodedBankTransactionIds":{"type":"array","items":{"type":"string"}},"uncodedLedgerEntryIdsPerBankTransaction":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}},"imbalancedBankTransactionIds":{"type":"array","items":{"type":"string"}},"bankTransactionCount":{"type":"number"},"ledgerEntryCount":{"type":"number"}},"required":["uncodedBankTransactionIds","uncodedLedgerEntryIdsPerBankTransaction","imbalancedBankTransactionIds","bankTransactionCount","ledgerEntryCount"],"additionalProperties":false},"UserPermissions":{"type":"object","properties":{"v":{"type":"integer"},"ws":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string","enum":["ws.owner","ws.admin","ws.member","ws.viewer","ws.support","ba.owner","ba.admin","ba.member"],"description":"Role of the user, which sets its permissions in a workspace (`ws.`) or a billing account (`ba.`).","x-enumDescriptions":{"ws.owner":"Owner of the workspace, with every permission, including deleting the workspace and managing owners.","ws.admin":"Administrator of the workspace, with every permission except managing owners and deleting the workspace or its files.","ws.member":"Member of the workspace, who works on its transactions, invoices, payments and accounting but manages neither its bank accounts nor its members.","ws.viewer":"Viewer of the workspace, a role that grants no permission.","ws.support":"Sway support access, granted when you invite the Sway bot.","ba.owner":"Owner of the billing account, with every permission, including deleting it.","ba.admin":"Administrator of the billing account, who reads and updates it but cannot delete it.","ba.member":"Member of the billing account, who can only read it."}}}},"ba":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string","enum":["ws.owner","ws.admin","ws.member","ws.viewer","ws.support","ba.owner","ba.admin","ba.member"],"description":"Role of the user, which sets its permissions in a workspace (`ws.`) or a billing account (`ba.`).","x-enumDescriptions":{"ws.owner":"Owner of the workspace, with every permission, including deleting the workspace and managing owners.","ws.admin":"Administrator of the workspace, with every permission except managing owners and deleting the workspace or its files.","ws.member":"Member of the workspace, who works on its transactions, invoices, payments and accounting but manages neither its bank accounts nor its members.","ws.viewer":"Viewer of the workspace, a role that grants no permission.","ws.support":"Sway support access, granted when you invite the Sway bot.","ba.owner":"Owner of the billing account, with every permission, including deleting it.","ba.admin":"Administrator of the billing account, who reads and updates it but cannot delete it.","ba.member":"Member of the billing account, who can only read it."}}}}},"required":["v","ws","ba"],"additionalProperties":false},"BankTransactionExport":{"type":"object","properties":{"started":{"type":"boolean"},"workspaceId":{"type":"string"},"bankAccountId":{"type":"string"},"files":{"type":"array","items":{"type":"object","properties":{"exportId":{"type":"string"},"targetFileName":{"type":"string"},"downloadUrl":{"type":"string","format":"uri","description":"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."},"expiresAt":{"type":"string","examples":["2026-03-02T09:30:00.000Z"],"description":"Instant after which downloadUrl stops working."}},"required":["exportId","targetFileName","downloadUrl","expiresAt"],"additionalProperties":false}}},"required":["started","workspaceId","bankAccountId","files"],"additionalProperties":false},"InvoiceExport":{"type":"object","properties":{"started":{"type":"boolean"},"workspaceId":{"type":"string"},"files":{"type":"array","items":{"type":"object","properties":{"exportId":{"type":"string"},"targetFileName":{"type":"string"},"downloadUrl":{"type":"string","format":"uri","description":"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."},"expiresAt":{"type":"string","examples":["2026-03-02T09:30:00.000Z"],"description":"Instant after which downloadUrl stops working."}},"required":["exportId","targetFileName","downloadUrl","expiresAt"],"additionalProperties":false}}},"required":["started","workspaceId","files"],"additionalProperties":false},"LedgerEntryExport":{"type":"object","properties":{"started":{"type":"boolean"},"workspaceId":{"type":"string"},"bankAccountId":{"type":"string"},"files":{"type":"array","items":{"type":"object","properties":{"exportId":{"type":"string"},"targetFileName":{"type":"string"},"downloadUrl":{"type":"string","format":"uri","description":"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."},"expiresAt":{"type":"string","examples":["2026-03-02T09:30:00.000Z"],"description":"Instant after which downloadUrl stops working."}},"required":["exportId","targetFileName","downloadUrl","expiresAt"],"additionalProperties":false}}},"required":["started","workspaceId","bankAccountId","files"],"additionalProperties":false},"Error":{"type":"object","properties":{"error":{"type":"object","description":"The error.","properties":{"code":{"type":"string","description":"Machine-readable error code.","enum":["ok","cancelled","unknown","invalid-argument","deadline-exceeded","not-found","already-exists","permission-denied","resource-exhausted","failed-precondition","aborted","out-of-range","unimplemented","internal","unavailable","data-loss","unauthenticated"],"x-enumDescriptions":{"ok":"Not used in error responses.","cancelled":"The request was cancelled before it completed.","unknown":"An unknown error occurred.","invalid-argument":"A parameter or the request body is invalid.","deadline-exceeded":"The request did not complete in time.","not-found":"The resource does not exist.","already-exists":"The resource already exists.","permission-denied":"The token lacks the required scope, or the user lacks the permission.","resource-exhausted":"A quota or a rate limit is reached.","failed-precondition":"The resource is not in the state the operation requires.","aborted":"The operation was aborted, usually by a concurrent change.","out-of-range":"A value is outside its valid range.","unimplemented":"The operation is not supported.","internal":"An internal error occurred.","unavailable":"The service is temporarily unavailable.","data-loss":"Data was lost or corrupted.","unauthenticated":"The token is missing, invalid or expired."}},"message":{"type":"string","description":"Human-readable description of the error."},"data":{"description":"Details of the error, when available."}},"required":["code","message"]}},"required":["error"]}},"parameters":{"WorkspaceId":{"name":"workspaceId","in":"path","required":true,"description":"ID of the workspace.","schema":{"type":"string","minLength":1,"pattern":"^[^/]+$"},"example":"Wk7fQ2xR9bLm4tZp8sNv"},"BankAccountId":{"name":"bankAccountId","in":"path","required":true,"description":"ID of the bank account.","schema":{"type":"string","minLength":1,"pattern":"^[^/]+$"},"example":"bacc_Q0gzMTA4NzY1NDM"},"TransactionId":{"name":"transactionId","in":"path","required":true,"description":"ID of the bank transaction.","schema":{"type":"string","minLength":1,"pattern":"^[^/]+$"},"example":"trx_MjAyNjAzMDJUMDk"},"AttachmentId":{"name":"attachmentId","in":"path","required":true,"description":"ID of the attachment, returned with its upload URL.","schema":{"type":"string","minLength":1,"pattern":"^[^/]+$"},"example":"At5kV8pW2nQx7rLs3mYd"},"MembershipId":{"name":"membershipId","in":"path","required":true,"description":"ID of the membership, the same as the user ID of the member.","schema":{"type":"string","minLength":1,"pattern":"^[^/]+$"},"example":"Xq3vT9mB2kLpR7sN4wYc8dZf1aHj"},"InvitationId":{"name":"invitationId","in":"path","required":true,"description":"ID of the invitation.","schema":{"type":"string","minLength":1,"pattern":"^[^/]+$"},"example":"In8rD4sF7jPw2yKm6tQb"},"ConsentId":{"name":"consentId","in":"path","required":true,"description":"ID of the read consent.","schema":{"type":"string","minLength":1,"pattern":"^[^/]+$"},"example":"rcons_UkVBRC0wMDQy"},"CounterpartyId":{"name":"counterpartyId","in":"path","required":true,"description":"ID of the counterparty.","schema":{"type":"string","minLength":1,"pattern":"^[^/]+$"},"example":"Cp2nG7vB4xLq9wRt5hMz"},"ChartOfAccountId":{"name":"chartOfAccountId","in":"path","required":true,"description":"ID of the chart of accounts.","schema":{"type":"string","minLength":1,"pattern":"^[^/]+$"},"example":"Ca6yH3kN8pTr1vWx4bQs"},"AccountId":{"name":"accountId","in":"path","required":true,"description":"Code of the account in the chart of accounts.","schema":{"type":"string","minLength":1,"pattern":"^[^/]+$"},"example":"1020"},"GroupId":{"name":"groupId","in":"path","required":true,"description":"ID of the account group in the chart of accounts.","schema":{"type":"string","minLength":1,"pattern":"^[^/]+$"},"example":"10"},"TaxTypeId":{"name":"taxTypeId","in":"path","required":true,"description":"ID of the tax type.","schema":{"type":"string","minLength":1,"pattern":"^[^/]+$"},"example":"Tt9mC5rL2wQz7nVb4kHp"},"ProductId":{"name":"productId","in":"path","required":true,"description":"ID of the product.","schema":{"type":"string","minLength":1,"pattern":"^[^/]+$"},"example":"Pr4wJ8tM1xNq6zRb3vKf"},"RuleId":{"name":"ruleId","in":"path","required":true,"description":"ID of the account coding rule.","schema":{"type":"string","minLength":1,"pattern":"^[^/]+$"},"example":"Ru7bX2kQ9mWp4tLz6nHc"},"ConditionId":{"name":"conditionId","in":"path","required":true,"description":"ID of the condition in the account coding rule.","schema":{"type":"string","minLength":1,"pattern":"^[^/]+$"},"example":"k3j9x2m7q1p"},"ActionId":{"name":"actionId","in":"path","required":true,"description":"ID of the action in the account coding rule.","schema":{"type":"string","minLength":1,"pattern":"^[^/]+$"},"example":"w8f4n1c6z5t"},"FileId":{"name":"fileId","in":"path","required":true,"description":"ID of the workspace file.","schema":{"type":"string","minLength":1,"pattern":"^[^/]+$"},"example":"Fl1qS6hV3nTx8mPc5wZr"},"InvoiceId":{"name":"invoiceId","in":"path","required":true,"description":"ID of the invoice.","schema":{"type":"string","minLength":1,"pattern":"^[^/]+$"},"example":"Iv5zP2nK7wRt3xMq9bLd"},"DraftPaymentId":{"name":"draftPaymentId","in":"path","required":true,"description":"ID of the draft payment.","schema":{"type":"string","minLength":1,"pattern":"^[^/]+$"},"example":"dpay_RFAtMjAyNjAzMDI"},"InitiatedPaymentId":{"name":"initiatedPaymentId","in":"path","required":true,"description":"ID of the initiated payment.","schema":{"type":"string","minLength":1,"pattern":"^[^/]+$"},"example":"ipay_SVAtMjAyNjAzMDI"},"BillingAccountId":{"name":"billingAccountId","in":"path","required":true,"description":"ID of the billing account.","schema":{"type":"string","minLength":1,"pattern":"^[^/]+$"},"example":"Bl6tW3mQ8xKp2vNr7zHs"},"Currency":{"name":"currency","in":"path","required":true,"description":"Base currency, as an ISO 4217 code.","schema":{"type":"string","pattern":"^[A-Z]{3}$"},"example":"CHF"},"Limit":{"name":"limit","in":"query","description":"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.","schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"example":20},"StartAfter":{"name":"startAfter","in":"query","description":"Cursor of the page to return: the `nextCursor` of the previous page.","schema":{"type":"string","pattern":"^[A-Za-z0-9_-]*$","maxLength":4096},"example":"eyJ2YWx1ZSI6IjIwMjYtMDMtMDJUMDk6MzA6MDAuMDAwWiIsImlkIjoiSGsyeE5xOHZSNHRZdzZaYlBqM2MiLCJ0eXBlIjoiZGF0ZSJ9"},"Ids":{"name":"ids","in":"query","description":"Comma-separated IDs of the items to return, up to 30. When set, `limit`, `startAfter` and the filters are ignored.","style":"form","explode":false,"schema":{"type":"array","items":{"type":"string","minLength":1,"pattern":"^[^/]+$"},"minItems":1,"maxItems":30},"example":["Hk2xNq8vR4tYw6ZbPj3c","Rm5tB8wQ2zLx7nVc4pKs"]}},"responses":{"BadRequest":{"description":"The request is invalid, for example a missing or malformed parameter.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"default":{"summary":"The request is invalid, for example a missing or malformed parameter.","value":{"error":{"code":"invalid-argument","message":"Invalid request"}}}}}}},"Unauthorized":{"description":"The token is missing, invalid or expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"default":{"summary":"The token is missing, invalid or expired.","value":{"error":{"code":"unauthenticated","message":"Invalid or expired credentials"}}}}}}},"Forbidden":{"description":"The token lacks the required scope, or the user lacks the permission.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"default":{"summary":"The token lacks the required scope, or the user lacks the permission.","value":{"error":{"code":"permission-denied","message":"Missing required scope: invoices:read"}}}}}}},"NotFound":{"description":"The resource does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"default":{"summary":"The resource does not exist.","value":{"error":{"code":"not-found","message":"Resource not found"}}}}}}},"InternalError":{"description":"An unexpected error occurred on the server.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"default":{"summary":"An unexpected error occurred on the server.","value":{"error":{"code":"internal","message":"An internal error occurred"}}}}}}}}}}