--- title: "Softera.E-Invoice API Reference for Business Central" slug: "einvoice-api-introduction" description: "Softera.E-Invoice exposes Business Central master data and documents through custom REST APIs under the API group softera/softeraEInvoice, version v2.0. Request" tags: ["API", "Business Central API"] updated: 2026-10-01T13:41:59Z published: 2026-10-01T13:41:59Z canonical: "instrukcijos.softera.lt/einvoice-api-introduction" --- > ## Documentation Index > Fetch the complete documentation index at: https://instrukcijos.softera.lt/llms.txt > Use this file to discover all available pages before exploring further. # Introduction **Softera.E-Invoice**14.2 API specification for Softera.E-Invoice, the Business Central extension that exposes master data and documents through custom REST APIs (API group `softera/softeraEInvoice`, version `v2.0`). For the standard Business Central APIs see [API v2.0 overview](https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/api-reference/v2.0/). ## Request structure `https://api.businesscentral.dynamics.com/v2.0/{tenantId}/{environment}/api/softera/softeraEInvoice/v2.0/companies({companyId})/{endpoint}` | Part | Value | | --- | --- | | `{tenantId}` | Tenant ID | | `{environment}` | Name of the environment | | `softera/softeraEInvoice` | E-Invoice API group name | | `v2.0` | API version | | `companies({companyId})` | Id of the company, retrieved from the Companies endpoint | | `{endpoint}` | Endpoint name | | Header | Value | | --- | --- | | Authorization | `Bearer {token}`. Required. | | Content-Type | `application/json` | | If-Match | Required for PATCH and DELETE. When the eTag provided does not match the current tag on the record, the record is not updated. Use `*` to skip the check. | Authentication uses OAuth 2.0 client credentials with a Microsoft Entra application that is registered in Business Central (Microsoft Entra Applications) with the required permission sets. See [Azure App registration](https://instrukcijos.softera.lt/docs/azure-app-registration). ## Performance recommendations - Use `$expand` to create a master record together with related data (e.g. a customer with `defaultDimensions`, or a sales invoice with its lines) in a single request. - Use `$batch` when creating or updating many records at once (e.g. journal lines). Business Central allows up to 100 operations per `$batch` request. Each operation is evaluated on its own: a failure in one operation does not roll back the others, so check the status of every operation in the batch response. - For documents with hundreds of lines, post dimensions in a separate `$batch` request instead of expanding both lines and `dimensionSetLines` in one request. - See [Operational limits for Business Central online](https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/administration/operational-limits-online). ## Enum values Fields based on an AL **Enum** are returned with OData name encoding: spaces and special characters are replaced by their `_xHHHH_` code, e.g. `Sales Invoice` is returned as `Sales_x0020_Invoice`, `G/L Account` as `G_x002F_L_x0020_Account` and a blank value as `_x0020_`. Fields based on an AL **Option** (e.g. job queue entry `status`, VAT posting setup `unrealizedVATType`) are returned as plain text, e.g. `On Hold`. The schemas list the values exactly as they are returned; use the same values in request bodies. ## E-Invoice Setup The **E-Invoice Setup** page affects customers, vendors, sales and purchase documents: - **Check VAT Mismatch in API Request (Sales / Purchase)**: enables the check of the API totals (`apiTotalAmountExclVAT`, `apiTotalAmountInclVAT`) against the amounts calculated by Business Central. The check runs twice: - when the document is read through the API (the response to a create or update, and GET): the amount excluding VAT must match, and a VAT difference is corrected only when **Allow VAT Auto Correction** is enabled and the difference does not exceed **Max. VAT Difference Allowed** (General Ledger Setup); - when the document is posted: both totals must match the document amounts, otherwise posting fails. - **Allow API Documents Edit**: documents created via the API are marked "Created via API" and cannot be edited by users unless this is enabled. - **Check Duplicates by Reg. No.** / **Check Duplicates by Name**: customer and vendor creation is rejected when a record with the same registration number or name exists. - **Assign Default Template** and the Local / EU / Foreign templates: a customer or vendor template is assigned automatically by country. See [API Setup](https://instrukcijos.softera.lt/docs/api-setup) and [API Process](https://instrukcijos.softera.lt/docs/api-process). ## Common errors | Error | Description | | --- | --- | | Amounts excl. VAT doesn't match. | `apiTotalAmountExclVAT` and the amount calculated by Business Central do not match, usually because unit prices differ between systems. | | VAT amount mismatched by %1, which exceeds the maximum allowed. | VAT amounts do not match and the difference exceeds **Max. VAT Difference Allowed** in **General Ledger Setup**, or **Allow VAT Auto Correction** is disabled. | | Amount 100 and API Total Amount Excl. VAT (ESF) 99 must match. | Raised when the document is posted: the document amount (or amount including VAT) differs from the API total sent in the request. | | Sorry, the current permissions prevented the action. | The permission for the object and action is not assigned to the Microsoft Entra application or the user. | | No HTTP resource was found that matches the request URI. | The E-Invoice app is not installed, or the API group in the URL is incorrect. | | Invalid body. | The request body contains extra symbols, or a field name is incorrect or does not exist. | A Postman collection with request examples is available on the [API overview](https://instrukcijos.softera.lt/docs/api-overview) page. | **License** | | --- | | *Softera* [https://www.softera.lt/en/license-agreement/](https://www.softera.lt/en/license-agreement/) | | **Servers** | | --- | | *URL for Business Central cloud* [https://api.businesscentral.dynamics.com/v2.0/{tenantId}/{environment}/api](https://api.businesscentral.dynamics.com/v2.0/{tenantId}/{environment}/api) **Server Variables** \| tenantId \| \| --- \| \| **Default** \| tenantId \| \| **Description** \| Business Central tenant Id \| \| environment \| \| --- \| \| **Default** \| environment \| \| **Description** \| Business Central environment name \| | | tenantId | | **Default** | tenantId | | **Description** | Business Central tenant Id | | environment | | **Default** | environment | | **Description** | Business Central environment name | | *URL for Business Central On-Prem* [https://{baseURL}:{port}/{serverInstance}/api](https://{baseURL}:{port}/{serverInstance}/api) **Server Variables** \| tenantId \| \| --- \| \| **Default** \| tenantId \| \| **Description** \| Business Central tenant Id \| \| environment \| \| --- \| \| **Default** \| environment \| \| **Description** \| Business Central environment name \| | | tenantId | | **Default** | tenantId | | **Description** | Business Central tenant Id | | environment | | **Default** | environment | | **Description** | Business Central environment name |