useCheckout hook creates checkout sessions using your backend checkout route.
By default it calls POST /api/priceos/v1/checkout.
Usage
Parameters
Optional fallback
customerId used when openCheckout/createCheckoutSession are called without customerId in the body.Returns
Creates a checkout session and returns
{ url }.Creates a checkout session, then redirects the browser to Stripe Checkout.
Body fields
Product key from your PriceOS dashboard to start checkout for.
Optional Stripe price ID override. When omitted, PriceOS uses the product’s default active Stripe price.
Optional URL to redirect to when checkout succeeds.
Optional URL to redirect to when checkout is canceled.
Optional customer override. If omitted, the hook uses
options.customerId or your backend identifyCustomer.Optional metadata to attach to the Stripe checkout session.
Optional Stripe Checkout session params to merge into the request.