Checkfront webhooks allow you to receive real-time notifications when specific events occur in your account, such as new bookings, updates to existing bookings, item modifications, and transactions. When an event is triggered, Checkfront will send an HTTPS POST request with relevant data to your designated webhook URL.
- Event Trigger: A booking, item, or transaction update occurs in your Checkfront account.
- Webhook Notification: Checkfront sends an HTTPS POST request to your server with the event details.
- Server Acknowledgment: Your server must respond with an HTTP 200 class status code (e.g., 200 OK) to confirm receipt.
- Retry Mechanism: If Checkfront does not receive a successful response, it retries up to 5 times before disabling the webhook.
Webhook notifications can be sent in the following formats:
Example JSON payload:
{
"event": "booking.create",
"booking": {
"id": 123456,
"status": "CONFIRMED",
"customer": {
"name": "John Doe",
"email": "john@example.com"
},
"items": [
{
"id": 987,
"name": "City Tour",
"quantity": 2
}
]
}
}To configure a webhook in Checkfront:
- Navigate to Manage > Developer.
- Click on the Webhooks tab.
- Add a new webhook by specifying: - Webhook URL: Your server endpoint to receive notifications. - Event Types: Choose which events should trigger webhook notifications. - Format: Select JSON, XML, or x-www-form-urlencoded.
- Save the configuration and test the webhook using the Test Webhook button.
Your server should:
- Validate incoming requests by checking the request signature or IP if Checkfront provides security measures.
- Respond with an HTTP 200 status code as soon as the request is received.
- Process the payload asynchronously if needed (e.g., queue for later processing).
- Log received events for debugging purposes.
Example of a simple webhook handler in Python (Flask):
from flask import Flask, request, jsonify
app = Flask(__name__)
@app.route('/webhook', methods=['POST'])
def webhook():
data = request.get_json()
print("Received webhook:", data)
return jsonify({"message": "Webhook received"}), 200
if __name__ == '__main__':
app.run(port=5000)To test your webhook, you can use tools like:
- `Beeceptor <https://beeceptor.com/>`_ – Quickly inspect webhook requests and debug responses.
- `Typed Webhook Tools <https://typedwebhook.tools/>`_ – Capture and analyze webhook payloads.
These tools allow you to check if Checkfront is sending the correct data and verify how your server processes the webhook requests.
For a detailed list of webhook event types, refer to:
.. toctree::
:caption: Webhook Events
:glob:
:maxdepth: 1
webhook/*