Skip to content
Kitenzo Headless is invite-only. To enable it on your store, email support@kitenzo.com.

Cart & discount application

This is the detail most worth getting right. Kitenzo doesn’t discount at request time — the Shopify cart transform applies the bundle discount at checkout. Your job is to give the cart the data the transform needs.

Bundle typeWhere the discount livesWhat you must do
single-productIn the variant priceAdd the configured variant. Nothing extra.
multiple-productsIn the variant priceAdd the configured variant. Nothing extra.
nativeApplied at checkout by the cart transformAdd one line per variant with _bundle_data, and write the cart-level _bundles attribute.
  • _bundle_data — a per-line attribute that ties each cart line to its configured bundle. The SDK’s buildCartLines adds it automatically. If you reconstruct lines by hand (e.g. restoring a saved cart), every native-bundle line must carry it.
  • _bundles — a cart-level attribute (JSON) mapping configuredBundleId → bundle content. The cart transform reads it to apply the discount. Set it via buildCartPayload / addBundleToCart, or write it yourself from the embed’s bundleContent.
const result = await client.submitBundle(bundle, selections); // or useBundleCart()
await addBundleToCart(result, {
addLines: (lines) => cart.linesAdd(lines),
getAttributes: () => cart.attributes ?? [],
setAttributes: (attrs) => cart.cartAttributesUpdate(attrs),
});

addBundleToCart (and buildCartPayload) inspect the bundle type and only write _bundles when needed — so the same code is correct for all three types.

The embed gives you everything in the onAddToCart payload — add lines, and if bundleContent is present (native), write it into _bundles. See Cart integration.

The reliable path (no JS SDK — TapCart, native apps, servers)

Section titled “The reliable path (no JS SDK — TapCart, native apps, servers)”

POST /configure returns a cart object for native bundles with both payloads pre-encoded: line_items (each carrying _bundle_data) and attributes._bundles. Write them to the cart as-is — merging _bundles with any existing value — and the transform does the rest. This is how the TapCart integration works.

  • Inspect the cart’s attributes: a native bundle should have a _bundles entry keyed by the configured bundle ID.
  • Each native-bundle line should carry a _bundle_data attribute.
  • The discount itself appears at checkout (the transform runs on Shopify’s servers), not necessarily in an intermediate cart subtotal.