The Express Buttons element provides a one-click checkout experience using payment methods like Apple Pay, Google Pay, and Klarna. Unlike passive elements, you must interact with it using its JavaScript API to configure the order and handle the checkout flow.
Access only provided by Kustom's Delivery Managers
To get access to this - please contact your Delivery Manager.
There are two ways to initialize the Express Buttons:
- Order ID — You pass an order ID from an existing Kustom Checkout session. The SDK fetches the cart automatically, making this the simpler option when a checkout integration already exists.
- Order Lines — You provide the cart contents directly. No existing checkout session needed.
<kustom-express-buttons id="myButton" locale="sv-se"></kustom-express-buttons>locale— The market locale for the checkout (e.g.sv-se). The first part will be used as the language and second part will be used as the country you want to show delivery methods for. See supported locales for the full list.
Use this when you already have a Kustom Checkout session. The SDK fetches the cart, currency, and order lines from the backend.
window.kustomElements("express.initialize", "#myButton", {
orderId: "your-kco-order-id",
shippingAddressRequired: true,
onConfirm: (response) => {
window.location.href = response.redirectUrl;
},
});Use this when you manage the cart yourself. You provide the order lines and currency directly.
window.kustomElements("express.initialize", "#myButton", {
currency: "sek",
orderLines: [
{
name: "iPhone 15",
totalAmount: 18000,
taxAmount: 3600,
},
],
shippingAddressRequired: true,
onConfirm: (response) => {
window.location.href = response.redirectUrl;
},
});orderId— The order ID from an existing Kustom Checkout session.shippingAddressRequired— Whether to collect a shipping address during checkout.onConfirm— Callback invoked when the consumer confirms. Receives a response object withredirectUrl.
currency— The currency code (e.g.sek).orderLines— Array of order line objects:name— Product or line item name.totalAmount— Total amount for the line in minor units.taxAmount— Tax amount for the line in minor units.quantity— Number of items. Defaults to1.
shippingAddressRequired— Whether to collect a shipping address during checkout.onConfirm— Callback invoked when the consumer confirms. Receives a response object withredirectUrl.