ahmetskilinc

payload appointments plugin

by ahmetskilinc
Stores & catalogs
v3
^3.37.0

Overview

Summary generated from the README

Adds collections for appointments, services, team members, guest customers, waitlist and sent emails, plus an opening times global. It includes an availability engine, an admin schedule calendar and an analytics dashboard. Customer emails, payment webhooks and Jobs Queue tasks are built in. Requires Payload 3.37 or newer, an email adapter and extra fields on the users collection.

Features

  • Availability engine with buffer times, lead times, per-host hours and business timezone handling
  • Recurring appointment series with weekly, bi-weekly and monthly options
  • Deposit payments with a signed HMAC webhook and callbacks for payment providers
  • Customer emails with tokenized cancellation links, logged to a Sent Emails collection
  • Per-team-member iCal feeds and waitlist with automatic slot-freed notifications
  • Admin schedule calendar, analytics dashboard and Jobs Queue tasks for completion, reminders and waitlist expiry

Use cases

  • Run a salon or clinic booking system with services, staff schedules and customer reminders
  • Take deposits for appointments by connecting a payment provider through the payment hooks
  • Let staff subscribe to their own bookings in a calendar app through iCal feeds

From the author

Appointment scheduling for Payload CMS: bookings, services, team members, availability, waitlist, payments, emails, iCal feeds, and an admin calendar + analytics.

Installation

npm i payload-appointments-plugin

102

Stars

9

Forks

7

Open Issues

3 months ago

Last Updated

39

Weekly Downloads

v3.0.0

npm Version

196.5 KB

Unpacked Size

9

Dependencies

GitHub stars

102+5 since Sep 6

Show data
GitHub stars by day (UTC)
DateStars
Dec 5, 2026102
Dec 4, 2026102
Dec 3, 2026102
Dec 2, 2026102
Dec 1, 2026102
Nov 30, 2026102
Nov 29, 2026102
Nov 28, 2026102
Nov 27, 2026102
Nov 26, 2026102
Nov 25, 2026102
Nov 24, 2026102
Nov 23, 2026102
Nov 22, 2026102
Nov 21, 2026102
Nov 20, 2026102
Nov 19, 2026102
Nov 18, 2026102
Nov 17, 2026102
Nov 16, 2026102
Nov 15, 2026102
Nov 14, 2026102
Nov 13, 2026102
Nov 12, 2026102
Nov 11, 2026102
Nov 10, 2026102
Nov 9, 2026102
Nov 8, 2026102
Nov 7, 2026102
Nov 6, 2026102
Nov 5, 2026102
Nov 4, 2026102
Nov 3, 2026101
Nov 2, 2026101
Nov 1, 2026101
Oct 31, 2026101
Oct 30, 2026101
Oct 29, 2026101
Oct 28, 2026101
Oct 27, 2026101
Oct 26, 2026101
Oct 25, 2026101
Oct 24, 2026101
Oct 23, 2026101
Oct 22, 2026101
Oct 21, 2026101
Oct 20, 2026101
Oct 19, 2026101
Oct 18, 2026101
Oct 17, 2026101
Oct 16, 2026101
Oct 15, 2026101
Oct 14, 2026101
Oct 13, 2026101
Oct 12, 2026101
Oct 11, 2026101
Oct 10, 2026101
Oct 9, 2026101
Oct 8, 2026101
Oct 7, 2026101
Oct 6, 2026101
Oct 5, 2026101
Oct 4, 2026101
Oct 3, 2026101
Oct 2, 2026101
Oct 1, 2026101
Sep 30, 2026101
Sep 29, 2026101
Sep 28, 2026101
Sep 27, 2026101
Sep 26, 2026101
Sep 25, 2026101
Sep 24, 2026101
Sep 23, 2026101
Sep 22, 2026101
Sep 21, 2026101
Sep 20, 2026101
Sep 19, 2026101
Sep 18, 2026101
Sep 17, 2026100
Sep 16, 2026100
Sep 15, 2026100
Sep 14, 2026100
Sep 13, 202699
Sep 12, 202699
Sep 11, 202699
Sep 10, 202698
Sep 9, 202698
Sep 8, 202697
Sep 7, 202697
Sep 6, 202697
npm weekly downloads

