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

VAT Codes

Download schema

VAT code and rate endpoints


List VAT codes

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

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

Retrieves all VAT codes for your company, sorted by VAT code. VAT codes define the rate and booking principle used to calculate VAT on journal entries — pass a VAT code's id as vatCodeId on a journal-entry or draft-journal-entry line to apply it.

Each code also carries the ledger account (and contra account) the VAT amount is booked to. 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 already in flight during the write can serve the previous rows for up to 5 seconds.

Required Scope

  • vat-codes-read

List VAT codes › Responses

List of VAT codes and rates for the company

​VatCodeResponse[]
VatCodeResponse
id
​string · required

The unique identifier of the VAT code

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

VAT code identifier

Example: VAT25
name
​string · required

Name/description of the VAT code

Example: 25% Standard VAT
vatRate
​number · required

VAT rate percentage

Example: 25
type
​string · enum · required

What the code is for: which side of the VAT return it reports on and how the VAT is posted. Every type belongs to exactly one group, reported as group.

Enum values:
Foreign sales to non-EU countries
Purchased products/abroad
Purchased products EU - Rubrik A
Purchased services/abroad
Purchased services EU - Rubrik A
Purchased products/domestic (reverse charge)
Domestic without VAT
Input/purchase
Example: Output/sales
principle
​string · required

VAT principle - Gross (VAT included) or Net (VAT excluded)

Example: gross
group
​string | null · enum

The group the type belongs to, which the VAT-code form shows above the type: output for sales, input for purchases, reverse_charge for purchases where the buyer accounts for the VAT. Membership by type — output: Output/sales, Domestic without VAT, Sales to other EU countries, Sales of services to other EU countries, Foreign sales to non-EU countries, Sales of products EU country-specific, Sales of services EU country-specific; input: Input/purchase; reverse_charge: Purchased products/abroad, Purchased services/abroad, Purchased products/domestic (reverse charge), Purchased products EU - Rubrik A, Purchased services EU - Rubrik A. The group follows from the type on every read and is not accepted on create or update: choose the type, and the group is set. Null when the stored type is one this version does not name.

Enum values:
output
input
reverse_charge
Example: output
country
​string | null

Country the code is specific to (ISO 3166-1 alpha-2) on the country-specific EU sales types; null on every other type

Example: null
accountToBookId
​string

The ledger account ID to book VAT to

Example: 550e8400-e29b-41d4-a716-446655440001
accountToBookNumber
​number

The ledger account number to book VAT to

Example: 6910
accountToBookName
​string

The ledger account name to book VAT to

Example: Output VAT
contraAccountToBookId
​string

The contra account ID for VAT entries

Example: 550e8400-e29b-41d4-a716-446655440002
contraAccountToBookNumber
​number

The contra account number for VAT entries

Example: 6920
contraAccountToBookName
​string

The contra account name for VAT entries

Example: Input VAT
GET/v1/vat-codes
curl https://api.ledgerbee.com/api/v1/vat-codes \ --header 'x-api-key: <api-key>'
Example Responses
[ { "id": "550e8400-e29b-41d4-a716-446655440000", "vatCode": "VAT25", "name": "25% Standard VAT", "vatRate": 25, "type": "Output/sales", "group": "output", "principle": "gross", "country": null, "accountToBookId": "550e8400-e29b-41d4-a716-446655440001", "accountToBookNumber": 6910, "accountToBookName": "Output VAT", "contraAccountToBookId": "550e8400-e29b-41d4-a716-446655440002", "contraAccountToBookNumber": 6920, "contraAccountToBookName": "Input VAT" } ]
json
application/json

Create a VAT code

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

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

Creates a VAT code. The code must be free within the company (409 VAT_CODE_ALREADY_EXISTS otherwise), and the booking accounts must be the company's own (404 VAT_CODE_ACCOUNT_NOT_FOUND otherwise).

