LedgerBee Developer
  • Getting started
  • Conventions
  • Products
  • Advisor firms
  • Configuration
  • API Reference
Information
Accounts
    List accountsgetCreate an accountpostGet an accountgetDelete an accountdeleteUpdate an accountpatch
Advisor Authority Extracts
    Submit authority extract data for an advisor firm's clientspost
Advisor Clients
    List the advisor firm's clientsget
API Key
    Get current API keyget
Authority Extracts
    Submit authority extract datapost
Bank Reconciliations
    Reconcile bank lines against entriespostUndo a bank reconciliationpostCheck what undoing a reconciliation would dopostReconcile a batch of matchespostCheck what reconciling a batch of matches would dopostCheck what reconciling bank lines against entries would dopost
Bank Transactions
    List bank linesgetGet a bank linegetDismiss bank lines from reconciliationpostCheck which bank lines a dismiss would changepostRestore dismissed bank lines to reconciliationpostCheck which bank lines a restore would changepost
Billing Groups
    Form a billing grouppostGet a billing groupgetAdd members to a billing grouppostRemove a member from a billing groupdeleteCheck billing group eligibilitypost
Budgets
    List budgetsgetGet a budgetgetGet the budget vs actuals comparisongetExport a budget's Excel workbookgetOverwrite a budget's figures from an edited workbookpostList a budget's frozen baselinesgetGet a frozen baseline with its snapshot cellsgetList a budget's re-baseline proposalsgetList a budget's scenariosgetResolve a budget's grid under a scenariogetGet the variance report vs a frozen baselinegetGet the runway headlineget
Checkout
    Confirm the checkoutpostQuote a first periodpostIntegration readinessgetMint a checkout sessionpostRehydrate a sessiongetRelease the card hold (edit-after-card)postPoll card statusgetOpen the card windowpostOpen a card window for a live subscriptionpost
Company
    Get company detailsget
Connected app OAuth
    JSON Web Key Set used to verify OAuth access-token signaturesgetRFC 8414 authorization-server metadata for the connected-app OAuth servergetRFC 9728 protected-resource metadata for an MCP resourcegetRFC 9728 protected-resource metadata for an MCP resourcegetOpenID Connect discovery document for the connected-app OAuth serverget
Credit Note Links
    Link a credit note to the invoice it creditspostCheck a credit note’s links and the invoices it can be linked topostDetach a credit note from the invoices it is applied topost
Credit Notes
    List credit notesgetCreate a credit notepostGet a credit notegetGet the delivery status of a credit notegetDownload the credit note PDFgetSend a credit note to the customerpostCredit a whole invoicepost
Customers
    List customersgetCreate a customerpostGet a customergetDelete a customerdeleteUpdate a customerpatchList a customer's contactsgetList a customer's departmentsgetList customer groupsget
Dimensions
    List all dimensionsgetCreate a new dimension categorypostGet a dimensiongetUpdate a dimension categoryputDelete a dimension categorydeleteList distribution keys (paginated)getCreate a distribution keypostGet a distribution keygetList dimension values (paginated)getCreate a new dimension valuepostUpdate a dimension valueputDelete a dimension valuedelete
Discounts
    List discountsgetCreate a discountpostGet a discountgetDelete a discountdeleteUpdate a discountpatchSet a discount's amount in one currencyputRemove a discount's amount in one currencydeleteCheck whether a discount applies to a product for a customer on a daygetAssign a discountpostRemove an assignmentdeleteUpdate an assignmentpatchList a discount's codesgetAdd a code to a discountpostDelete a codedeleteUpdate a codepatchList the discounts that apply to a product for a customer on a daygetCheck a cartpostLook up a discount codeget
Document Templates
    List document templatesget
Document Upload Links
    Upload a file through a minted linkpost
Download Links
    Mint a download link for a document PDFgetDownload a minted linkget
Draft Journal Entries
    Create multiple draft journal entries in batchpostList draft journal entriesgetCreate a draft journal entrypostGet a draft journal entrygetDelete a draft journal entrydeleteBook a draft journal entrypost
Draft Journal Entries (v2)
    Create draft journal entries in batch (v2)postList draft journal entries (v2)getCreate a draft journal entry (v2)postGet a draft journal entry (v2)getDelete a draft journal entry (v2)deleteUpdate a draft journal entry (v2)patchGet attachments for a draft journal entry (v2)getAdd a document to a draft journal entry (v2)postRemove a document from a draft journal entry (v2)deleteBook a draft journal entry (v2)post
