Components

CheckoutPage

Deliver a polished checkout flow with interchangeable payment methods, clear order summaries, and built-in support for custom-domain routing.

Preview

Components are rendered dynamically to avoid mixing documentation styles with your application bundle. Swap providers without rewriting layout code.

Brand the payment toggle

Pass a logo string or React node on each payment method to surface provider marks. Strings render as images automatically, while nodes let you swap in SVGs, icon components, or fully custom badges.

Usage

The component is headless with respect to payment SDKs. Provide one or more payment method components that call the onChange callback with gateway-specific metadata.

app/billing/checkout.tsx

REST endpoints

AuthCore now exposes checkout APIs that create sessions, list providers, and mark intents complete. They reuse the existing middleware stack so custom domains resolve before validation runs.

src/pages/api/checkout/sessions.ts
Webhook security

Set AUTHCORE_CHECKOUT_SECRET to require an X-Authcore-Signature header on PATCH/DELETE requests. Super admins can still mutate sessions manually for adhoc fixes.

src/pages/api/webhooks/checkout.ts

Props

PropTypeDescription
title
paymentMethods[].logostring | ReactNodeOptional provider branding. Strings are rendered as images, while React nodes can return SVGs, icon components, or custom badges.
stringHeadline displayed at the top of the checkout page.
lineItemsLineItem[]Displayable breakdown of products, add-ons, and seat counts.
summaryCheckoutSummaryContains subtotal, taxes, discounts, and the final amount in cents.
paymentMethodsPaymentMethodOption[]List of pluggable payment surfaces; swap Stripe Elements for Apple Pay without touching layout.
onSubmit(payload) => Promise<void>Invoked when the user confirms payment. Create checkout sessions and redirect within this callback.

Best practices

  • • Use the new /api/checkout/sessions endpoint to centralize provider logic.
  • • Attach organizationId automatically when checkout is launched from a custom domain.
  • • Listen to provider webhooks and patch session status via PATCH /api/checkout/sessions/:id.
  • • Mirror session metadata into your billing provider for reconciliation.