Skip to main content
The startSession mutation creates or retrieves a stable guest session identifier used by SmartMenu for analytics and personalization. The returned sessionId should be stored on the client and sent back on subsequent requests via the X-Session-ID header.

Mutation

mutation StartGuestSession {
  startSession(
    input: {
      guestId: "PARTNER_GUEST_ID"
      # OR passportId: "PASSPORT_ID"
      # OR email: "guest@example.com"
    }
  ) {
    sessionId
  }
}
This mutation requires an API key scoped to your chain in the Authorization header. On subsequent SmartMenu calls, include the returned sessionId in the X-Session-ID header to enable analytics and personalization.

Input

input StartSessionInput {
  """
  Partner guest identifier.
  """
  guestId: String

  """
  EveryBite Passport identifier.
  """
  passportId: String

  """
  Guest email address.
  """
  email: String
}
Exactly one of guestId, passportId, or email must be provided. If email is used, it is normalized (trimmed and lowercased) before computing the session.

Response

type Session {
  """
  Stable, server-generated session identifier.
  """
  sessionId: String!
}

Example

mutation StartGuestSession {
  startSession(
    input: {
      guestId: "guest_abc123"
    }
  ) {
    sessionId
  }
}
{
  "data": {
    "startSession": {
      "sessionId": "sess_7f3a9c2e-8b1d-4e5f-a6c0-9d2e8f1a3b5c"
    }
  }
}