The type decides the rest, and the same rules the app applies answer here: each type demands one principle — Net on the reverse-charge purchase types, Gross on every other — and an omitted principle follows the type (400 VAT_CODE_INVALID_PRINCIPLE when a stated one does not). A reverse-charge type needs contraAccountToBookId (400 VAT_CODE_CONTRA_ACCOUNT_REQUIRED). The country-specific EU sales types need country (400 VAT_CODE_COUNTRY_REQUIRED) and every other type refuses one (400 VAT_CODE_COUNTRY_NOT_ALLOWED).

vatRate is a percentage (25 is 25%). Two values are never VAT rates and are refused with the rate in details.vatRate: a rate above 0 and below 1, a fraction sent where the percentage belongs (400 VAT_CODE_RATE_FRACTION), and a rate of exactly 100 (400 VAT_CODE_RATE_HUNDRED). 0 is accepted for exempt and zero-rated codes.

Required Scope

  • vat-codes-write

Create a VAT code › Headers

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

Optional idempotency key for safely retrying mutating requests.

Create a VAT code › Request Body

CreateVatCodeRequest
vatCode
​string · maxLength: 50 · required

Short code, unique within the company

Example: U25
name
​string · maxLength: 255 · required

Name of the VAT code

Example: 25% Standard VAT
vatRate
​number · min: 0 · max: 100 · required

VAT rate in percent. A rate above 0 and below 1 is refused (VAT_CODE_RATE_FRACTION), and so is 100 itself (VAT_CODE_RATE_HUNDRED).

Example: 25
type
​string · enum · required

What the code is for: which side of the VAT return it reports on and how the VAT is posted

Enum values:
Foreign sales to non-EU countries
Purchased products/abroad
Purchased products EU - Rubrik A
Purchased services/abroad
Purchased services EU - Rubrik A
Purchased products/domestic (reverse charge)
Domestic without VAT
Input/purchase
Example: Output/sales
accountToBookId
​string · required

Account the VAT amount is booked to; one of the company's accounts

Example: 550e8400-e29b-41d4-a716-446655440001
principle
​string · enum

Gross when the amount on a line includes VAT, Net when VAT is added on top. Each type demands one principle (Net on the reverse-charge types, Gross on the rest); omitted, it follows the type.

Enum values:
Gross
Net
Example: Gross
contraAccountToBookId
​string | null

Account the offsetting VAT amount is booked to. Required on the reverse-charge types, which post the VAT on both sides. Null clears it.

Example: null
country
​string | null

Country (ISO 3166-1 alpha-2) on the country-specific EU sales types, where it is required; refused on every other type. Null clears it.

Example: null

Create a VAT code › Responses

VAT code created successfully

VatCodeResponse
id
​string · required

The unique identifier of the VAT code

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

VAT code identifier

Example: VAT25
name
​string · required

Name/description of the VAT code

Example: 25% Standard VAT
vatRate
​number · required

VAT rate percentage

Example: 25
type
​string · enum · required

What the code is for: which side of the VAT return it reports on and how the VAT is posted. Every type belongs to exactly one group, reported as group.

Enum values:
Foreign sales to non-EU countries
Purchased products/abroad
Purchased products EU - Rubrik A
Purchased services/abroad
Purchased services EU - Rubrik A
Purchased products/domestic (reverse charge)
Domestic without VAT
Input/purchase
Example: Output/sales
principle
​string · required

VAT principle - Gross (VAT included) or Net (VAT excluded)

Example: gross
group
​string | null · enum

The group the type belongs to, which the VAT-code form shows above the type: output for sales, input for purchases, reverse_charge for purchases where the buyer accounts for the VAT. Membership by type — output: Output/sales, Domestic without VAT, Sales to other EU countries, Sales of services to other EU countries, Foreign sales to non-EU countries, Sales of products EU country-specific, Sales of services EU country-specific; input: Input/purchase; reverse_charge: Purchased products/abroad, Purchased services/abroad, Purchased products/domestic (reverse charge), Purchased products EU - Rubrik A, Purchased services EU - Rubrik A. The group follows from the type on every read and is not accepted on create or update: choose the type, and the group is set. Null when the stored type is one this version does not name.

Enum values:
output
input
reverse_charge
Example: output
country
​string | null

