Overview

The Maesn API supports asynchronous operations for endpoints like POST /expense and POST /journalEntries.

To track the status of these requests, the API provides the GET /asyncTask endpoint. When an asynchronous request is made, the response body includes a task_id, a unique identifier that allows clients to check the progress or result of the operation.

This task_id is used as a query parameter in GET /asyncTask, enabling efficient status tracking of background processes.

Example

Here is an example of a partial response from an asynchronous operation:

{
  "data": {
    "accountId": "CashLedger",
    "accountingPeriodId": "01-2025",
    "currency": "EUR",
    "expenseLines": [
      {
        "accountId": "4613",
        "description": "Business lunch",
        "documentNumber": "INV-123",
        "totalGrossAmount": 49,
      }
    ],
    "taskId": "06D2F7324A1A4825B6200BA647017539",
    "totalGrossAmount": 49,
  },
  "meta": {}
}

To check the status of the task, this is how you can use the taskId in the GET /asyncTask endpoint:

Example code snippet
    const response = await axios.get(
    "https://api.maesn.dev/accounting/asyncTask?taskId=06D2F7324A1A4825B6200BA647017539", {
        headers: {
            'X-API-KEY': apiKey,
            'X-ACCOUNT-KEY': accountKey
        }
    });