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.
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.
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.
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.
Props
Prop | Type | Description |
---|---|---|
title | ||
paymentMethods[].logo | string | ReactNode | Optional provider branding. Strings are rendered as images, while React nodes can return SVGs, icon components, or custom badges. | string | Headline displayed at the top of the checkout page. |
lineItems | LineItem[] | Displayable breakdown of products, add-ons, and seat counts. |
summary | CheckoutSummary | Contains subtotal, taxes, discounts, and the final amount in cents. |
paymentMethods | PaymentMethodOption[] | 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.