@avvyr/storefront-sdk - v0.19.0
    Preparing search index...

    Class CheckoutResource

    Index
    • Complete a checkout the shopper authorized in the provider's widget (methods with completion "authorize", e.g. Klarna Payments). The server places the order with the provider from the cart, not from the browser, and creates the Avvyr order in the same request.

      Safe to retry with the same token: a token that already produced an order returns that order.

      Parameters

      Returns Promise<CheckoutAuthorizeResult>

    • Get order confirmation after completed checkout

      Parameters

      • reference: string

      Returns Promise<ConfirmationResponse>

    • Initialize a checkout session (Klarna / Stripe / direct).

      Returns a typed union: { status: "ok", ...session } or { status: "repriced", cart, changes }. The repriced branch fires only when expectedTotalIncVat was passed and the server-side authoritative recompute found a different total (flash sale hit the cart, a special price window opened, VAT re-resolved). The SDK absorbs the 409 CART_REPRICED and refetches the corrected cart internally — render the new totals and call init again. Raw-HTTP clients get the documented 409 instead.

      Parameters

      Returns Promise<CheckoutInitResult>