Country the code is specific to (ISO 3166-1 alpha-2) on the country-specific EU sales types; null on every other type

Example: null
accountToBookId
​string

The ledger account ID to book VAT to

Example: 550e8400-e29b-41d4-a716-446655440001
accountToBookNumber
​number

The ledger account number to book VAT to

Example: 6910
accountToBookName
​string

The ledger account name to book VAT to

Example: Output VAT
contraAccountToBookId
​string

The contra account ID for VAT entries

Example: 550e8400-e29b-41d4-a716-446655440002
contraAccountToBookNumber
​number

The contra account number for VAT entries

Example: 6920
contraAccountToBookName
​string

The contra account name for VAT entries

Example: Input VAT
POST/v1/vat-codes
curl https://api.ledgerbee.com/api/v1/vat-codes \ --request POST \ --header 'Content-Type: application/json' \ --header 'x-api-key: <api-key>' \ --data '{ "principle": "Gross", "contraAccountToBookId": null, "country": null, "vatCode": "U25", "name": "25% Standard VAT", "vatRate": 25, "type": "Output/sales", "accountToBookId": "550e8400-e29b-41d4-a716-446655440001" }'
Example Request Body
{ "principle": "Gross", "contraAccountToBookId": null, "country": null, "vatCode": "U25", "name": "25% Standard VAT", "vatRate": 25, "type": "Output/sales", "accountToBookId": "550e8400-e29b-41d4-a716-446655440001" }
json
application/json
Example Responses
{ "id": "550e8400-e29b-41d4-a716-446655440000", "vatCode": "VAT25", "name": "25% Standard VAT", "vatRate": 25, "type": "Output/sales", "group": "output", "principle": "gross", "country": null, "accountToBookId": "550e8400-e29b-41d4-a716-446655440001", "accountToBookNumber": 6910, "accountToBookName": "Output VAT", "contraAccountToBookId": "550e8400-e29b-41d4-a716-446655440002", "contraAccountToBookNumber": 6920, "contraAccountToBookName": "Input VAT" }
json
application/json

Get a VAT code

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

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

Returns a single VAT code with its booking accounts.

Required Scope

  • vat-codes-read

Get a VAT code › path Parameters

vatCodeId
​string · required

VAT code ID

Get a VAT code › Responses

VAT code details

VatCodeResponse
id
​string · required

The unique identifier of the VAT code

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

VAT code identifier

Example: VAT25
name
​string · required

Name/description of the VAT code

Example: 25% Standard VAT
vatRate
​number · required

VAT rate percentage

Example: 25
type
​string · enum · required

What the code is for: which side of the VAT return it reports on and how the VAT is posted. Every type belongs to exactly one group, reported as group.

Enum values:
Foreign sales to non-EU countries
Purchased products/abroad
Purchased products EU - Rubrik A
Purchased services/abroad
Purchased services EU - Rubrik A
Purchased products/domestic (reverse charge)
Domestic without VAT
Input/purchase
Example: Output/sales
principle
​string · required

VAT principle - Gross (VAT included) or Net (VAT excluded)

Example: gross
group
​string | null · enum

The group the type belongs to, which the VAT-code form shows above the type: output for sales, input for purchases, reverse_charge for purchases where the buyer accounts for the VAT. Membership by type — output: Output/sales, Domestic without VAT, Sales to other EU countries, Sales of services to other EU countries, Foreign sales to non-EU countries, Sales of products EU country-specific, Sales of services EU country-specific; input: Input/purchase; reverse_charge: Purchased products/abroad, Purchased services/abroad, Purchased products/domestic (reverse charge), Purchased products EU - Rubrik A, Purchased services EU - Rubrik A. The group follows from the type on every read and is not accepted on create or update: choose the type, and the group is set. Null when the stored type is one this version does not name.

Enum values:
output
input
reverse_charge
Example: output
country
​string | null

Country the code is specific to (ISO 3166-1 alpha-2) on the country-specific EU sales types; null on every other type

Example: null
accountToBookId
​string

The ledger account ID to book VAT to

Example: 550e8400-e29b-41d4-a716-446655440001
accountToBookNumber
​number