Entitlements
    List entitlementsgetCreate an entitlementpostGet an entitlementgetDelete an entitlementdeleteUpdate an entitlementpatch
Invoices
    List invoicesgetCreate a draft invoicepostGet an invoicegetDelete a draft invoicedeleteUpdate an unsent invoicepatchGet the delivery status of an invoicegetDownload the invoice PDFgetSend an invoice to the customerpost
Journal Categories
    List journal categoriesgetCreate a journal categorypostUpdate a journal categoryputDelete a journal categorydelete
Journal Entries
    List journal entriesgetGet a journal entrygetUpdate a journal entry — correct the reference and/or set your external system idpatchGet attachments for a journal entrygetAdd a document to a journal entrypostRemove a document from a journal entrydeletePreview a correction without posting itpostMove postings to different accounts, keeping the document intactpostRebuild the entry a reversal undid, as a draftpostPreview rebuilding the entry a reversal undidpostReverse a posted entry and open a draft to re-enter itpostReverse posted journal entries in batchpostPreview reversing posted journal entries in batchpostReverse a posted journal entrypostPreview reversing a posted journal entrypost
Journal Entries (v2)
    Create a journal entry (v2)postCreate journal entries in batch (v2)post
MCP
    LedgerBee Developer MCP Serverpost
Meters
    List meter subscriptions by IDgetReport usagepostList meter subscriptions by nameget
Open Entries
    List a counterparty’s open entriesget
Order Confirmations
    List order confirmationsgetCreate a draft order confirmationpostGet an order confirmationgetUpdate a draft order confirmationpatchConvert an order confirmation into an invoicepostDownload an order confirmation as PDFgetSend an order confirmationpost
Payment Methods
    List saved payment methods for a customergetCancel a saved card on the payment providerdeleteUnassign a payment method from a customerdeleteGenerate a link for the customer to save a card for future paymentspostSet a saved payment method as the customer defaultput
Portal Plans
    List the full plan cataloguegetGet a plangetResolve the gated pricing catalogue for an identified buyer (partner display)post
Portal SSO
    Get a tenant's SSO signing keys (JWKS)getMint a checkout-vouch token (partner-vouched anonymous checkout)postMint a customer-portal SSO handoff referencepostProvision a customer + grant portal access (partner JIT provisioning)postRevoke (force-refresh) a user's customer-portal sessionspost
Product Groups
    List product groupsgetCreate a product grouppostGet a product groupgetDelete a product groupdeleteUpdate a product grouppatch
Product Prices
    Create a product pricepostGet a product pricegetDelete a product pricedeleteUpdate a product pricepatchActivate a product pricepostArchive a product pricepostDisable a product pricepostSet a price as the product defaultpost
Products
    List productsgetCreate a productpostGet a productgetDelete a productdeleteUpdate a productpatchArchive a productpost
Projects
    List all projectsgetCreate or update a project by external referenceputCreate a projectpostGet a projectgetUpdate a projectputGet project profitgetAdd a subprojectpostUpdate a subprojectputDelete a subprojectdelete
Quotes
    List quotesgetCreate a draft quotepostGet a quotegetUpdate a draft quotepatchConvert a quotepostDownload a quote as PDFgetSend a quotepost
Settlements
    List a counterparty’s settlementsgetSettle open entries against each otherpostGet a settlementgetUndo a settlementpostCheck what undoing a settlement would dopostCheck what settling these entries would dopost
Shipments
    List shipmentsgetCreate a shipment from an orderpostGet a shipmentgetCancel a shipmentpostDispatch a shipmentpost
Stock
    List stock movementsgetList on-hand stockgetOn-hand for one productget
Subscriptions
    List customer subscriptionsgetAssign a subscription to a customerpostGet a customer subscription by its stable idgetUpdate a customer subscriptionpatchAdd an add-on to a customer subscriptionpostAttach existing subscriptions as add-onspostCheck whether subscriptions can become add-onspostChange the products on a customer subscriptionpostRetry a failed card paymentpostList a subscription's pending scheduled changesgetCancel a single pending scheduled changedeleteGet a subscription's unbilled usagegetCancel a customer subscriptionpostList subscription plansgetCreate a subscription planpostArchive a subscription planpost
Suppliers
    List suppliersgetCreate a supplierpostDelete a supplierdeleteList supplier contactsgetList supplier departmentsgetList supplier groupsget
VAT Codes
    List VAT codesgetCreate a VAT codepostGet a VAT codegetDelete a VAT codedeleteUpdate a VAT codepatch
