Skip to content

sessions_book_session

Books a session outright when the amount due is zero. Never takes payment details.

Writesign-in required

When to use it

  • Only when sessions_preview_checkout has already returned an amount due of zero.

  • For a free session, or one covered by a pass, membership or gift-card credit the person already holds.

  • Never as a first resort — the agent should have told the person what it is about to book.

Parameters

sessionstringrequired

The scheduled session id, as returned by sessions_list_schedule. Pass it through verbatim — it is an opaque global id, not a number.

ticketsarrayoptional

For a session that sells named admission bands ("Adult", "Child"), how many of each. One booking is written for the whole party. Price ids come from prices on sessions_get_session. Omit for a session that sells one undifferentiated spot.

passstringoptional

Id of the pass or membership to spend, from sessions_list_purchases. Omit for a free session.

giftCardCodestringoptional

Gift-card code to cover the seat.

discountCodestringoptional

Discount code that brings the total to zero.

Returns

Every tool returns two things: text for the model to read, and a structuredContent object beside it for code that would rather branch on a field.

The booking id and status on success. On refusal, an error carrying a code you can branch on: PAYMENT_REQUIRED when money is owed, REGISTRATION_BLOCKS_REQUIRED when a form or waiver is in the way, ALREADY_BOOKED when the viewer already holds or is queued for a place, BOOKING_REJECTED when checkout refuses the booking, or SIGN_IN_REQUIRED. Every refusal points at sessions_start_booking. When a pass was named that turned out to settle nothing, the PAYMENT_REQUIRED message says so — an entitlement that does not cover the session, or a pass predating the move to the new checkout — rather than reporting a bare balance.

Example

Run this from any agent or script executing in the page.

javascript
const tools =
  await document.modelContext.getTools();

const tool = tools.find(
  (t) => t.name === 'sessions_book_session',
);

const result = await document.modelContext
  .executeTool(tool, {
    "session": "<session id>",
    "pass": "<pass id>"
  });
content
Booked. Morning Yoga on 2026-09-02T09:00 →
2026-09-02T10:00 — booking <id>,
status confirmed. Nothing was charged.
structuredContent
{
  "booking": {
    "id": "<id>",
    "status": "confirmed",
    "admissions": 1,
    "createdAt": "2026-08-27T14:00:00.000Z",
    "waitlistPosition": null,
    "participant": {
      "id": "<id>",
      "name": "Dana Whitfield"
    }
  }
}

What the agent is told

The description the model reads when deciding whether to call this. It is the only thing that decides whether the tool fires at the right moment, so it is worth knowing what it says.

sessions_book_session
Completes a booking outright — but only when nothing is owed: a free session, or one fully covered by a pass, membership or gift-card credit the signed-in viewer already holds. The amount due is recomputed on the server immediately before booking, and anything above zero is refused; so is anything needing a waiver, contract or acknowledgement. In either case call sessions_start_booking instead, which puts the person in front of the sheet. Tell them what you are about to book before you call this.

See also