Wedge 01
Booking Storefront
Drop into Cursor or Claude:
import FavCRM from '@favcrm/sdk';
const sdk = new FavCRM({
baseUrl: 'https://api.favcrm.io',
companyId: process.env.FAVCRM_COMPANY_ID,
});
const services = await sdk.bookings.listServices();
const slots = await sdk.bookings.getTimeSlots(serviceId, {
date: '2026-06-01',
});
const booking = await sdk.bookings.createBooking({
serviceId,
slotTime: slots[0].startTime,
participants: 2,
});Agent workflow
A · Merchant setup
One-time merchant setup. Fully MCP-native — same tool surface as the customer flow.
- 01
create_service_category({ name })— Optional grouping ("Treatments", "Classes"). - 02
create_service({ name, durationMinutes, price, capacity, categoryId? })— Define a bookable service. Add cancellationPolicy / requiresStaff / requiresResource as needed. - 03
set_staff_availability({ memberId, dayOfWeek, startTime, endTime })— Weekly working hours per staff member. Use date instead of dayOfWeek for one-off changes. - 04
create_resource({ name, type }) + set_resource_availability(...)— (Optional) For room/equipment-bound bookings.
B · Customer flow
Customer-facing storefront. Works via MCP tools, SDK, or raw REST.
- 01
list_services— Render service cards with name, price, duration, capacity. - 02
get_service_detail(serviceId)— (Optional) Show prep notes + cancellation policy on the detail page. - 03
get_available_slots(serviceId, { startDate, endDate })— Render date picker + open times. Returns [] if fully booked. - 04
create_booking({ serviceId, slotTime, participants, customer })— Confirm booking. Returns booking ID + status. - 05
cancel_booking({ bookingId, reason? })— Cancel flow. Server checks policy + computes refund eligibility.
Edge cases agents must handle
- • get_available_slots → [] : render "no availability" instead of erroring.
- • create_booking → 409 Conflict : another customer took the slot between fetch and book — refetch slots.
- • cancel_booking → cooldown error includes cancellationPolicy field — surface to user verbatim.
- • Capacity > 1 services : let user pick participants count up to service.capacity.