VAT periods
    Record a VAT return filed outside LedgerBeepostPreview recording a VAT return filed outside LedgerBeepostSettle a filed VAT periodpostPreview a VAT period settlementpost
Vendors
    List vendorsgetCreate a vendorpostList vendor contactsgetList vendor departmentsgetList vendor groupsget
Webhook Endpoints
    List webhook endpointsgetCreate a webhook endpointpostRetrieve a webhook endpointgetUpdate a webhook endpointputDelete a webhook endpointdeleteRoll the signing secretpostSend a test eventpost
Schemas
LedgerBee Public API
LedgerBee Public API

Accounts

Download schema

Account management endpoints


List accounts

GET
https://api.ledgerbee.com/api
/v1/accounts
x-api-key (header)
or
OAuth 2.0

Credential: a company's API key or OAuth token.

Retrieves your company's chart of accounts. The list is sorted by accountNumber ascending unless sortBy and sortOrder say otherwise; rows that tie on publicAccountId or name are ordered by accountNumber. Pass an account's id as accountId when creating journal entries or draft journal entries, or to filter the journal-entry list.

Results are cached for 5 seconds. A create, update or delete through this API drops the cached list, so a read that follows the write reflects it; a list read that was already in flight during the write can serve the previous rows for up to 5 seconds.

Required Scope

  • accounts-read

List accounts › query Parameters

sortBy
​string · enum

Field to sort by. Rows that tie on publicAccountId or name are ordered by accountNumber, which is unique within the company.

Enum values:
accountNumber
publicAccountId
name
Default: accountNumber
sortOrder
​string · enum

Sort direction

Enum values:
ASC
DESC
Default: ASC

List accounts › Responses

List of accounts for the company

​AccountResponse[]
AccountResponse
id
​string · required

The unique identifier of the account

Example: 550e8400-e29b-41d4-a716-446655440000
name
​string · required

Name of the account

Example: Skyldig AM-bidrag
accountNumber
​number · required

Account type number

Example: 1000
publicAccountId
​number · required

Public account id that the account maps to

Example: 1000
ledgerType
​string · enum · required

Type of ledger account. Only BALANCE_SHEET and PROFIT_AND_LOSS accounts can be used in journal entries.

Enum values:
BALANCE_SHEET
HEADING_BREAK
HEADING
PROFIT_AND_LOSS
TOTAL_FROM
TOTAL_INTERVALS
Example: BALANCE_SHEET
debitCredit
​string · enum · required

The side a journal-entry line on this account pre-selects: debit or credit. This is the Debit/Credit choice on the account form. It does not decide how a balance is reported; accountClassification does.

Enum values:
debit
credit
Example: debit
requiredDimensionIds
​string[] · required

IDs of the dimensions this account requires: every journal entry line posting to the account must carry a value from each of them, or the entry is refused with JOURNAL_TAG_REQUIRED_DIMENSION_MISSING. Empty when the account requires none. This is the account setting as stored: a dimension that has since been deactivated stays listed and is not enforced until it is active again, so match the ids against the dimensions list, which returns active dimensions only.

Example: ["0192f3a4-5b6c-7d8e-9f01-23456789abcd"]
accountClassification
​string | null · enum

Account classification (ASSET, LIABILITY, EQUITY, REVENUE, EXPENSE)

Enum values:
ASSET
LIABILITY
EQUITY
REVENUE
EXPENSE
Example: ASSET
controlAccountType
​string | null · enum

Control account type. ACCOUNTS_RECEIVABLE requires customerId on journal entries, ACCOUNTS_PAYABLE requires vendorId. Null for regular accounts.

Enum values:
ACCOUNTS_RECEIVABLE
ACCOUNTS_PAYABLE
Example: null
vatCodeId
​string | null

VAT code applied by default to journal-entry lines on this account, or null

Example: 550e8400-e29b-41d4-a716-446655440000
GET/v1/accounts
curl https://api.ledgerbee.com/api/v1/accounts \ --header 'x-api-key: <api-key>'
Example Responses
[ { "id": "550e8400-e29b-41d4-a716-446655440000", "name": "Skyldig AM-bidrag", "accountNumber": 1000, "publicAccountId": 1000, "ledgerType": "BALANCE_SHEET", "accountClassification": "ASSET", "controlAccountType": null, "debitCredit": "debit", "vatCodeId": "550e8400-e29b-41d4-a716-446655440000", "requiredDimensionIds": [ "0192f3a4-5b6c-7d8e-9f01-23456789abcd" ] } ]
json
application/json

