Overview
Once a shopper has a cart, you can either redirect them to Henry’s hosted checkout or run the entire checkout flow server-side with the headless SDK. Both approaches reuse the cart you built with the Universal Cart guide and return an order ID you can track afterwards.Hosted checkout (fastest path)
Hosted checkout handles authentication, address capture, taxes, payments, and confirmation in a single responsive UI.1
Generate a checkout URL
Generate the hosted checkout URL with Embed the URL in an iframe, open it in a new tab, or load it inside a native webview.
client.cart.createCheckout. Pass the shopper’s identifier through x-user-id.2
Listen for postMessage events
When you embed the checkout page, subscribe to See Hosted Checkout for a complete iframe integration.
window.postMessage to react to lifecycle events such as orderCompleted or checkoutClosed.Headless checkout API
Use the headless SDK when you want full control over the checkout experience while still relying on Henry for payments, risk, and order orchestration.1
Create a quote session
Call
client.checkout.session.createQuote with shipping details. The response returns a session_token and order_metadata containing taxes and totals.2
Review the session state
Use the session token to inspect the products and any shipping metadata Henry derived.The products payload mirrors your cart, while the shipping response indicates whether Henry already has shipping info (
hasShipping) and echoes the validated address.3
Collect a payment method
Launch Henry’s hosted card collection modal before you place the order.
4
Confirm checkout
When the buyer approves the totals and payment method, call The confirmation response contains the newly created
client.checkout.session.confirmCheckout to place the order. Provide the session token and include shipping details if you need to override the quote.orderId, monetary breakdown (subtotal, tax, shipping, grandTotal), and line-item snapshot so you can display a receipt instantly.Both hosted and headless flows return an order identifier you can monitor via
the Order Management guide.