13−17 since Sep 6

Show data
npm weekly downloads by day (UTC)
DateWeekly downloads
Dec 5, 202613
Dec 4, 202615
Dec 3, 202612
Dec 2, 202611
Dec 1, 202612
Nov 30, 202614
Nov 29, 202620
Nov 28, 202629
Nov 27, 202647
Nov 26, 202671
Nov 25, 202681
Nov 24, 202685
Nov 23, 202683
Nov 22, 202673
Nov 21, 202668
Nov 20, 202651
Nov 19, 202628
Nov 18, 202625
Nov 17, 202622
Nov 16, 202624
Nov 15, 202626
Nov 14, 202622
Nov 13, 202623
Nov 12, 202632
Nov 11, 202624
Nov 10, 202625
Nov 9, 202625
Nov 8, 202622
Nov 7, 202622
Nov 6, 202619
Nov 5, 20269
Nov 4, 202610
Nov 3, 202610
Nov 2, 202610
Nov 1, 202617
Oct 31, 202618
Oct 30, 202620
Oct 29, 202620
Oct 28, 202618
Oct 27, 202650
Oct 26, 202670
Oct 25, 202685
Oct 24, 2026103
Oct 23, 202699
Oct 22, 2026102
Oct 21, 2026108
Oct 20, 202674
Oct 19, 202652
Oct 18, 202629
Oct 17, 202611
Oct 16, 202614
Oct 15, 202614
Oct 14, 20268
Oct 13, 20268
Oct 12, 20269
Oct 11, 202610
Oct 10, 20269
Oct 9, 202611
Oct 8, 202611
Oct 7, 202623
Oct 6, 202631
Oct 5, 202636
Oct 4, 202635
Oct 3, 202635
Oct 2, 202633
Oct 1, 202644
Sep 30, 202637
Sep 29, 202657
Sep 28, 202651
Sep 27, 202654
Sep 26, 202657
Sep 25, 202654
Sep 24, 202640
Sep 23, 202636
Sep 22, 202619
Sep 21, 202620
Sep 20, 202624
Sep 19, 202623
Sep 18, 202623
Sep 17, 202626
Sep 16, 202626
Sep 15, 202614
Sep 14, 202616
Sep 13, 202613
Sep 12, 202613
Sep 11, 202627
Sep 10, 202624
Sep 9, 202628
Sep 8, 202628
Sep 7, 202630
Sep 6, 202630

Each point is npm's rolling 7-day download count.

Health Score

46/100Fair

Composite score based on GitHub activity, stars, npm downloads, publish recency, dependency count, and package size.

Badge for your README

