Skip to main content
PynathPynath

Webhooks Integration Guide

Webhooks allow your application to automatically receive real-time HTTP POST notifications whenever an appointment is booked, rescheduled, or cancelled.

1. Registering an Endpoint

In your Pynath Booking dashboard under Settings Developer Webhooks, click Add Endpoint. Enter your public HTTPS URL (e.g. https://api.yourdomain.com/webhooks/pynath) and select the event topics you wish to subscribe to.

2. Subscribed Event Topics

Event TopicDescription
booking.createdFired when a new appointment is confirmed online or logged at the front desk.
booking.updatedFired when an appointment is rescheduled or staff assignment changes.
booking.cancelledFired when a client or provider cancels an active booking.
service.createdFired when a new service offering is published in the catalog.
service.updatedFired when service pricing, duration, or capacity limits are modified.

3. HMAC SHA-256 Signature Verification

Each webhook request sent by Pynath includes an X-Pynath-Signature header. Verify this header using your webhook signing secret:

import crypto from 'crypto';

export function verifyWebhookSignature(rawBody, signatureHeader, secretKey) {
  const hmac = crypto
    .createHmac('sha256', secretKey)
    .update(rawBody, 'utf8')
    .digest('hex');
    
  return crypto.timingSafeEqual(Buffer.from(hmac), Buffer.from(signatureHeader));
}

4. Sample Event Payload Envelope

{
  "id": "evt_98a72b3c4d5e",
  "event": "booking.created",
  "createdAt": "2026-08-04T07:45:00Z",
  "payload": {
    "id": "bk_716a29b4",
    "serviceId": "srv_haircut_pro",
    "serviceName": "Executive Haircut & Style",
    "customerName": "Michael Scott",
    "customerEmail": "[email protected]",
    "customerPhone": "+91 98765 43210",
    "startTime": "2026-08-05T14:00:00Z",
    "endTime": "2026-08-05T14:45:00Z",
    "status": "CONFIRMED",
    "totalAmount": 1200,
    "currency": "INR"
  }
}