The ledger account number to book VAT to

Example: 6910
accountToBookName
​string

The ledger account name to book VAT to

Example: Output VAT
contraAccountToBookId
​string

The contra account ID for VAT entries

Example: 550e8400-e29b-41d4-a716-446655440002
contraAccountToBookNumber
​number

The contra account number for VAT entries

Example: 6920
contraAccountToBookName
​string

The contra account name for VAT entries

Example: Input VAT
GET/v1/vat-codes/{vatCodeId}
curl https://api.ledgerbee.com/api/v1/vat-codes/:vatCodeId \ --header 'x-api-key: <api-key>'
Example Responses
{ "id": "550e8400-e29b-41d4-a716-446655440000", "vatCode": "VAT25", "name": "25% Standard VAT", "vatRate": 25, "type": "Output/sales", "group": "output", "principle": "gross", "country": null, "accountToBookId": "550e8400-e29b-41d4-a716-446655440001", "accountToBookNumber": 6910, "accountToBookName": "Output VAT", "contraAccountToBookId": "550e8400-e29b-41d4-a716-446655440002", "contraAccountToBookNumber": 6920, "contraAccountToBookName": "Input VAT" }
json
application/json

Delete a VAT code

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

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

Deletes a VAT code nothing refers to. A code that an account defaults to is refused with 400 VAT_CODE_IN_USE_BY_LEDGER, and one that has been posted with is refused with 400 VAT_CODE_IN_USE_BY_JOURNAL_ENTRY; each carries the count in details.

Required Scope

  • vat-codes-write

Delete a VAT code › path Parameters

vatCodeId
​string · required

VAT code ID

Delete a VAT code › Headers

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

Optional idempotency key for safely retrying mutating requests.

Delete a VAT code › Responses

VAT code deleted successfully

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

Update a VAT code

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

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

Updates a VAT code. Only the fields provided in the request are changed; send null to clear contraAccountToBookId or country. The create rules apply to the merged result.

Once a code has been posted with, its rate, type, principle, accounts and country are locked (400 VAT_CODE_IN_USE_BY_JOURNAL_ENTRY); the name and the code stay editable.

A vatRate equal to the rate the code already holds is no change: it is not written and does not count as an accounting change, so it is neither locked nor refused, and a code holding an impossible rate can still have its name and code edited. A vatRate that changes the rate is refused when the new rate is never a VAT rate (400 VAT_CODE_RATE_FRACTION or VAT_CODE_RATE_HUNDRED, as on create), and is locked like the other accounting fields once the code has been posted with — so an impossible rate can be corrected only while the code has no postings.

Required Scope

  • vat-codes-write

Update a VAT code › path Parameters

vatCodeId
​string · required

VAT code ID

Update a VAT code › Headers

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

Optional idempotency key for safely retrying mutating requests.

Update a VAT code › Request Body

UpdateVatCodeRequest
principle
​string · enum

Gross when the amount on a line includes VAT, Net when VAT is added on top. Each type demands one principle (Net on the reverse-charge types, Gross on the rest); omitted, it follows the type.

Enum values:
Gross
Net
Example: Gross
contraAccountToBookId
​string | null

Account the offsetting VAT amount is booked to. Required on the reverse-charge types, which post the VAT on both sides. Null clears it.

Example: null
country
​string | null

Country (ISO 3166-1 alpha-2) on the country-specific EU sales types, where it is required; refused on every other type. Null clears it.

Example: null
vatCode
​string · maxLength: 50

Short code, unique within the company

Example: U25
name
​string · maxLength: 255

Name of the VAT code

Example: 25% Standard VAT
vatRate
​number · min: 0 · max: 100

VAT rate in percent. A rate above 0 and below 1 is refused (VAT_CODE_RATE_FRACTION), and so is 100 itself (VAT_CODE_RATE_HUNDRED) unless the code already holds that rate.

Example: 25
type
​string · enum

What the code is for. A new type carries its own principle unless one is stated.