Payload Directory health badge
Markdown
[![Payload Directory](https://payloaddirectory.dev/badge/778526499-root.svg)](https://payloaddirectory.dev/plugins/778526499-root)
HTML
<a href="https://payloaddirectory.dev/plugins/778526499-root"><img src="https://payloaddirectory.dev/badge/778526499-root.svg" alt="Payload Directory"></a>
Updated Aug 14, 2026Created Mar 27, 2024Published Dec 14, 2025

README

[!Warning] This plugin is a WIP and currently testing.

Payload Appointments Plugin

Appointment scheduling for your Payload app:

  • Appointments, Services, Team Members, Guest Customers, Waitlist, Sent Emails collections and an Opening Times global (multiple intervals per day + holiday dates).
  • Admin schedule calendar view (/admin/appointments/schedule) and analytics dashboard (/admin/appointments/analytics).
  • Availability engine with buffer times, lead times, max-advance booking, per-host custom hours, and business-timezone handling.
  • Recurring appointments (weekly / bi-weekly / monthly series).
  • Payments with full/fixed/percentage deposits and a signed payment webhook.
  • Customer emails (created / updated / cancelled) with tokenized cancellation links, logged to the Sent Emails collection.
  • iCal feeds per team member.
  • Waitlist with automatic notification when a slot frees up.
  • Jobs Queue tasks for auto-completing past appointments and expiring waitlist notifications.

Appointments Schedule View

Appointments List day

Dashboard View

Dashboard

Installation

npm i payload-appointments-plugin
pnpm add payload-appointments-plugin
yarn add payload-appointments-plugin

1. Add the plugin to your config

import { appointmentsPlugin } from 'payload-appointments-plugin';

export default buildConfig({
  // serverURL is used to build cancellation links in customer emails
  serverURL: 'https://your-app.com',
  plugins: [
    appointmentsPlugin({
      seedData: false, // seed example services/team members/opening times on init
      showDashboardCards: true, // dashboard cards in the admin panel
      showNavItems: true, // nav links for schedule + analytics views
      webhookSecret: process.env.APPOINTMENTS_WEBHOOK_SECRET, // required for the payment webhook
      // paymentHooks: { onPaymentRequired, onPaymentReceived, onRefundRequested },
    }),
  ],
});

2. Add fields to your users collection

The plugin relates appointment customers to your users collection:

const Users: CollectionConfig = {
  // ...
  fields: [
    { name: 'firstName', type: 'text', label: 'First name' },
    { name: 'lastName', type: 'text', label: 'Last name' },
    {
      name: 'roles',
      type: 'select',
      options: [
        { label: 'Admin', value: 'admin' },
        { label: 'Customer', value: 'customer' },
      ],
    },
    {
      name: 'appointments',
      type: 'join',
      collection: 'appointments',
      on: 'customer',
    },
  ],
};

3. Configure email

Customer emails use your app's email adapter. The "from" address is your adapter's defaultFromAddress (or the APPOINTMENT_EMAIL_FROM env var as a fallback).

4. Run the maintenance jobs

The plugin registers three Jobs Queue tasks:

  • appointmentsAutoComplete — marks past appointments as completed.
  • appointmentsExpireWaitlist — expires lapsed waitlist notifications and notifies the next person in line.
  • appointmentsReminder — emails customers whose appointment starts within the next reminderHours (default 24) and hasn't been reminded yet.

Queue and run them on a schedule, e.g. with autorun:

export default buildConfig({
  jobs: {
    autoRun: [{ cron: '*/15 * * * *', queue: 'default' }],
  },
  onInit: async (payload) => {
    await payload.jobs.queue({ task: 'appointmentsAutoComplete', input: {}, queue: 'default' });
    await payload.jobs.queue({ task: 'appointmentsExpireWaitlist', input: {}, queue: 'default' });
    await payload.jobs.queue({ task: 'appointmentsReminder', input: {}, queue: 'default' });
  },
});

(Or trigger payload.jobs.run() from a cron endpoint on serverless hosts.)

Plugin options

OptionTypeDefaultDescription
collectionsobject—Per-collection overrides, including slug renames (see below).
globalsobject—Per-global overrides for openingTimes, including slug.
adminGroupstring'Appointments'Admin group and nav-section label for all plugin collections/globals.
endpointsobject—Override any API endpoint path (see below).
viewsobject—Admin view routes and nav labels for the schedule and analytics views.
jobsobject—Override the Jobs Queue task slugs (autoComplete, expireWaitlist, reminder).
reminderHoursnumber24Reminder emails go out when an appointment starts within this many hours.
rateLimitobject{ max: 60, windowMs: 60000 }Per-IP limit for public endpoints and unauthenticated creates. { disabled: true } turns it off. In-memory per server instance — pair with an edge/WAF limiter on serverless.
emailsobject—Customize outgoing customer emails per type (see below).
cancelPagePathstring'/cancel'Frontend page the emailed cancellation link points at (token appended).
calendarobject{ dayStartHour: 9, dayEndHour: 19, step: 15 }Schedule calendar display hours and slot step.
waitlistExpiryHoursnumber2Hours a notified waitlist entry has to book before it expires.
defaultAppointmentDurationnumber30Fallback appointment length (minutes) when no end time or services are given.
disabledbooleanfalseDisables endpoints/UI/hooks. Collections stay registered so the schema is stable.
seedDatabooleanfalseSeeds example opening times, services, and team members on init.
showDashboardCardsbooleantrueShow appointment cards on the admin dashboard.
showNavItemsbooleantrueShow schedule/analytics links in the admin nav.
webhookSecretstring—HMAC secret for the payment webhook. The webhook rejects all calls without it.
paymentHooksPaymentHooks—Callbacks to integrate a payment provider (see below).

Collection & slug overrides

Every collection the plugin registers (appointments, guestCustomers, sentEmails, services, teamMembers, waitlist) and the openingTimes global can be customized:

appointmentsPlugin({
  collections: {
    // Rename the collection — every internal reference (relationships,
    // endpoints, hooks, jobs, admin views) follows the new slug.
    appointments: { slug: 'bookings' },
    services: {
      slug: 'treatments',
      // Extend (or replace) the default fields.
      fields: ({ defaultFields }) => [...defaultFields, { name: 'color', type: 'text' }],
      // Merged one level deep with the defaults.
      access: { read: () => true },
      admin: { group: 'Booking' },
      // Appended after the plugin's own hooks, never replacing them.
      hooks: { afterChange: [myHook] },
    },
  },
  globals: {
    openingTimes: { slug: 'businessHours' },
  },
});

Override semantics:

  • slug renames the collection/global; all internal references follow it.
  • access and admin are merged one level deep with the plugin defaults.
  • hooks are appended after the plugin's own hooks (the plugin's booking logic keeps working).
  • fields is a function receiving { defaultFields } and returning the final field array.
  • Any other property is shallow-merged over the default config.

Customer relationships point at your auth collection: the plugin reads config.admin.user (default users), so no option is needed for that.

Routes, views, jobs & tunables

Everything structural is overridable — endpoint paths, admin view routes and labels, the admin group, job slugs, and scheduling tunables:

appointmentsPlugin({
  adminGroup: 'Bookings',
  endpoints: {
    availableSlots: '/slots',
    analytics: '/booking-analytics',
    // ...any of: cancelAppointment, appointmentByToken, cancelAppointmentByToken,
    // paymentWebhook, updateRecurring, cancelRecurring, icalFeed,
    // waitlistJoin, waitlistLeave, waitlistPosition
  },
  views: {
    schedule: { path: '/bookings/calendar', label: 'Calendar' },
    analytics: { path: '/bookings/analytics', label: 'Insights' },
  },
  jobs: { autoComplete: 'bookingsAutoComplete', expireWaitlist: 'bookingsExpireWaitlist' },
  cancelPagePath: '/cancel-booking',
  calendar: { dayStartHour: 8, dayEndHour: 20, step: 30 },
  waitlistExpiryHours: 4,
  defaultAppointmentDuration: 45,
});

Resolved settings are readable at runtime via getSettings(payload.config) (exported from the plugin).

Email overrides

Customize the subject, plain text, and/or HTML of each customer email type (created, updated, cancelled, reminder) without giving up the built-in sending/logging pipeline:

appointmentsPlugin({
  emails: {
    created: {
      subject: ({ appointment }) => `See you soon, ${appointment.customer?.firstName}!`,
      html: async ({ appointment, cancelUrl, timezone }) => renderMyEmail({ appointment, cancelUrl, timezone }),
    },
    cancelled: { subject: 'Your booking was cancelled' },
    // 'updated' keeps the defaults
  },
});

Payment hooks

appointmentsPlugin({
  webhookSecret: process.env.APPOINTMENTS_WEBHOOK_SECRET,
  paymentHooks: {
    // Called after an appointment that requires payment is created.
    // Return the provider's payment id (stored as payment.externalPaymentId).
    onPaymentRequired: async (appointment) => {
      const session = await stripe.checkout.sessions.create(/* ... */);
      return { paymentUrl: session.url, paymentId: session.id };
    },
    onPaymentReceived: async (appointment, paymentData) => {
      /* fulfil, notify, etc. */
    },
    onRefundRequested: async (appointment) => {
      /* refund with your provider */
    },
  },
});

Endpoints

All endpoints are mounted under your API route (default /api).

MethodPathAuthDescription
GET/get-available-appointment-slotsPublicAvailable slots. Query: services (comma-separated ids, required), day (required), host (optional). Returns { availableSlots, filteredSlots, bookingWindow, slotDuration, bufferTime }.
GET/appointment-by-tokenCancellation tokenMinimal appointment details for the cancellation page. Query: token.
POST/cancel-appointment-by-tokenCancellation tokenCancels the appointment for that token. Query: token.
POST/cancel-appointmentAuthenticated userCancels an appointment by id. Query: id.
PUT/update-recurring-appointmentAuthenticated userBody: { appointmentId, updateType: 'single'|'all'|'future', data }. Only start, end, services, host, customerNotes, internalNotes, status are updatable.
POST/cancel-recurring-appointmentAuthenticated userBody: { appointmentId, cancelType: 'single'|'all'|'future' }.
GET/appointments-analyticsAuthenticated userAnalytics data. Query: startDate, endDate, granularity (day|week|month).
POST/appointments-payment-webhookHMAC signatureSee below.
GET/appointments-icaliCal feed tokeniCal feed for the token's team member. Query: token, months (default 3, max 24).
POST/waitlist/joinPublicBody: { serviceId, hostId?, customerId?, guestCustomerId?, preferredDates?, preferredTimeRange?, notes? }.
GET/waitlist/positionPublic (by entry id)Query: id. Returns position in line.
DELETE/waitlist/leaveAuthenticated userQuery: id.

Payment webhook

POST /api/appointments-payment-webhook requires an HMAC-SHA256 signature of the raw request body using your webhookSecret, sent in the x-appointments-signature header (hex):

import crypto from 'crypto';

const body = JSON.stringify({
  appointmentId: '42',
  paymentId: 'pay_123',
  status: 'success', // 'success' | 'failed' | 'refunded' | 'partial-refund'
  amountPaid: 50,
  // refundAmount: 25, // for partial-refund
});

const signature = crypto.createHmac('sha256', process.env.APPOINTMENTS_WEBHOOK_SECRET).update(body).digest('hex');

await fetch('https://your-app.com/api/appointments-payment-webhook', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json', 'x-appointments-signature': signature },
  body,
});

Payment status transitions use the appointment's payment.amountDue (deposit) and payment.totalPrice: paying at least the deposit → deposit-paid, the full price → paid.

iCal feeds

Each team member gets an auto-generated icalToken (visible to authenticated users in the admin panel). Subscribe from any calendar app:

https://your-app.com/api/appointments-ical?token=<icalToken>

Environment variables

VariablePurpose
APPOINTMENTS_WEBHOOK_SECRETSuggested env var to pass as webhookSecret.
APPOINTMENT_EMAIL_FROMFallback "from" address when the email adapter has no default.

Development

pnpm install
pnpm dev        # dev app in ./dev (needs DATABASE_URI + PAYLOAD_SECRET)
pnpm test       # vitest unit tests
pnpm lint
pnpm build

Roadmap

  • Collection/slug overrides via plugin options
  • Variable service pricing (fixed or per-hour)
  • RRULE-based iCal recurrence
  • Per-day multiple intervals + holiday dates in opening times
  • E2E test suite

Contributions welcome.

Similar plugins