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.

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 registration 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_REGISTERED, or SIGN_IN_REQUIRED. Every refusal points at sessions_start_booking.

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 — registration <id>,
status registered. Nothing was charged.
structuredContent
{
  "registration": {
    "id": "<id>",
    "status": "registered",
    "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 registration 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 registering, 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