Create an account

POST
https://api.ledgerbee.com/api
/v1/accounts
x-api-key (header)
or
OAuth 2.0

Credential: a company's API key or OAuth token.

Creates an account in the chart of accounts. The account number must be free within the company (409 LEDGER_ACCOUNT_NUMBER_ALREADY_EXISTS otherwise).

A BALANCE_SHEET or PROFIT_AND_LOSS account states its accountClassification; a heading or total account needs none. A control account's classification has to fit its tag: ACCOUNTS_RECEIVABLE is an asset, ACCOUNTS_PAYABLE a liability (400 LEDGER_CONTROL_ACCOUNT_CLASSIFICATION_MISMATCH otherwise).

The account opens with a zero balance; an opening balance is posted as a journal entry.

Required Scope

  • accounts-write

Create an account › Headers

x-api-idempotency-key
​string · maxLength: 255

Optional idempotency key for safely retrying mutating requests.

Create an account › Request Body

CreateAccountRequest
name
​string · required

Name of the account

Example: Software subscriptions
accountNumber
​number · required

Account number, unique within the company

Example: 3120
ledgerType
​string · enum · required

Kind of account. Only BALANCE_SHEET and PROFIT_AND_LOSS accounts take postings; HEADING, HEADING_BREAK, TOTAL_FROM and TOTAL_INTERVALS structure the chart.

Enum values:
BALANCE_SHEET
HEADING_BREAK
HEADING
PROFIT_AND_LOSS
TOTAL_FROM
TOTAL_INTERVALS
Example: PROFIT_AND_LOSS
accountClassification
​string · enum

Classification of a postable account; required whenever the request sets ledgerType to BALANCE_SHEET or PROFIT_AND_LOSS. Decides which statement the account belongs to and which side a journal-entry line on it pre-selects. It cannot be cleared.

Enum values:
ASSET
LIABILITY
EQUITY
REVENUE
EXPENSE
Example: EXPENSE
controlAccountType
​string | null · enum

Marks a control account. Lines on an ACCOUNTS_RECEIVABLE account need a customerId, lines on an ACCOUNTS_PAYABLE account a supplierId. The classification must fit: receivable is an ASSET, payable a LIABILITY. Null clears it.

Enum values:
ACCOUNTS_RECEIVABLE
ACCOUNTS_PAYABLE
Example: null
debitCredit
​string · enum

The side a journal-entry line on this account pre-selects: debit or credit. Omitted on create, it follows accountClassification (ASSET and EXPENSE pre-select debit, the rest credit); an account with no classification, which only a heading or total account can be, pre-selects debit. It cannot be cleared.

Enum values:
debit
credit
Example: debit
vatCodeId
​string | null

VAT code applied by default to journal-entry lines on this account. Null clears it.

Example: 550e8400-e29b-41d4-a716-446655440000
currency
​string

Currency the account is kept in, as an ISO 4217 code. Applies to a BALANCE_SHEET account only; every other account is kept in the company's base currency and the field is ignored. Moving an account off BALANCE_SHEET resets it to the base currency.

Example: EUR
tags
​string[] · maxItems: 25

Free-form tags for grouping accounts (at most 25, each at most 50 characters)

Example: ["operating"]
mapsTo
​number | null

The account number this account reports under. When set, publicAccountId reports it instead of accountNumber. Null clears it.

Example: 1000
totalFrom
​number

For a TOTAL_FROM account: the first account number to sum from; the total runs up to the account's own number. Required whenever the request sets ledgerType to TOTAL_FROM.

Example: 1000
​AccountInterval[] · maxItems: 50

For a TOTAL_INTERVALS account: the account-number ranges to sum (at most 50). Required whenever the request sets ledgerType to TOTAL_INTERVALS.

Create an account › Responses

Account created successfully

AccountDetailResponse
id
​string · required

The unique identifier of the account

Example: 550e8400-e29b-41d4-a716-446655440000
name
​string · required

Name of the account

Example: Skyldig AM-bidrag
accountNumber
​number · required

Account type number

Example: 1000
publicAccountId
​number · required

Public account id that the account maps to

Example: 1000
ledgerType
​string · enum · required

Type of ledger account. Only BALANCE_SHEET and PROFIT_AND_LOSS accounts can be used in journal entries.

Enum values:
BALANCE_SHEET
HEADING_BREAK
HEADING
PROFIT_AND_LOSS
TOTAL_FROM
TOTAL_INTERVALS
Example: BALANCE_SHEET
debitCredit
​string · enum · required

