Checkout Functions Get Smarter: `cart.deliverableLine` Now Includes Cost Modeling and Direct Cart Line Links

Shopify’s latest checkout function update adds cost modeling to `cart.deliverableLine` inputs and ties them directly to their originating cart lines. Learn what this means for developers, how to adjust your code, and the best practices to stay compliant.

Checkout Functions Get Smarter: `cart.deliverableLine` Now Includes Cost Modeling and Direct Cart Line Links
5 sections

Shopify just rolled out a subtle but powerful change to the Checkout Functions API. The cart.deliverableLine input now models a cost object and includes a direct reference to its originating cart.line. For developers who build custom checkout experiences, this adds richer pricing data and a clearer linkage between the cart and the checkout stage. In this post we’ll unpack the change, identify who needs to act, and walk through the exact code adjustments you should make today.

What Changed

Previously, cart.deliverableLine exposed only a handful of properties such as quantity, title, and price. The new schema introduces a cost field that mirrors the structure used throughout Shopify’s cart and order APIs (including amount, currencyCode, and tax). Additionally, each deliverableLine now carries a cartLine object that points back to the exact cart.line that generated it. This bidirectional link eliminates the guesswork developers faced when trying to reconcile checkout‑time adjustments with the original cart items.

Who Is Affected

The update primarily targets developers who have authored or are maintaining Checkout Functions—especially those that rely on cart.deliverableLine for pricing logic, discounts, or fulfillment rules. Merchants who simply use Shopify’s out‑of‑the‑box checkout won’t see a visual change, but they benefit indirectly because developers can now build more accurate and transparent cost calculations. If you’ve ever written custom logic that iterates over cart.deliverableLine without a direct reference to the source cart line, your code may now need a small refactor to avoid undefined errors.

How To Update Your Checkout Functions

Below is a minimal example that shows the new structure in action. The snippet pulls the cost object, formats it for display, and uses the cartLine.id to correlate any downstream operations (such as custom fulfillment services).

js

export default function Checkout(context) {

const { cart } = context;

// Map over the updated deliverableLine array

const deliverableLines = cart.deliverableLine.map(dl => ({

// New cost model (amount in minor units, currency code, tax information)

cost: dl.cost, // { amount: 1299, currencyCode: 'USD', tax: { amount: 0, included: false } }

// Direct link back to the original cart line

cartLineId: dl.cartLine.id,

// Preserve any existing data you still need

quantity: dl.quantity,

title: dl.title,

}));

// Example: log each line for debugging

deliverableLines.forEach(line => {

console.log(Line ${line.cartLineId} costs ${line.cost.amount / 100} ${line.cost.currencyCode});

});

// Return the unmodified cart if you don’t need further changes

return { cart };

}

Testing & Validation

After updating your function, run it in the Checkout Extensibility dev environment. Verify that the cost object reflects the correct amount (Shopify still uses minor units) and that cartLine.id matches an entry in cart.line. Use the GraphQL Explorer or the Checkout UI Extensions Playground to fetch a sample checkout and inspect the payload. If you see undefined for dl.cartLine, double‑check that you’re on a store version that has the new schema—Shopify rolls it out gradually, so a fallback check (if (dl.cartLine)) is a safe guard.

Practical Takeaways

  • Add cost handling – Treat the new cost field the same way you treat cart.cost elsewhere; it provides amount, currency, and tax details in a single object.
  • Link back to the cart line – Use dl.cartLine.id whenever you need to update inventory, apply discounts, or send data to a third‑party fulfillment service.
  • Graceful degradation – Keep a fallback for stores that haven’t received the update yet (dl.cartLine ?? {}).
  • Update documentation – Revise any internal docs or README files that describe the shape of cart.deliverableLine.
  • Monitor deprecation notices – While this change is additive, future releases may retire older properties, so keep an eye on the Developer Changelog.
  • Conclusion

    The new cost model and cart‑line linkage turn cart.deliverableLine into a first‑class source of truth for checkout pricing. By updating your Checkout Functions now, you’ll avoid runtime errors, unlock more precise cost calculations, and lay the groundwork for future enhancements such as tax‑aware discounts or multi‑currency support. Need help migrating your codebase? Reach out to the Shopify Partner community or drop a comment below—we’re happy to troubleshoot together!

    Tags
    Sources

    Related Articles

    Unlock Transparency: The New Store Activity Log Lets You Track Every Change

    Unlock Transparency: The New Store Activity Log Lets You Track Every Change

    Shopify’s rebuilt Store activity log centralizes every modification—from products to payments—into one searchable timeline. Learn what’s new, who can see it, and how merchants and developers can act today.

    November 13, 20264 min
    Custom Draft Order Discounts Now Respect Presentment Currency

    Custom Draft Order Discounts Now Respect Presentment Currency

    Shopify now calculates custom draft‑order discounts in the draft’s presentment currency instead of the shop’s default. Learn what this means for merchants, developers, and how to update your workflow today.

    November 13, 20264 min
    Case-Insensitive Market Metafields: What the 2027-01 Storefront API Change Means for Your Store

    Case-Insensitive Market Metafields: What the 2027-01 Storefront API Change Means for Your Store

    Shopify's Storefront API 2027-01 now matches Market.metafields keys case‑insensitively. Learn why this matters, who is affected, and how to update your apps and custom storefronts before the change breaks your logic.

    November 13, 20264 min
    Market Metafields Now Use Market Handle to Break Ties – What This Means for Your Store

    Market Metafields Now Use Market Handle to Break Ties – What This Means for Your Store

    Shopify’s latest update changes how overlapping market metafields are resolved, favoring the market with the lowest handle instead of the most recently updated value. Learn who is impacted, how it affects your storefront, and the steps you need to take.

    November 13, 20264 min