--- title: MetafieldsSetUserError - Storefront API description: An error that occurs during the execution of `MetafieldsSet`. api_version: 2025-10 api_name: storefront type: object api_type: graphql source_url: html: >- https://shopify.dev/docs/api/storefront/latest/objects/MetafieldsSetUserError md: >- https://shopify.dev/docs/api/storefront/latest/objects/MetafieldsSetUserError.md --- # Metafields​Set​User​Error object An error that occurs during the execution of `MetafieldsSet`. ## Fields * code [Metafields​Set​User​Error​Code](https://shopify.dev/docs/api/storefront/latest/enums/MetafieldsSetUserErrorCode) The error code. * element​Index [Int](https://shopify.dev/docs/api/storefront/latest/scalars/Int) The index of the array element that's causing the error. * field [\[String!\]](https://shopify.dev/docs/api/storefront/latest/scalars/String) The path to the input field that caused the error. * message [String!](https://shopify.dev/docs/api/storefront/latest/scalars/String) non-null The error message. *** ## Map No referencing types *** ## Mutations * [cart​Metafields​Set](https://shopify.dev/docs/api/storefront/latest/mutations/cartMetafieldsSet) mutation Sets cart metafield values. Cart metafield values will be set regardless if they were previously created or not. Allows a maximum of 25 cart metafields to be set at a time. *** ## <\~> MetafieldsSetUserError Mutations ### Mutated by * <\~>[cart​Metafields​Set](https://shopify.dev/docs/api/storefront/latest/mutations/cartMetafieldsSet) *** ## Interfaces * [Displayable​Error](https://shopify.dev/docs/api/storefront/latest/interfaces/DisplayableError) interface *** ## ||-MetafieldsSetUserError Implements ### Implements * ||-[Displayable​Error](https://shopify.dev/docs/api/storefront/latest/interfaces/DisplayableError)