The side a journal-entry line on this account pre-selects: debit or credit. This is the Debit/Credit choice on the account form. It does not decide how a balance is reported; accountClassification does.

Enum values:
debit
credit
Example: debit
requiredDimensionIds
​string[] · required

IDs of the dimensions this account requires: every journal entry line posting to the account must carry a value from each of them, or the entry is refused with JOURNAL_TAG_REQUIRED_DIMENSION_MISSING. Empty when the account requires none. This is the account setting as stored: a dimension that has since been deactivated stays listed and is not enforced until it is active again, so match the ids against the dimensions list, which returns active dimensions only.

Example: ["0192f3a4-5b6c-7d8e-9f01-23456789abcd"]
currency
​string · required

The currency the account is kept in (ISO 4217). A balance-sheet account may be kept in a foreign currency; every other account is kept in the company's base currency.

Example: DKK
tags
​string[] · required

Free-form tags for grouping accounts

Example: ["operating"]
createdAt
​string · date-time · required

When the account was created

updatedAt
​string · date-time · required

When the account was last changed

accountClassification
​string | null · enum

Account classification (ASSET, LIABILITY, EQUITY, REVENUE, EXPENSE)

Enum values:
ASSET
LIABILITY
EQUITY
REVENUE
EXPENSE
Example: ASSET
controlAccountType
​string | null · enum

Control account type. ACCOUNTS_RECEIVABLE requires customerId on journal entries, ACCOUNTS_PAYABLE requires vendorId. Null for regular accounts.

Enum values:
ACCOUNTS_RECEIVABLE
ACCOUNTS_PAYABLE
Example: null
vatCodeId
​string | null

VAT code applied by default to journal-entry lines on this account, or null

Example: 550e8400-e29b-41d4-a716-446655440000
mapsTo
​number | null

The account number this account reports under. When set, publicAccountId follows it.

Example: 1000
totalFrom
​number | null

For a TOTAL_FROM account: the first account number it sums from, up to the account's own number

Example: 1000
​array | null

For a TOTAL_INTERVALS account: the account-number ranges it sums

deactivatedAt
​string | null · date-time

When the account was deactivated, or null while it is active

POST/v1/accounts
curl https://api.ledgerbee.com/api/v1/accounts \ --request POST \ --header 'Content-Type: application/json' \ --header 'x-api-key: <api-key>' \ --data '{ "accountClassification": "EXPENSE", "controlAccountType": null, "debitCredit": "debit", "vatCodeId": "550e8400-e29b-41d4-a716-446655440000", "currency": "EUR", "tags": [ "operating" ], "mapsTo": 1000, "totalFrom": 1000, "intervals": [ { "from": 1000, "to": 1999 } ], "name": "Software subscriptions", "accountNumber": 3120, "ledgerType": "PROFIT_AND_LOSS" }'
Example Request Body
{ "accountClassification": "EXPENSE", "controlAccountType": null, "debitCredit": "debit", "vatCodeId": "550e8400-e29b-41d4-a716-446655440000", "currency": "EUR", "tags": [ "operating" ], "mapsTo": 1000, "totalFrom": 1000, "intervals": [ { "from": 1000, "to": 1999 } ], "name": "Software subscriptions", "accountNumber": 3120, "ledgerType": "PROFIT_AND_LOSS" }
json
application/json
Example Responses
{ "id": "550e8400-e29b-41d4-a716-446655440000", "name": "Skyldig AM-bidrag", "accountNumber": 1000, "publicAccountId": 1000, "ledgerType": "BALANCE_SHEET", "accountClassification": "ASSET", "controlAccountType": null, "debitCredit": "debit", "vatCodeId": "550e8400-e29b-41d4-a716-446655440000", "requiredDimensionIds": [ "0192f3a4-5b6c-7d8e-9f01-23456789abcd" ], "currency": "DKK", "tags": [ "operating" ], "mapsTo": 1000, "totalFrom": 1000, "intervals": [ { "from": 1000, "to": 1999 } ], "deactivatedAt": "2024-08-25T15:00:00Z", "createdAt": "2024-08-25T15:00:00Z", "updatedAt": "2024-08-25T15:00:00Z" }
json
application/json

Get an account

GET
https://api.ledgerbee.com/api
/v1/accounts/{accountId}
x-api-key (header)
or
OAuth 2.0

Credential: a company's API key or OAuth token.

