Skip to main content

Set up webhooks to send Flex events to another system

Get a message the moment a member, booking, invoice, or contract changes, instead of asking the API again and again.

Written by Yasen Marinov

Product: OfficeRnD Flex
Who: Admins with access to Developer Tools
Where: Admin Portal, under Settings > Data & Extensibility > Developer Tools
Availability: Scale plan includes webhooks. Grow plan has webhooks as a paid add-on. Start plan does not include webhooks.

Webhooks (also called a web callback or HTTP push API) let you send real-time updates from OfficeRnD to external systems.

To keep a CRM or an accounting system current with Flex, you must poll the API on a timer. Between 2 polls, the other system shows data that is already out of date. A webhook removes that delay. Flex sends an HTTP POST to a URL that you own at the moment the event happens.

Each webhook endpoint carries its own list of events. You choose which events Flex sends.


In this article:

  • Review what Flex sends in each request.

  • Find the event name you need.

  • Create a webhook endpoint.

  • Edit or delete a webhook endpoint.


Before you begin

Flex delivers a webhook to a server that you run. The server must be ready before you create the endpoint in Flex.

  • A URL on your server that accepts HTTP POST requests. Flex sends every webhook as an HTTP POST.

  • A server that is reachable from the public internet. Flex cannot deliver to an address that only your internal network can reach.

  • Admin access to the Developer Tools page on the Admin Portal. The Webhooks tab lives on that page.

  • A Flex plan that includes webhooks. On Grow, webhooks require the paid add-on.


How webhooks in Flex work

Your server is ready, but it does not know what shape of request to expect. Every Flex webhook arrives as a single HTTP POST with a JSON body.

Flex sends 1 request for each event. The body names the event in an eventType field. The body carries the record that changed in a data.object field. For example, a member.created event carries the new member record inside data.object.

The event list on the endpoint controls what Flex delivers. Flex sends only the events that you selected on that endpoint.


Find the event name you need

You know what a request looks like, but not which events Flex can send. Flex names every event after a record and an operation.

The following table lists the events that Flex sends, grouped by the record that changed.

Important: The event list has no entry for a signed contract. The event list also has no entry for a canceled booking. Select the event for the record operation you want, for example, contract.updated, and read the payload on your server to decide what happened.

Record

Events

Flex sends a request when

Company

company.created, company.updated, company.removed

A company is created, updated, or removed.

Company payment details

company.paymentdetails.created, company.paymentdetails.removed

Payment details are added to or removed from a company.

Member

member.created, member.updated, member.removed

A member is created, updated, or removed.

Member payment details

member.paymentdetails.created, member.paymentdetails.removed

Payment details are added to or removed from a member.

Invoice

invoice.created, invoice.updated, invoice.removed

An invoice, a credit note, or an overpayment is created, updated, or removed.

Invoice charge

invoice.charge.created, invoice.charge.updated, invoice.charge.removed

An invoice receives a payment, a payment status changes, or a payment is removed by hand.

Invoice allocation

invoice.allocation.created, invoice.allocation.removed

A credit is allocated to an invoice, or an allocation is removed by hand.

Fee

fee.created, fee.updated, fee.removed

A fee is created, updated, or removed.

Membership

membership.created, membership.updated, membership.removed

A membership is created, updated, or removed.

Booking

booking.created, booking.updated, booking.removed

A booking is created, updated, or removed.

Contract

contract.created, contract.updated, contract.removed

A contract is created, updated, or removed.

Ticket

ticket.created, ticket.updated, ticket.removed

An issue is created, updated, or removed.

Integration

integration.removed

An integration is disconnected from your organization.

Day pass

pass.created, pass.updated

A day pass is created or updated for a member or a company.

Occupancy slot

occupancyslot.created, occupancyslot.removed

A booking occurrence is created or removed, which is useful for recurring bookings.


Create a webhook endpoint

You have the event name, but Flex does not know where to send the request. An endpoint pairs a URL on your server with a list of events.

  1. Go to Settings > Data & Extensibility > Developer Tools, then select the Webhooks tab.

  2. Click Add Endpoint.

  3. In Endpoint URL, enter the address on your server that accepts HTTP POST requests. Flex sends every selected event to this address.

  4. In Description, enter what the webhook is for. The field is optional. The description is what tells 2 endpoints apart on the Webhooks tab.

  5. Under Events to send, select each event that you want Flex to deliver. Flex delivers only the events on this list.

  6. Save the endpoint.

Flex starts to send requests as soon as you save the endpoint. The first request arrives the next time 1 of the selected events happens in your organization.

You can also create and manage webhooks through the API. Read the webhook API reference ↗︎


Edit or delete a webhook endpoint

The endpoint now delivers the events you selected. When your integration changes, the endpoint must change with it.

Every endpoint in your organization is listed on the Webhooks tab. Open an endpoint to change its Endpoint URL, its Description, or its Events to send list. Delete an endpoint when the integration that uses it is retired.

Warning: If you delete an endpoint, Flex stops sending requests to that URL. To reduce traffic without losing the endpoint, remove events from the Events to send list instead.


Best practices

How you split events across endpoints decides how much traffic each server receives.

  • If you run more than 1 integration, create a separate endpoint for each integration. You can then change 1 integration without affecting the other.

  • If your integration reacts to 1 kind of change only, select that single event. Your server then receives no requests to discard.


FAQs

Delivery and payload handling happen on your server, outside Flex. The answers below cover what you can change in Flex.

Does Flex send a webhook when a contract is signed?
Flex does not send a webhook when a contract is signed. The contract events are contract.created, contract.updated, and contract.removed. Each fires when the contract record changes.

Can I set up a webhook without using the Admin Portal?
You can set up a webhook through the API instead of the Admin Portal. The API exposes a /webhooks endpoint for creating and managing webhooks.

Why is my server receiving nothing?
Your server receives nothing when Flex cannot reach the URL or when the event is missing from the endpoint's Events to send list. Ensure that the URL accepts HTTP POST requests from the public internet. Then open the endpoint and ensure that the event is selected.

Can I send different events to different systems?
You can send different events to different systems by creating a separate endpoint for each system. Each endpoint has its own Endpoint URL and its own Events to send list.

For payload examples, sample handler code, and the full event reference, read the OfficeRnD webhook documentation ↗︎

Did this answer your question?