cart Transform Create
Requires access scope. Also: The shop must have
upgraded to Checkout Extensibility
and the user must have
products and preferences permission
to create a cart transform function.
Creates a cart transform function that lets merchants customize how products are bundled and presented during checkout. This gives merchants powerful control over their merchandising strategy by allowing apps to modify cart line items programmatically, supporting advanced approaches like dynamic bundles or personalized product recommendations.
For example, a bundle app might create a cart transform that automatically groups related products (like a camera, lens, and case) into a single bundle line item when customers add them to their cart, complete with bundle pricing and unified presentation.
Use to:
- Deploy custom bundling logic to merchant stores
- Enable dynamic product grouping during checkout
- Implement personalized product recommendations
- Create conditional offers based on cart contents
- Support complex pricing strategies for product combinations
The mutation processes synchronously and returns the created cart transform along with any validation errors. Once created, the cart transform function becomes active for the shop and will process cart modifications according to your defined logic. Cart transforms integrate with Shopify Functions to provide powerful customization capabilities while maintaining checkout performance.
Cart Transform functions can be configured to block checkout on failure or allow graceful degradation, giving you control over how errors are handled in the customer experience.
Learn more about customized bundles.
Arguments
- Anchor to blockOnFailureblock•Boolean
On Failure Default:false Whether a run failure should block cart and checkout operations.
- Anchor to functionIdfunction•String!
Id required The identifier of the Function providing the cart transform.
- Anchor to metafieldsmetafields•[Metafield
Input!] Default:[] Additional metafields to associate to the cart transform.
- Anchor to cartTransformcart•Cart
Transform Transform The newly created cart transform function.
- Anchor to userErrorsuser•[Cart
Errors Transform Create User Error!]! non-null The list of errors that occurred from executing the mutation.