Returns a single account with every field the write endpoints accept, so a read after a write shows what was stored.

Required Scope

  • accounts-read

Get an account › path Parameters

accountId
​string · required

Account ID

Get an account › Responses

Account details

AccountDetailResponse
id
​string · required

The unique identifier of the account

Example: 550e8400-e29b-41d4-a716-446655440000
name
​string · required

Name of the account

Example: Skyldig AM-bidrag
accountNumber
​number · required

Account type number

Example: 1000
publicAccountId
​number · required

Public account id that the account maps to

Example: 1000
ledgerType
​string · enum · required

Type of ledger account. Only BALANCE_SHEET and PROFIT_AND_LOSS accounts can be used in journal entries.

Enum values:
BALANCE_SHEET
HEADING_BREAK
HEADING
PROFIT_AND_LOSS
TOTAL_FROM
TOTAL_INTERVALS
Example: BALANCE_SHEET
debitCredit
​string · enum · required

The side a journal-entry line on this account pre-selects: debit or credit. This is the Debit/Credit choice on the account form. It does not decide how a balance is reported; accountClassification does.

Enum values:
debit
credit
Example: debit
requiredDimensionIds
​string[] · required

IDs of the dimensions this account requires: every journal entry line posting to the account must carry a value from each of them, or the entry is refused with JOURNAL_TAG_REQUIRED_DIMENSION_MISSING. Empty when the account requires none. This is the account setting as stored: a dimension that has since been deactivated stays listed and is not enforced until it is active again, so match the ids against the dimensions list, which returns active dimensions only.

Example: ["0192f3a4-5b6c-7d8e-9f01-23456789abcd"]
currency
​string · required

The currency the account is kept in (ISO 4217). A balance-sheet account may be kept in a foreign currency; every other account is kept in the company's base currency.

Example: DKK
tags
​string[] · required

Free-form tags for grouping accounts

Example: ["operating"]
createdAt
​string · date-time · required

When the account was created

updatedAt
​string · date-time · required

When the account was last changed

accountClassification
​string | null · enum

Account classification (ASSET, LIABILITY, EQUITY, REVENUE, EXPENSE)

Enum values:
ASSET
LIABILITY
EQUITY
REVENUE
EXPENSE
Example: ASSET
controlAccountType
​string | null · enum

Control account type. ACCOUNTS_RECEIVABLE requires customerId on journal entries, ACCOUNTS_PAYABLE requires vendorId. Null for regular accounts.

Enum values:
ACCOUNTS_RECEIVABLE
ACCOUNTS_PAYABLE
Example: null
vatCodeId
​string | null

VAT code applied by default to journal-entry lines on this account, or null

Example: 550e8400-e29b-41d4-a716-446655440000
mapsTo
​number | null

The account number this account reports under. When set, publicAccountId follows it.

Example: 1000
totalFrom
​number | null

For a TOTAL_FROM account: the first account number it sums from, up to the account's own number

Example: 1000
​array | null

For a TOTAL_INTERVALS account: the account-number ranges it sums

deactivatedAt
​string | null · date-time

When the account was deactivated, or null while it is active

GET/v1/accounts/{accountId}
curl https://api.ledgerbee.com/api/v1/accounts/:accountId \ --header 'x-api-key: <api-key>'
Example Responses
{ "id": "550e8400-e29b-41d4-a716-446655440000", "name": "Skyldig AM-bidrag", "accountNumber": 1000, "publicAccountId": 1000, "ledgerType": "BALANCE_SHEET", "accountClassification": "ASSET", "controlAccountType": null, "debitCredit": "debit", "vatCodeId": "550e8400-e29b-41d4-a716-446655440000", "requiredDimensionIds": [ "0192f3a4-5b6c-7d8e-9f01-23456789abcd" ], "currency": "DKK", "tags": [ "operating" ], "mapsTo": 1000, "totalFrom": 1000, "intervals": [ { "from": 1000, "to": 1999 } ], "deactivatedAt": "2024-08-25T15:00:00Z", "createdAt": "2024-08-25T15:00:00Z", "updatedAt": "2024-08-25T15:00:00Z" }
json
application/json

Delete an account

DELETE
https://api.ledgerbee.com/api
/v1/accounts/{accountId}
x-api-key (header)
or
OAuth 2.0

Credential: a company's API key or OAuth token.

Deletes an account that nothing refers to. An account with postings, a system role, a bank account, a default on a customer or supplier, or any other reference is refused with 409 LEDGER_DELETE_BLOCKED; the response details.blockers lists each reason with a count.

