See all services → Shopify Plus Partner
API Developer

Attach Per-Line Cart Data in Hydrogen Preview Builds

Hydrogen's September preview lets product forms set line-item attributes on add to cart, adds a skills sync command for agent-assisted work, and proxies Universal Commerce Protocol requests through your own domain.

Executive summary

What changed

Product forms can now set line-item attributes as an item is added to the cart. Previously, attaching engraving text or a gift note to one line meant carrying the value outside the cart line and reconciling it later, or pushing it into cart-level attributes where it lost its association with the item. The attribute now travels with the line it belongs to. A packaged skill covers the related pattern of storing custom cart data such as delivery instructions.

The preview also adds a skills sync command that copies the packaged agent skills into your project's skill directories. Re-running it after an upgrade adds new skills, refreshes unmodified ones, removes skills the package no longer ships, and leaves locally edited files alone unless you force the overwrite. A read-only check variant exists for continuous integration. Projects that synced before this release need one forced run to pick up the version stamp.

On the agent side, caller-authenticated Universal Commerce Protocol requests to the storefront now proxy through to the configured Shopify store rather than requiring a separate host. A fix stops cancelled cart updates from logging abort noise when a newer update replaces them.

Why it matters

Line-item attributes sound minor, but they resolve a persistent source of custom code in headless Plus builds. Personalisation data not bound to a cart line has to be re-associated at checkout, in the order payload, and again in whatever system produces the item. Every hop is somewhere the data can drift. Holding it on the line from the first click removes the reconciliation rather than automating it.

The skills sync command matters because it makes agent-assisted development reproducible. If your team runs coding agents against a Hydrogen project, the packaged skills are the current contract for how its APIs behave. Pinning them to the installed version, and failing a build when they drift, separates agents that reflect your framework version from agents working on last quarter's assumptions.

Keeping agent traffic on your own domain matters for anyone weighing Hydrogen and Oxygen for enterprise headless commerce, since it leaves one less hostname in scope for security review and cookie policy.

Role-specific impact

Use-case example

Real-world scenario

A giftware brand sells one engraved pen as three variants with a custom monogram per unit. Previously the monogram lived in a cart attribute keyed by variant, so a cart holding two of the same variant with different monograms needed a synthetic line key and roughly 200 lines of reconciliation code between cart, order, and the engraving queue. With per-line attributes each line carries its own monogram. The team retires that path, and engraving orders needing manual correction before production fall from about 4 percent to near zero.

Implementation checklist

  1. Confirm you are on the developer preview track, since these changes are not in the stable release.
  2. Inventory every place personalisation data is carried outside the cart line.
  3. Move one product form to line-item attributes and verify the value survives into the order payload.
  4. Run the skills sync once with force if the project synced before this version, then add the read-only check to CI.
  5. If you serve agent traffic, test the proxied Universal Commerce Protocol endpoint against your configured store.
  6. Re-test downstream consumers, especially fulfilment exports that parse order attributes positionally.

FAQ

Q: Is this safe to adopt on a production storefront?

A: The developer preview is explicitly a preview track, so treat it as pre-release. Validate in a staging environment and expect the surface to shift between preview releases.

Q: Do we need to use agent skills to benefit from this release?

A: No. The cart line attribute work stands on its own. The skills commands only matter if your team runs coding agents against the project.

Resources

Hydrogen developer preview documentation

Need guidance? Talk to Makro.