Skip to main content

createHeadlessCheckout

function createHeadlessCheckout<T, H>(
sessionParams,
hooks?,
apiPaths?): Promise<PurseHeadlessCheckout>;

Creates and initializes a new headless checkout instance. Use this function to start a new payment session with the Purse checkout system.

Type Parameters

Type Parameter
T extends | string | PurseHeadlessCheckoutV1Params
H extends PurseHeadlessCheckoutHooks

Parameters

ParameterTypeDescription
sessionParamsTThe checkout session configuration.
hooks?HOptional lifecycle hooks to customize checkout behavior See PurseHeadlessCheckoutHooks for available hooks
apiPaths?APIPaths-

Returns

Promise<PurseHeadlessCheckout>

A promise that resolves to a configured checkout instance