Required Scope

  • accounts-write

Delete an account › path Parameters

accountId
​string · required

Account ID

Delete an account › Headers

x-api-idempotency-key
​string · maxLength: 255

Optional idempotency key for safely retrying mutating requests.

Delete an account › Responses

Account deleted successfully

No data returned
DELETE/v1/accounts/{accountId}
curl https://api.ledgerbee.com/api/v1/accounts/:accountId \ --request DELETE \ --header 'x-api-key: <api-key>'
Example Responses
No example specified for this content type

Update an account

PATCH
https://api.ledgerbee.com/api
/v1/accounts/{accountId}
x-api-key (header)
or
OAuth 2.0

Credential: a company's API key or OAuth token.

Updates an account. Only the fields provided in the request are changed; send null to clear an optional field such as vatCodeId. name and accountNumber cannot be cleared (400 LEDGER_FIELD_NOT_CLEARABLE).

Required Scope

  • accounts-write

Update an account › path Parameters

accountId
​string · required

Account ID

Update an account › Headers

x-api-idempotency-key
​string · maxLength: 255

Optional idempotency key for safely retrying mutating requests.

Update an account › Request Body

UpdateAccountRequest
accountClassification
​string · enum

Classification of a postable account; required whenever the request sets ledgerType to BALANCE_SHEET or PROFIT_AND_LOSS. Decides which statement the account belongs to and which side a journal-entry line on it pre-selects. It cannot be cleared.

Enum values:
ASSET
LIABILITY
EQUITY
REVENUE
EXPENSE
Example: EXPENSE
controlAccountType
​string | null · enum

Marks a control account. Lines on an ACCOUNTS_RECEIVABLE account need a customerId, lines on an ACCOUNTS_PAYABLE account a supplierId. The classification must fit: receivable is an ASSET, payable a LIABILITY. Null clears it.

Enum values:
ACCOUNTS_RECEIVABLE
ACCOUNTS_PAYABLE
Example: null
debitCredit
​string · enum

The side a journal-entry line on this account pre-selects: debit or credit. Omitted on create, it follows accountClassification (ASSET and EXPENSE pre-select debit, the rest credit); an account with no classification, which only a heading or total account can be, pre-selects debit. It cannot be cleared.

Enum values:
debit
credit
Example: debit
vatCodeId
​string | null

VAT code applied by default to journal-entry lines on this account. Null clears it.

Example: 550e8400-e29b-41d4-a716-446655440000
currency
​string

Currency the account is kept in, as an ISO 4217 code. Applies to a BALANCE_SHEET account only; every other account is kept in the company's base currency and the field is ignored. Moving an account off BALANCE_SHEET resets it to the base currency.

Example: EUR
tags
​string[] · maxItems: 25

Free-form tags for grouping accounts (at most 25, each at most 50 characters)

Example: ["operating"]
mapsTo
​number | null

The account number this account reports under. When set, publicAccountId reports it instead of accountNumber. Null clears it.

Example: 1000
totalFrom
​number

For a TOTAL_FROM account: the first account number to sum from; the total runs up to the account's own number. Required whenever the request sets ledgerType to TOTAL_FROM.

Example: 1000
​AccountInterval[] · maxItems: 50

For a TOTAL_INTERVALS account: the account-number ranges to sum (at most 50). Required whenever the request sets ledgerType to TOTAL_INTERVALS.

name
​string

Name of the account

Example: Software subscriptions
accountNumber
​number

Account number, unique within the company

Example: 3120
ledgerType
​string · enum

Kind of account. Setting a postable type requires accountClassification in the same request; setting TOTAL_FROM requires totalFrom, and TOTAL_INTERVALS requires intervals.

Enum values:
BALANCE_SHEET
HEADING_BREAK
HEADING
PROFIT_AND_LOSS
TOTAL_FROM
TOTAL_INTERVALS
Example: PROFIT_AND_LOSS

Update an account › Responses

Account updated successfully

AccountDetailResponse
id
​string · required

The unique identifier of the account

Example: 550e8400-e29b-41d4-a716-446655440000
name
​string · required

Name of the account

Example: Skyldig AM-bidrag
accountNumber
​number · required

Account type number

Example: 1000
publicAccountId
​number · required

Public account id that the account maps to

Example: 1000
ledgerType
​string · enum · required

Type of ledger account. Only BALANCE_SHEET and PROFIT_AND_LOSS accounts can be used in journal entries.