Enum values:
Foreign sales to non-EU countries
Purchased products/abroad
Purchased products EU - Rubrik A
Purchased services/abroad
Purchased services EU - Rubrik A
Purchased products/domestic (reverse charge)
Domestic without VAT
Input/purchase
Example: Output/sales
accountToBookId
​string

Account the VAT amount is booked to; one of the company's accounts

Example: 550e8400-e29b-41d4-a716-446655440001

Update a VAT code › Responses

VAT code updated successfully

VatCodeResponse
id
​string · required

The unique identifier of the VAT code

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

VAT code identifier

Example: VAT25
name
​string · required

Name/description of the VAT code

Example: 25% Standard VAT
vatRate
​number · required

VAT rate percentage

Example: 25
type
​string · enum · required

What the code is for: which side of the VAT return it reports on and how the VAT is posted. Every type belongs to exactly one group, reported as group.

Enum values:
Foreign sales to non-EU countries
Purchased products/abroad
Purchased products EU - Rubrik A
Purchased services/abroad
Purchased services EU - Rubrik A
Purchased products/domestic (reverse charge)
Domestic without VAT
Input/purchase
Example: Output/sales
principle
​string · required

VAT principle - Gross (VAT included) or Net (VAT excluded)

Example: gross
group
​string | null · enum

The group the type belongs to, which the VAT-code form shows above the type: output for sales, input for purchases, reverse_charge for purchases where the buyer accounts for the VAT. Membership by type — output: Output/sales, Domestic without VAT, Sales to other EU countries, Sales of services to other EU countries, Foreign sales to non-EU countries, Sales of products EU country-specific, Sales of services EU country-specific; input: Input/purchase; reverse_charge: Purchased products/abroad, Purchased services/abroad, Purchased products/domestic (reverse charge), Purchased products EU - Rubrik A, Purchased services EU - Rubrik A. The group follows from the type on every read and is not accepted on create or update: choose the type, and the group is set. Null when the stored type is one this version does not name.

Enum values:
output
input
reverse_charge
Example: output
country
​string | null

Country the code is specific to (ISO 3166-1 alpha-2) on the country-specific EU sales types; null on every other type

Example: null
accountToBookId
​string

The ledger account ID to book VAT to

Example: 550e8400-e29b-41d4-a716-446655440001
accountToBookNumber
​number

The ledger account number to book VAT to

Example: 6910
accountToBookName
​string

The ledger account name to book VAT to

Example: Output VAT
contraAccountToBookId
​string

The contra account ID for VAT entries

Example: 550e8400-e29b-41d4-a716-446655440002
contraAccountToBookNumber
​number

The contra account number for VAT entries

Example: 6920
contraAccountToBookName
​string

The contra account name for VAT entries

Example: Input VAT
PATCH/v1/vat-codes/{vatCodeId}
curl https://api.ledgerbee.com/api/v1/vat-codes/:vatCodeId \ --request PATCH \ --header 'Content-Type: application/json' \ --header 'x-api-key: <api-key>' \ --data '{ "principle": "Gross", "contraAccountToBookId": null, "country": null, "vatCode": "U25", "name": "25% Standard VAT", "vatRate": 25, "type": "Output/sales", "accountToBookId": "550e8400-e29b-41d4-a716-446655440001" }'
Example Request Body
{ "principle": "Gross", "contraAccountToBookId": null, "country": null, "vatCode": "U25", "name": "25% Standard VAT", "vatRate": 25, "type": "Output/sales", "accountToBookId": "550e8400-e29b-41d4-a716-446655440001" }
json
application/json
Example Responses
{ "id": "550e8400-e29b-41d4-a716-446655440000", "vatCode": "VAT25", "name": "25% Standard VAT", "vatRate": 25, "type": "Output/sales", "group": "output", "principle": "gross", "country": null, "accountToBookId": "550e8400-e29b-41d4-a716-446655440001", "accountToBookNumber": 6910, "accountToBookName": "Output VAT", "contraAccountToBookId": "550e8400-e29b-41d4-a716-446655440002", "contraAccountToBookNumber": 6920, "contraAccountToBookName": "Input VAT" }
json
application/json

SuppliersVAT periods