Skip to main content

2. Subscribing to webhooks

Using the previously mentioned endpoint, you can make a POST request to subscribe to a rest-hook specifying the event you want to listen to. Once subscribed, you'll receive a call to your provided target_url every time the respective event occurs.

POST /rest-hooks#

parameterdescription
target_urlyour endpoint from step 1 receiving & handling the rest-hook
event_namename of the event you want to subscribe to

Available rest-hooks#

You can find a list of available events and their names here.

The event names are split into user group they're available for: Agents, Consumers, Vendors.

note

In order to receive rest-hooks, you need to have the respective scopes enabled for your integration and have requested an access token using that scope. If you don't have them enabled yet, you can request them from developer support.

Agents#

bookings.created
When a new booking is created by a consumer.
Required scope: read_bookings

mandates.created
Whenever a new mandate is created: automatically (when a consumer creates an account with you as selected agent), or manually by yourself.
Required scope: read_mandate

Consumers#

mandates.requested_funeral_insurance_payout
When a consumer requests the payout of a funeral insurance. Includes information about the mandate, plus download links to attached documents.
Required scope: read_mandate

Vendors#

orders.created
When a new booking is created by a consumer. Required scope: read_orders


๐Ÿค– Do you miss an event from this list? Let us know and we'll add it for you.

Success response#

The id in the response json represents the subscription id (later referred to as rest_hook_id). Make sure to save it, because you'll need it if you ever want to unsubscribe from this event.

Status code: 201 CREATED
{    "id": [int]}