Skip to content

completePurchase

completePurchase(purchase: ID!, paymentMethod: ID): CompletePurchaseResult!

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.

Idempotent, and safe to race — the Stripe webhook calls the same routine, so a buyer who closes the tab mid-confirm still gets their booking exactly once.

Authorized by possession of the unguessable purchase id, so a guest can finish their own checkout. A signed-in caller must additionally own the purchase, so a leaked id cannot be completed by a third party.

Arguments

purchaseID!
paymentMethodID

Returns

CompletePurchaseResult!

See CompletePurchaseResult for the full shape.

Try it

Authentication
Example
Query
mutation CompletePurchase($purchase: ID!, $paymentMethod: ID) {
  completePurchase(purchase: $purchase, paymentMethod: $paymentMethod) {
    __typename
  }
}
Variables
{}
POST https://go.sessions.website/api/graphql