Skip to content

previewCheckout

previewCheckout(items: [CheckoutItemInput!]!, buyer: BuyerInput, discountCode: String, giftCardCode: String, tipAmount: Int, donationAmount: Int, funding: FundingPreferenceInput, taxCalculationId: ID, formData: [RegistrationDataInput!], authorizeBalanceCard: Boolean, recurringConsentAccepted: Boolean, attribution: AttributionInput, idempotencyKey: String): CheckoutPreview!

Price a basket without minting anything. Takes the same items checkout does, so what a buyer previews and what they are charged cannot disagree — hand taxCalculationId back to checkout to be charged the figure shown.

Named apart from the legacy checkoutPreview only while both exist; that one goes when its callers move over.

Arguments

What is being bought.

Guest details, for a checkout with no signed-in viewer.

discountCodeString
giftCardCodeString
tipAmountInt
donationAmountInt

An 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.

taxCalculationIdID

The tax quote the buyer was shown, handed back so they are charged what they saw rather than a freshly recomputed figure.

authorizeBalanceCardBoolean

The 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.

recurringConsentAcceptedBoolean

The 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.

attributionAttributionInput
idempotencyKeyString

Client-supplied key that makes a retried mint return the original order instead of minting a second one.

Returns

CheckoutPreview!

See CheckoutPreview for the full shape.

Try it

Authentication
Example
Query
query PreviewCheckout($items: [CheckoutItemInput!]!, $buyer: BuyerInput, $discountCode: String, $giftCardCode: String, $tipAmount: Int, $donationAmount: Int, $funding: FundingPreferenceInput, $taxCalculationId: ID, $formData: [RegistrationDataInput!], $authorizeBalanceCard: Boolean, $recurringConsentAccepted: Boolean, $attribution: AttributionInput, $idempotencyKey: String) {
  previewCheckout(items: $items, buyer: $buyer, discountCode: $discountCode, giftCardCode: $giftCardCode, tipAmount: $tipAmount, donationAmount: $donationAmount, funding: $funding, taxCalculationId: $taxCalculationId, formData: $formData, authorizeBalanceCard: $authorizeBalanceCard, recurringConsentAccepted: $recurringConsentAccepted, attribution: $attribution, idempotencyKey: $idempotencyKey) {
    __typename
  }
}
Variables
{}
POST https://go.sessions.website/api/graphql