Import
Usage
Return value
| Property | Type | Description |
|---|---|---|
openCheckout | (options) => Promise<CheckoutResult> | Opens the checkout flow |
closeCheckout | () => void | Closes the checkout |
isLoading | boolean | Whether checkout is in progress |
error | Error | null | Last error, if any |
Checkout options
| Option | Type | Required | Description |
|---|---|---|---|
priceId | string | Yes | The price to charge |
customer | { email?, name?, taxId? } | No | Prefill customer info |
couponCode | string | No | Discount code |
existingSubscriptionId | string | No | For upgrades/downgrades |
metadata | Record<string, string> | No | Custom data |
adaptivePricing | boolean | No | Enable localized pricing |