Skip to content

Teacher lessons on a website

Lessons are booked inside the Mr Charles app — students have an account, pay there and get their lesson in their agenda. What a teacher’s website can do is show the offers and the times that are actually free, and send the student into the app with everything preselected.

import { createClient } from '@mrcharles/sdk';
const mc = createClient();
const profile = await mc.teachers.profile(instructorUserId); // name, bio, instruments, rating…
const offers = await mc.teachers.offers(instructorUserId); // published offers only

Each offer carries title, instrument, durationMinutes, priceCents/currency and mode (online, in_person). Only published offers are returned; a draft never leaks.

const slots = await mc.teachers.slots({ instructorUserId, offerId: offers[0].id, date: '2026-10-20', days: 7 });
// slots.days → [{ date: '2026-10-20', times: ['10:00', '11:00', '17:00'] }, …] in the teacher's zone

slots applies the offer’s duration, the teacher’s policy (notice, horizon, buffers) and existing lessons; windows gives the raw free windows if you want to draw a calendar yourself. Neither is cached: fetch when the student opens the picker.

const url = mc.links.bookLesson({ instructorId: instructorUserId, offerId: offers[0].id });
// https://app.mrcharles.app/bookings/book?instructorId=…&offerId=…

The student lands on the booking screen with the teacher and offer selected, signs in or creates an account, picks the slot and pays. There is no guest flow for lessons on purpose: a lesson is a relationship with reminders, rescheduling and a chat, and those need an account.

  • Create a lesson booking from your server. There is no public write endpoint for lessons.
  • Read a student’s bookings. That is theirs, in the app.

Need either? Tell us what for — it is how the public surface grows.