Skip to main content

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

As of API version 2026-04, the Storefront API will return a MERCHANDISE_LINE_TRANSFORMERS_RUN_ERROR cart error code when a Cart Transform Function encounters a runtime error during cart operations such as cartCreate or cartLinesAdd.

Previously, when a Cart Transform Function failed, the Storefront API returned a generic INVALID error code 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"
        }
      ]
    }
  }
}
Was this section helpful?