Skip to content

Mutations

18 root mutations.

  • checkout
    Price a basket, mint the order, and — when money is owed — the PaymentIntent to pay for it. The single entry point that replaces registerForActivity, purchaseProduct, bookActivityTime, signUpTeam and signUpIndividual: one mutation, any mix of items, one order.
  • completePurchase
    Fulfill a minted purchase once its payment has been confirmed: books the sessions, mints the entitlements, spends the credits, and records how the order was funded, all in one transaction.
  • cancelBooking
    Cancel a booking and, under the activity's cancellation policy, return the money and the credits it consumed. Booking.cancellationPreview says what this will do before it is called.
  • joinBookingWaitlist
    Join the queue for a full session. Writes a waitlisted booking with no order behind it — nothing is charged until a place is offered and accepted.
  • acceptBookingOffer
    Accept an offered place. Re-enters checkout for the amount owed, so the result carries a CheckoutSession exactly as checkout does; the existing waitlisted booking is confirmed rather than a second one inserted.
  • createAccount
    Request an email containing a 6-digit code to confirm a new account. Always returns success regardless of whether the email is already in use (anti-enumeration). If an account already exists for the email, a sign-in code is sent instead.
  • signIn
    Request a sign-in email containing a 6-digit code. Always returns success regardless of whether the email matches an existing account (anti-enumeration).
  • redeemAuthCode
    Redeem a 6-digit auth code and sign the user in. Returns the created or signed-in user, the JWT token, and the redirect URL stored on the code. Sets the auth cookie on success — except for codes that were issued with a business pin, which return a business-scoped token without touching the cookie session.
  • confirmSocialSignUp
    Create the account a social sign-in stopped short of creating, and sign in as it. token is the pending sign-up handed to a popup opener; omit it and the pending cookie is used instead (the popup-blocked flow, which has no opener to hand anything to). name is the viewer's chosen display name, falling back to whatever the provider shared.
  • cancelSocialSignUp
    Discard a pending social sign-up without creating anything. Clears the pending cookie so a later page load doesn't ask again.
  • registerForActivity
    Register for an individual activity session. Use productPurchase to pay with an existing pass/membership, or omit it for direct purchase. Pass guest to register on behalf of someone else; the caller is recorded as the booker and pays. The activity's participant policy must allow guest registrations.
  • bookActivityTime
    Books an open time range on a structure: booking activity. Validates [startAt, endAt) is a contiguous run of the activity's open increments whose increment count is within [minIncrements, maxIncrements], then creates the booking — an activityId-tied appointment session + registration. Free bookings confirm immediately; activities set to request mode create a pending request the business approves or declines. Paid bookings charge bookingPricePerIncrement × increments and create the booking only once payment succeeds (via completeCheckout). buyer supplies guest details when the caller is not signed in.
  • cancelActivityRegistration
    Cancel an existing activity registration.
  • completeCheckout
    Complete a checkout after Stripe confirmation, then fulfill the underlying entity (pass purchase or registration). Idempotent — safe to call multiple times.
  • purchaseProduct
    Purchase a product (pass, membership, gift card, or physical product). Returns a checkout session if payment is required, or the purchase directly for free products.
  • createBankDebitMandateSetup
    Mint a SetupIntent on the business's connected account so the buyer can authorize a bank-debit mandate before the subscription they're paying for exists.
  • addFavorite
    Add a business, staff member (instructor), or activity to the authenticated user's favorites. Idempotent — adding an existing favorite is a no-op.
  • removeFavorite
    Remove a business, staff member, or activity from the authenticated user's favorites. Idempotent — removing a favorite that isn't set is a no-op.