Enum values:
BALANCE_SHEET
HEADING_BREAK
HEADING
PROFIT_AND_LOSS
TOTAL_FROM
TOTAL_INTERVALS
Example: BALANCE_SHEET
debitCredit
​string · enum · required

The side a journal-entry line on this account pre-selects: debit or credit. This is the Debit/Credit choice on the account form. It does not decide how a balance is reported; accountClassification does.

Enum values:
debit
credit
Example: debit
requiredDimensionIds
​string[] · required

IDs of the dimensions this account requires: every journal entry line posting to the account must carry a value from each of them, or the entry is refused with JOURNAL_TAG_REQUIRED_DIMENSION_MISSING. Empty when the account requires none. This is the account setting as stored: a dimension that has since been deactivated stays listed and is not enforced until it is active again, so match the ids against the dimensions list, which returns active dimensions only.

Example: ["0192f3a4-5b6c-7d8e-9f01-23456789abcd"]
currency
​string · required

The currency the account is kept in (ISO 4217). A balance-sheet account may be kept in a foreign currency; every other account is kept in the company's base currency.

Example: DKK
tags
​string[] · required

Free-form tags for grouping accounts

Example: ["operating"]
createdAt
​string · date-time · required

When the account was created

updatedAt
​string · date-time · required

When the account was last changed

accountClassification
​string | null · enum

Account classification (ASSET, LIABILITY, EQUITY, REVENUE, EXPENSE)

Enum values:
ASSET
LIABILITY
EQUITY
REVENUE
EXPENSE
Example: ASSET
controlAccountType
​string | null · enum

Control account type. ACCOUNTS_RECEIVABLE requires customerId on journal entries, ACCOUNTS_PAYABLE requires vendorId. Null for regular accounts.

Enum values:
ACCOUNTS_RECEIVABLE
ACCOUNTS_PAYABLE
Example: null
vatCodeId
​string | null

VAT code applied by default to journal-entry lines on this account, or null

Example: 550e8400-e29b-41d4-a716-446655440000
mapsTo
​number | null

The account number this account reports under. When set, publicAccountId follows it.

Example: 1000
totalFrom
​number | null

For a TOTAL_FROM account: the first account number it sums from, up to the account's own number

Example: 1000
​array | null

For a TOTAL_INTERVALS account: the account-number ranges it sums

deactivatedAt
​string | null · date-time

When the account was deactivated, or null while it is active

PATCH/v1/accounts/{accountId}
curl https://api.ledgerbee.com/api/v1/accounts/:accountId \ --request PATCH \ --header 'Content-Type: application/json' \ --header 'x-api-key: <api-key>' \ --data '{ "accountClassification": "EXPENSE", "controlAccountType": null, "debitCredit": "debit", "vatCodeId": "550e8400-e29b-41d4-a716-446655440000", "currency": "EUR", "tags": [ "operating" ], "mapsTo": 1000, "totalFrom": 1000, "intervals": [ { "from": 1000, "to": 1999 } ], "name": "Software subscriptions", "accountNumber": 3120, "ledgerType": "PROFIT_AND_LOSS" }'
Example Request Body
{ "accountClassification": "EXPENSE", "controlAccountType": null, "debitCredit": "debit", "vatCodeId": "550e8400-e29b-41d4-a716-446655440000", "currency": "EUR", "tags": [ "operating" ], "mapsTo": 1000, "totalFrom": 1000, "intervals": [ { "from": 1000, "to": 1999 } ], "name": "Software subscriptions", "accountNumber": 3120, "ledgerType": "PROFIT_AND_LOSS" }
json
application/json
Example Responses
{ "id": "550e8400-e29b-41d4-a716-446655440000", "name": "Skyldig AM-bidrag", "accountNumber": 1000, "publicAccountId": 1000, "ledgerType": "BALANCE_SHEET", "accountClassification": "ASSET", "controlAccountType": null, "debitCredit": "debit", "vatCodeId": "550e8400-e29b-41d4-a716-446655440000", "requiredDimensionIds": [ "0192f3a4-5b6c-7d8e-9f01-23456789abcd" ], "currency": "DKK", "tags": [ "operating" ], "mapsTo": 1000, "totalFrom": 1000, "intervals": [ { "from": 1000, "to": 1999 } ], "deactivatedAt": "2024-08-25T15:00:00Z", "createdAt": "2024-08-25T15:00:00Z", "updatedAt": "2024-08-25T15:00:00Z" }
json
application/json

Advisor Authority Extracts