GraphQL API

Endpoint, authentication, generated CRUD, and the custom Salon queries and mutations.

GraphQL is served at /api/graphql. The checked-in schema.graphql in the repo is the reference for a revision.

Authentication

Sessions use the keystonejs-session cookie. Sign in with authenticateUserWithPassword, sign out with endSession. Each operation re-checks the caller's Role flags. See Roles and permissions.

Queries

QueryArgumentsPurpose
checkAvailabilitystylistId, date, serviceDuration, serviceId, locationIdOpen slots
calculateCommissionstylistId, startDate, endDateCommission totals
storefrontStylistsserviceId, takePublic stylists
storefrontStylistidOne public stylist
salonOperationsWorkspacesection, rangeDashboard list data and reports
salonManagementWorkspacekindManagement lists
salonLocationStockappointmentId, locationId, skip, take, searchStock at a location
clientPortalnoneSigned-in client's visits and benefits
publicStorefrontSettingsnoneStorefront identity
storefrontBenefitsnoneActive plans
giftCardBalancecodeBalance lookup
redirectToInitnoneTrue while there are no users

Mutations

GroupMutations
AccountsregisterSalonCustomer(name, email, password, phone)
BookingbookAppointment, transitionAppointment(appointmentId, status, reason), scheduleAppointmentSegments, transitionAppointmentSegment, processAppointmentDeposit
WaitlistjoinWaitlist, joinWaitlistAsClient, transitionWaitlistEntry(waitlistEntryId, action, appointmentId, reason)
SchedulesupsertStylistSchedule, setStylistScheduleAvailability, setSalonResourceAvailability
CheckoutcompleteAppointmentCheckout, processPayment, confirmPayment, refundPayment, distributeTip
ReversalsreverseSalonTransaction, adjustSaleCompensation
PayoutspayoutCommissions, payoutGratuities
BenefitssellClientBenefit, setClientBenefitStatus, redeemClientPackage
Gift cardspurchaseGiftCard, confirmGiftCardPurchase, applyGiftCardBalance
LoyaltyadjustClientPoints, completeReferral
CareupdateClientCareProfile, submitAppointmentReview, publishConsultationTemplateVersion, submitConsultation, reviewConsultation
StockadjustSalonInventory
SetupupsertSalonStoreSettings, saveSalonRecord, runSalonOnboarding

Mutations that change money or stock take an idempotencyKey. Reusing a key with different arguments fails. Reusing it with the same arguments returns the first result.

Example: book

mutation Book($serviceIds: [ID!]!, $stylistId: ID!, $startTime: String!) {
  bookAppointment(
    serviceIds: $serviceIds
    stylistId: $stylistId
    startTime: $startTime
    clientName: "Ada Lovelace"
    clientEmail: "ada@example.com"
    policyAccepted: true
    policyVersion: "salon-booking-v2"
    requestKey: "book-123"
  ) {
    success
    error
  }
}

Example: check out

mutation Checkout($appointmentId: ID!) {
  completeAppointmentCheckout(
    appointmentId: $appointmentId
    paymentMethod: "cash"
    tipAmount: 1000
    discountAmount: 0
    idempotencyKey: "checkout-123"
  ) {
    success
    error
  }
}

Generated CRUD

Simple lists keep generated queries and mutations: membership and package plans, loyalty programs, referrals, review moderation, client notes, color formulas, form templates, and createSalonImage.

Webhooks and assistant

  • POST /api/payments/webhooks/[provider] for Stripe events.
  • /api/completion is the dashboard assistant and /api/mcp-transport/[transport] its MCP endpoint, both for signed-in users with canAccessDashboard.

On this page