Parameters used to customise the purchase flow when invoking the .purchase method.

interface PurchaseParams {
    brandingAppearanceOverride?: Partial<BrandingAppearance>;
    customerEmail?: string;
    defaultLocale?: string;
    discountCode?: string;
    externalPurchaseTokenId?: string;
    htmlTarget?: HTMLElement;
    metadata?: PurchaseMetadata;
    onDiscountCodeChanged?: (discountCode: null | string) => void;
    purchaseOption?: null | PurchaseOption;
    rcPackage: Package;
    selectedLocale?: string;
    showDiscountCodeField?: boolean;
    skipSuccessPage?: boolean;
    termsAndConditionsUrl?: string;
}

Properties

brandingAppearanceOverride?: Partial<BrandingAppearance>

Overrides the Dashboard branding appearance for this purchase. Only the provided values are overridden; all other values keep their Dashboard configuration.

For Stripe Checkout, this customizes the supported mobile wallet experience. The Stripe-hosted fallback opened through "Pay another way" remains light and cannot currently be customized.

customerEmail?: string

The email of the user. If undefined, RevenueCat will ask the customer for their email.

defaultLocale?: string

The default locale to use if the selectedLocale is not available. Defaults to english.

discountCode?: string

Initial discount code to apply at checkout. For Web Billing this is displayed as applied in the checkout UI. For Paddle this is passed to Paddle Checkout as discountCode. This is useful when the code originated outside of the checkout UI, for example from a URL parameter.

externalPurchaseTokenId?: string

The RevenueCat public identifier for an Apple external purchase token.

htmlTarget?: HTMLElement

The HTML element where the billing view should be added. If undefined, a new div will be created at the root of the page and appended to the body.

metadata?: PurchaseMetadata

The purchase metadata to be passed to the backend. Any information provided here will be propagated to the payment gateway and to the RC transaction as metadata.

onDiscountCodeChanged?: (discountCode: null | string) => void

Called when the applied discount code changes in the Web Billing checkout. This can be used by host applications to keep external state, such as the URL, in sync with the checkout.

purchaseOption?: null | PurchaseOption

The option to be used for this purchase. If not specified or null the default one will be used.

rcPackage: Package

The package you want to purchase. Obtained from Purchases.getOfferings.

selectedLocale?: string

The locale to use for the purchase flow. If not specified, English will be used

showDiscountCodeField?: boolean

If set to true, the Web Billing checkout will show a discount input code field.

skipSuccessPage?: boolean

If set to true, the SDK will skip the success page and automatically continue the flow once the purchase completes successfully. Defaults to false.

termsAndConditionsUrl?: string

Link to the terms and conditions that should be shown in the checkout footer.