Developer Documentation

Webhooks

Receive real-time notifications when events happen in your Reservie account.

Overview

Webhooks allow you to receive real-time HTTP notifications when specific events occur in your Reservie account. Instead of polling the API for changes, webhooks push data to your endpoint automatically.

Setup

To configure webhooks for your account:

  1. Log in to your Reservie admin dashboard
  2. Navigate to Settings → Integrations → Webhooks
  3. Enter your endpoint URL (must be HTTPS)
  4. Select which events you want to receive
  5. Save your configuration

Technical Requirements

  • Your endpoint must accept POST requests
  • Your endpoint must use HTTPS
  • Your endpoint must respond with a 2xx status code within 10 seconds
  • If your endpoint fails to respond, Reservie will retry up to 3 times with exponential backoff

Security

Each webhook request includes a X-Reservie-Signature header containing a JWT-signed payload. You can verify the authenticity of webhook requests using your webhook signing key, available in your dashboard.

Verifying Signatures

Use your webhook secret to verify the JWT signature:

const jwt = require('jsonwebtoken');

function verifyWebhook(req, webhookSecret) {
  const signature = req.headers['x-reservie-signature'];
  try {
    const decoded = jwt.verify(signature, webhookSecret);
    return decoded;
  } catch (err) {
    throw new Error('Invalid webhook signature');
  }
}

Webhook Events

On Registration

Triggered when a customer registers for an event or schedule. This webhook fires after a successful booking is confirmed.

POST https://your-endpoint.com/webhook
Content-Type: application/json
X-Reservie-Signature: <jwt-token>

{
  "event": "registration.created",
  "timestamp": "2024-01-15T10:30:00Z",
  "data": {
    "registrationId": "reg_123",
    "customerId": "cust_456",
    "customerEmail": "[email protected]",
    "customerName": "Jane Smith",
    "eventId": "evt_789",
    "eventTitle": "Morning Yoga",
    "eventDate": "2024-01-20T09:00:00Z",
    "spots": 1,
    "totalPaid": 15.00,
    "currency": "GBP",
    "paymentMethod": "stripe",
    "passUsed": null
  }
}

On Purchase (Pass)

Triggered when a customer purchases a class pass or bundle.

{
  "event": "pass.purchased",
  "timestamp": "2024-01-15T10:30:00Z",
  "data": {
    "customerPassId": "cp_123",
    "customerId": "cust_456",
    "customerEmail": "[email protected]",
    "customerName": "Jane Smith",
    "passId": "pass_789",
    "passTitle": "10 Class Bundle",
    "totalUses": 10,
    "remainingUses": 10,
    "startDate": "2024-01-15",
    "expiryDate": "2024-04-15",
    "totalPaid": 100.00,
    "currency": "GBP",
    "paymentMethod": "stripe"
  }
}

On Purchase (Event)

Triggered when a customer purchases a ticket to a one-off event or workshop.

{
  "event": "event.purchased",
  "timestamp": "2024-01-15T10:30:00Z",
  "data": {
    "purchaseId": "pur_123",
    "customerId": "cust_456",
    "customerEmail": "[email protected]",
    "customerName": "Jane Smith",
    "eventId": "evt_789",
    "eventTitle": "Weekend Workshop: Advanced Yoga",
    "eventDate": "2024-02-10T10:00:00Z",
    "tickets": 1,
    "totalPaid": 45.00,
    "currency": "GBP",
    "paymentMethod": "stripe",
    "discountCode": null
  }
}

Testing Webhooks

You can test your webhook endpoint using the Send Test button in your webhook settings. This sends a sample payload to your endpoint so you can verify your integration is working correctly.

For local development, consider using a tool like ngrok to expose your local server to the internet.

Need Help?

If you have questions about webhooks or need assistance with your integration, please contact our support team.