> For the complete documentation index, see [llms.txt](https://docs.younium.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.younium.com/erp-and-accounting-integrations/e-conomic.md).

# e-conomic

## Synchronisation scope

| Synchronisation           | Direction                 | When it runs                                                        |
| ------------------------- | ------------------------- | ------------------------------------------------------------------- |
| Invoices and credit notes | Younium → Visma e-conomic | When an invoice is posted in Younium, if invoice posting is enabled |
| Accounts                  | Younium → Visma e-conomic | On demand from the integration settings, or as a scheduled job      |
| Accounts                  | Visma e-conomic → Younium | On demand from the integration settings, or as a scheduled job      |
| Products                  | Visma e-conomic → Younium | On demand from the integration settings, or as a scheduled job      |
| Currencies                | Visma e-conomic → Younium | On demand from the integration settings, or as a scheduled job      |
| Chart of accounts         | Visma e-conomic → Younium | On demand from the integration settings, or as a scheduled job      |
| Payment terms             | Visma e-conomic → Younium | On demand from the integration settings, or as a scheduled job      |

Not in scope: exchange rates, payments, journals.

***

## Overview

The Visma e-conomic integration connects via agreement grant token, synchronises master data through import jobs, and posts draft invoices (optionally booked) to e-conomic when Younium invoices are posted. Amounts on the draft header mirror Younium subtotal, tax, rounding, and total.

***

## Authentication

You connect e-conomic with an agreement grant token, which you create in e-conomic and paste into the integration settings. Younium presents it on every request it makes, so the connection lasts as long as the grant does — there is nothing to renew and no periodic reauthorisation.

Revoking the grant in e-conomic ends the connection immediately, and posting stops until a new token is entered.

***

## Activation and deactivation

Entering a working agreement grant token activates the integration.

Saving the settings prepares Younium for posting: it creates the EAN custom field, the employee, VAT zone, layout and customer group lists the integration maps to, and turns on invoice posting when you have enabled it.

When sending invoices on booking is turned on, saving also creates the **Send by** list on accounts and orders, offering None, Email and EAN, and removes any other items from it. If the default send method is EAN or Auto, Younium first checks with e-conomic that the agreement can send electronic invoices. An agreement that e-conomic reports as unable to (for example, because the CVR number is missing) is refused and the settings are not saved.

Deactivating stops invoice posting; documents already in e-conomic are untouched.

***

## Custom fields and lists

| Entity                  | Field name                    | Type                                                                                 |
| ----------------------- | ----------------------------- | ------------------------------------------------------------------------------------ |
| Account                 | `EAN no` (EAN\_no\_FiledName) | Text                                                                                 |
| Order, Account, Invoice | `Employees`                   | List (employee/sales person)                                                         |
| Account                 | `VAT Zone`                    | List                                                                                 |
| Account                 | `Layout`                      | List                                                                                 |
| Account                 | `Customer Group`              | List                                                                                 |
| Invoice                 | `integrationEconomicHeading`  | Used in notes heading (non-integration prefix pattern)                               |
| Account, Order          | `Send by`                     | List (None, Email, EAN) — created only when sending invoices on booking is turned on |

List items use **Key** as e-conomic numeric id and **Value** as display label.

***

## Eligibility and filtering

* Account must have VAT zone custom field populated.
* Layout custom field required on account.
* `PaymentTermReference.Name` parsed as integer `paymentTermsNumber`.
* `Account.ExternalERPId` → `customerNumber`.
* Lines: `HideZeroAmountRecurring`, `HideZeroAmountUsageAndMeasurementLines`; sorted by product line and charge number.

***

## Field mapping — posted draft invoice (Younium → e-conomic)

### Header

| Younium field                     | e-conomic field                                                            |
| --------------------------------- | -------------------------------------------------------------------------- |
| `Invoice.InvoiceDate`             | `date`                                                                     |
| `Subtotal.CurrencyCode`           | `currency`                                                                 |
| `Subtotal.Amount`                 | `netAmount`                                                                |
| `Tax.Amount`                      | `vatAmount`                                                                |
| `TotalRoundingAmount.Amount`      | `roundingAmount`                                                           |
| `TotalAmount.Amount`              | `grossAmount`                                                              |
| `PaymentTermReference.Name` (int) | `paymentTerms.paymentTermsNumber`                                          |
| `Account.ExternalERPId` (int)     | `customer.customerNumber`                                                  |
| `YourOrderNumber`                 | `references.other`                                                         |
| Employee list Key                 | `references.salesPerson.employeeNumber`                                    |
| Your reference contact            | `references.customerContact` (via `AddYourReference`)                      |
| Notes + heading custom field      | `notes.heading`, `notes.textLine1`                                         |
| Account name + invoice address    | `recipient` (name, address, zip, city, country, `vatZone`, optional `ean`) |
| Delivery address                  | `delivery`                                                                 |
| Layout list Key                   | `layout.layoutNumber`                                                      |

### Line

| Younium field                                 | e-conomic field                              |
| --------------------------------------------- | -------------------------------------------- |
| `GetPricePerUnitAndQuantity()`                | `quantity`, `unitNetPrice`, `totalNetAmount` |
| Discount logic on charge details              | `discountPercentage`                         |
| Description + service period + notes          | `description`                                |
| `OrderProductCharge.ExternalERPId`            | `product.productNumber`                      |
| Service period (non–one-off, accrual setting) | `accrual.startDate`, `accrual.endDate`       |

### Booking (optional)

When `AutomaticallyBookPostedInvoices` is true, POST `invoices/booked` with `draftInvoiceNumber`; `ExternalERPId` becomes booked invoice number.

### Sending the booked invoice

When automatic booking is on, you can also have e-conomic send each invoice as it is booked. The two settings only take effect together with automatic booking: **Send invoice when booking** and a default send method of None, Email, EAN or Auto. With automatic booking off, or sending off, invoices are booked exactly as before and nothing is sent.

| Setting                                              | Description                                                                                                      | Default |
| ---------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ------- |
| Send invoice when booking (`SendInvoiceWhenBooking`) | Sends the invoice from e-conomic when it is booked. Ignored, and cleared on save, when automatic booking is off. | Off     |
| Default send method (`DefaultSendMethod`)            | The method used when neither the order nor the account says otherwise: None (book only), Email, EAN or Auto.     | None    |

**Which method is used.** Younium takes the first of these that has a value:

1. The **Send by** field on the order. It is used only when every order on the invoice has the same value, read from each order's latest version. If the orders disagree, or any has no value, the order level is skipped.
2. The **Send by** field on the account.
3. The default send method in the settings.

The **Send by** fields accept None, Email and EAN (case-insensitive). Any other value fails the invoice with a message naming the accepted values, even when a higher level would have won. Auto is available only as the settings default.

**Auto.** Sends by EAN when the account has an e-conomic EAN number; otherwise by Email when the e-conomic customer has an email address; otherwise the invoice is booked and not sent.

**Checks before the draft is created.** A failed check stops the invoice from being posted to e-conomic and logs the reason.

| Method | Requirement                                                                                                                                                                                                        |
| ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Email  | The account has an invoice email address in e-conomic.                                                                                                                                                             |
| EAN    | The EAN no field is set up; the account's EAN number is 13 digits; the invoice has Your reference (the contact person); the invoice has at least one product line; and the agreement can send electronic invoices. |

When a method other than None is used, the integration log reads "booked in eConomic as {number}, sent by {method}".

### Write-back (Younium)

| e-conomic field                               | Younium field           |
| --------------------------------------------- | ----------------------- |
| `draftInvoiceNumber` or `bookedInvoiceNumber` | `Invoice.ExternalERPId` |

***

## Post invoice workflow

**Runs when:** an invoice is posted in Younium.

POST `invoices/drafts`; optional book step.

***

## Import jobs

Products, payment terms, financial accounts, currencies, accounts; export accounts job.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.younium.com/erp-and-accounting-integrations/e-conomic.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
