---
title: >-
  Storefront API now returns a specific error code when Cart Transform Functions
  fail - Shopify developer changelog
description: >-
  Shopify’s developer changelog documents all changes to Shopify’s platform.
  Find the latest news and learn about new platform opportunities.
source_url:
  html: >-
    https://shopify.dev/changelog/posts/storefront-api-now-returns-a-specific-error-code-when-cart-transform-functions-fail
  md: >-
    https://shopify.dev/changelog/posts/storefront-api-now-returns-a-specific-error-code-when-cart-transform-functions-fail.md
metadata:
  effectiveApiVersion: 2026-04
  affectedApi:
    - displayName: Storefront API
      handle: storefront-graphql
  primaryTag:
    displayName: API
    handle: api
  secondaryTag:
    displayName: Update
    handle: update
  indicatesActionRequired: false
  createdAt: '2025-12-10T13:31:12-05:00'
  postedAt: '2026-01-21T12:00:00-05:00'
  updatedAt: '2026-01-15T11:32:29-05:00'
  effectiveAt: '2025-12-17T12:00:00-05:00'
---

January 21, 2026

# Storefront API now returns a specific error code when Cart Transform Functions fail

DateJanuary 21, 2026

Version[2026-04](https://shopify.dev/changelog?api_version=2026-04)

FlagsUpdate

SurfacesAPI

Affected APIs[Storefront API](https://shopify.dev/changelog?api_type=storefront-graphql)

As of API version 2026-04, the Storefront API will return a `MERCHANDISE_LINE_TRANSFORMERS_RUN_ERROR` [cart error code](https://shopify.dev/docs/api/storefront/latest/enums/CartErrorCode) when a [Cart Transform Function](https://shopify.dev/docs/api/functions/latest/cart-transform) encounters a runtime error during cart operations such as [`cartCreate`](https://shopify.dev/docs/api/storefront/latest/mutations/cartCreate) or [`cartLinesAdd`](https://shopify.dev/docs/api/storefront/latest/mutations/cartLinesAdd).

Previously, when a Cart Transform Function failed, the Storefront API returned a generic [`INVALID` error code](https://shopify.dev/docs/api/storefront/latest/enums/CartErrorCode#enums-INVALID) with the message "An error occurred in your cart." This made it difficult to distinguish between failures in Cart Transform Functions and other validation errors programmatically.

With the introduction of the specific `MERCHANDISE_LINE_TRANSFORMERS_RUN_ERROR` code, you can now:

* Identify and handle Cart Transform Function failures separately from other cart errors.
* Implement more precise error handling and debugging in your storefront.

This change enhances your ability to maintain and troubleshoot your storefront implementation effectively.

Example error response:

```
{
  "data": {
    "cartCreate": {
      "cart": null,
      "userErrors": [
        {
          "code": "MERCHANDISE_LINE_TRANSFORMERS_RUN_ERROR"
        }
      ]
    }
  }
}
```
