Skip to main content
Webhooks allow you to receive real-time notifications about events happening in your connected accounting systems. This enables you to automate workflows and keep your data in sync without the need for constant polling.

Types of webhooks

Maesn supports two types of webhooks:
  1. Customer-based webhooks

    Subscriptions are created per customer, so each customer events is received through the related subscription. Endpoint url : POST /webhooks/user Requires both the X-API-KEY and the X-ACCOUNT-KEY in the header. Systems that support customer-based webhooks:
    • businesscentral
    • exact-nl
    • freshbooks
    • lexware-office
    • moneybird
    • weclapp
  2. App-based webhooks

    Subscriptions are created per app, not per customer. All customers authenticated with the app share the same subscription, and events for all the customers are delivered to a single callback URL. Endpoint url : POST /webhooks/tenant Requires only the X-API-KEY in the header. Systems that support app-based webhooks:
    • quickbooks
    • xero

Setting up a webhook

To set up a webhook, you need to create a subscription by sending a POST request to the accounting/webhooks or tenants/webhooks endpoint depending on the target system and the type of webhook you want to create. The request body support the following parameters:
  • callbackUrl: The URL where you want to receive webhook events.
  • eventType: The type of event you want to subscribe to (e.g., CREATED, UPDATED, DELETED).
  • resource: The resource you want to monitor (e.g., INVOICE, CUSTOMER).
  • targetSystem: The accounting system you are connecting to (e.g., xero, quickbooks).
In each target system page, you can check the required input parameters for the request body.

Getting events

Once a webhook is set up, you will start receiving events at the specified callback URL. Each event will contain information about the resource that triggered the event, including its type and ID. The received event body will look similar to this:
Example event body
{
    "eventType": "CREATED",
    "filterDate": "2023-10-01T00:00:00Z",
    "resource": "INVOICE",
    "resourceId": "bca91f06-0414-4b24-81fa-8489105afceb",
    "userId": "123456"
}

Handling events

When your server receives a webhook event, it should process the event according to your application’s logic. This may involve updating records in your database, triggering other workflows, or sending notifications.

Deleting a webhook

If you no longer need a webhook, you can delete it by sending a DELETE request to the /webhooks/user/{webhookId} or /webhooks/tenant/{webhookId}endpoint.