# Incoming expenses

Incoming expenses is fetched from Visma e-conomic once a day. This is executed during the night.

There is however an option to get expenses into Moment directly after these have been booked, but this involves some configuration to be done in Visma e-conomic. To get this activated, there must be created a webhook.

## Webhook

In Visma e-conomic, naviage to "All settings" (found under the yellow cogwheel button) and on the menu on the left look for "Webhooks".

Select then Webhooks menu item. The page will show you a list of existing webhooks and the option to create new ones. &#x20;

To create a webhook, click on the "New webhook" (Nyt webhook) button. This will show a dialog that is to be filled out.

Here's an explanation on what to do with each of these fields

* Type: Select the option "Kassekladde bogført"
* Navn: Write a name to describe the use of the webhook, e.g. "Moment udlæg"
* URL: This is the URL to where Visma e-conomic is to send information when an expenses is booked. This must be: "<https://app.moment.team/api/1.0/webhooks/economic>"
* Sendt data: This is the data that will be sent to the URL above. This must be like this.\
  Note! The text must be exactly as shown here, copy/paste.
  * `{`\
    &#x20;   `"fromNo":"[FROMSERIALNO]",`\
    &#x20;   `"toNo":"[TOSERIALNO]",`\
    &#x20;   `"code":"company_code",`\
    &#x20;   `"authToken":"UUID",`\
    &#x20;   `"type":"expense"`\
    `}`
  * Replace `company_code` with the code from the Moment URL.
    * <https://app.moment.team/name-of-company/myself> = name-of-company
  * Replace `UUID` with the code given in Moment integration configuration.<br>
* Content type: This is a description on how the data sent is to be formatted, this must be "application/json"

<figure><img src="/files/wCcOy2NjW5Oo179lOsTt" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.milientsoftware.com/help/moment-by-topic/integrations/real-time-integrations/visma-e-conomic/incoming-expenses.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
