checkout
checkout(items: [CheckoutItemInput!]!, buyer: BuyerInput, discountCode: String, giftCardCode: String, tipAmount: Int, donationAmount: Int, funding: FundingPreferenceInput, taxCalculationId: ID, formData: [RegistrationDataInput!], authorizeBalanceCard: Boolean, recurringConsentAccepted: Boolean, ageRuleAccepted: Boolean, attribution: AttributionInput, idempotencyKey: String, botChallengeToken: String, admissionTokens: [String!]): CheckoutResult!Price a basket, mint the order, and — when money is owed — the PaymentIntent to pay for it. The single entry point for booking a session, buying a product, booking an appointment time, or entering a team or individual into a league: one mutation, any mix of items, one order.
Two phases. This one writes a pending purchase and its lines, holding no capacity and spending no credits, and returns a CheckoutSession for the client to confirm with Stripe Elements. completePurchase (or the webhook backing it up) then fulfills it. A free or fully credit-funded basket skips Stripe entirely and comes back already completed, with a null checkoutSession — the same free-versus-paid contract the mutations it replaces had.
Works signed-out when the business allows guest checkout: pass buyer with the buyer's email and a bot-challenge token.
Arguments
items[CheckoutItemInput!]!What is being bought.
buyerBuyerInputGuest details, for a checkout with no signed-in viewer.
discountCodeStringgiftCardCodeStringtipAmountIntdonationAmountIntAn optional gift to the business, in cents, added after tax beside the tip and never taxed. Refused unless every activity in the basket has RegistrationConfiguration.acceptsDonations on.
fundingFundingPreferenceInputtaxCalculationIdIDThe tax quote the buyer was shown, handed back so they are charged what they saw rather than a freshly recomputed figure.
formData[RegistrationDataInput!]authorizeBalanceCardBooleanThe buyer agrees this order's balance may be charged to the card they are paying with, once the service has been delivered.
Only meaningful on a checkout that leaves a balance — a deposit. Omitted or false, the order keeps no card and the balance is collected the way every other one is: a card at the desk, the emailed link, or cash. An absent value is a no, never a default yes.
recurringConsentAcceptedBooleanThe buyer agrees to be charged again for each membership in the basket, at its price, every billing cycle, until they cancel.
Required — and must be true — for a basket holding a membership with a price: the order pays for the first period, and the card it is paid with is kept and charged for every period after. An absent value is a no, and the checkout is refused. Ignored for a basket with no membership in it.
ageRuleAcceptedBooleanThe buyer confirms that everyone they are booking for meets each session's minimum age and will bring photo ID: an activity whose registration.restrictions.age has checkedAtDoor and a minimumAge (an 18+, 19+ or 21+ night).
Required, and must be true, for a basket holding such a session, signed in or not: an absent value is a no, and the checkout is refused with field: "ageRuleAccepted". Ignored for a basket with no session checked at the door. The confirmation is recorded on each booking it covers as sessions.admission.age-confirmation block metadata.
Never asked of staff: checkoutAsStaff and every Business API request book without it, since the box office sees its customer. Appointments and league entries carry no session rule and are not asked either.
attributionAttributionInputidempotencyKeyStringClient-supplied key that makes a retried mint return the original order instead of minting a second one.
botChallengeTokenStringThe bot challenge token, for a signed-in buyer of a session whose activity is highDemand, checking out from a browser on a Sessions page. A guest sends theirs on buyer instead. Site key from Services.botChallenge.siteKey; fails open like the guest challenge. A request with no first-party Origin — a native app, an embed on another domain, a server — is not challenged and is throttled per buyer instead. A missing or failed token is refused with field: "botChallengeToken".
admissionTokens[String!]Admission tokens from the waiting room (enterWaitingRoom), one for each session in the basket whose activity is highDemand. Every buyer of such a session waits their turn, on every client: a missing, expired or mismatched token is refused with field: "admissionTokens", and the client should enter the room again. Ignored for sessions that are not high demand.
Returns
See CheckoutResult for the full shape.
Try it
Example
mutation Checkout($items: [CheckoutItemInput!]!, $buyer: BuyerInput, $discountCode: String, $giftCardCode: String, $tipAmount: Int, $donationAmount: Int, $funding: FundingPreferenceInput, $taxCalculationId: ID, $formData: [RegistrationDataInput!], $authorizeBalanceCard: Boolean, $recurringConsentAccepted: Boolean, $ageRuleAccepted: Boolean, $attribution: AttributionInput, $idempotencyKey: String, $botChallengeToken: String, $admissionTokens: [String!]) {
checkout(items: $items, buyer: $buyer, discountCode: $discountCode, giftCardCode: $giftCardCode, tipAmount: $tipAmount, donationAmount: $donationAmount, funding: $funding, taxCalculationId: $taxCalculationId, formData: $formData, authorizeBalanceCard: $authorizeBalanceCard, recurringConsentAccepted: $recurringConsentAccepted, ageRuleAccepted: $ageRuleAccepted, attribution: $attribution, idempotencyKey: $idempotencyKey, botChallengeToken: $botChallengeToken, admissionTokens: $admissionTokens) {
__typename
}
}
https://go.sessions.website/api/graphql