younifyd
Menu

cartTransformCreate

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 `CartTransformCreate` 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](https://shopify.dev/docs/api/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](https://shopify.dev/docs/apps/selling-strategies/bundles/add-a-customized-bundle).

Use it in a workflow

  1. Add a step and choose the Shopify connector.
  2. Pick the cartTransformCreate action (under Cart).
  3. Fill in the fields below, then reference the result from later steps as {{carttransformcreate.response.data}}.

Query

This is the mutation the action sends by default. Edit it in the step's Query field to change which fields come back.

graphql
mutation CartTransformCreate($functionId: String, $functionHandle: String, $blockOnFailure: Boolean, $metafields: [MetafieldInput!]) {
  cartTransformCreate(
    functionId: $functionId
    functionHandle: $functionHandle
    blockOnFailure: $blockOnFailure
    metafields: $metafields
  ) {
    cartTransform {
      blockOnFailure
      functionId
      id
    }
    userErrors {
      code
      field
      message
    }
  }
}

Variables

Pass these as a JSON object in the step's Variables field.

functionIdstring

The identifier of the Function providing the cart transform.

functionHandlestring

The handle of the Function providing the cart transform.

blockOnFailureboolean

Whether a run failure should block cart and checkout operations.

metafieldsarray<object>

Additional metafields to associate to the cart transform.

idstring
namespacestring
keystring
valuestring
typestring
json
{
  "functionId": "string",
  "functionHandle": "string",
  "blockOnFailure": false,
  "metafields": [
    {
      "id": "string",
      "namespace": "string",
      "key": "string",
      "value": "string",
      "type": "string"
    }
  ]
}

Response

Read the result with {{carttransformcreate.response.data.data.cartTransformCreate}}. If the API returns errors, the step fails and they are at {{carttransformcreate.response.data.errors}}.

cartTransformobject
blockOnFailureboolean
functionIdstring
idstring
userErrorsarray<object>
codeobject
fieldobject
messageobject

Need more? See the Shopify guide for connection setup and behaviour shared by every action.