Webhooks

Get notified when something in Moment has changed.

Moment has a number of webhooks available for you to be used when there is a need to get information about changes happening in Moment.

Current

For all of these, when there are changes to object, the webhook is triggered. For offers there is also one specific to be triggered just when an offer is accepted or declined.

Configuration

To take advantage of webhooks in Moment, go to Setup > Settings > Integrations. Click on the button "+ New integration".

Select the webhook that you want to use, these are listed one by one. In the example below, customers is selected. Enter the URL where you want the POST notification to be sent when changes occur.

Tip: An easy way of testing webhooks is to set up a temporary Request Bin on https://requestbin.com/ .

How to use

Moment will send HTTP POST messages to the URL that has been configured when any elements of the selected type is updated. The information provided is limited, but will give you enough information as to make an API call to fetch updated information.

Example:

Invoice is finalized

A common use case for webhooks is when you want to register invoices in an accounting system as soon as they are finalized in Moment. After setting up the webhook integration, you will get a POST containing some basic information whenever an invoice is finalized:

{
    "event": "CREATE_NEW",
    "invoice": {
        "id": 106939080,
        "invoiceNumber": 1,
        "customer": {
            "id": 62788973,
            "customerNumber": "10001"
        },
        "project": {
            "id": 62788980,
            "projectNumber": "1"
        }
    }
}

You can use this information to update your accounting system by fetching the invoice data from our invoice API endpoint (see detailed documentation here), using the id from the webhook (106939080):

Create a GET request with this URL:

https://app.moment.team/api/1.0/companies/{yourcompany}/invoices/10693908

See the example for result in our swagger documentation here.

Last updated