--- title: MetafieldsSetUserError - Customer API description: An error that occurs during the execution of `MetafieldsSet`. api_version: 2025-10 api_name: customer type: object api_type: graphql source_url: html: https://shopify.dev/docs/api/customer/latest/objects/metafieldssetusererror md: https://shopify.dev/docs/api/customer/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/customer/latest/enums/MetafieldsSetUserErrorCode) The error code. * element​Index [Int](https://shopify.dev/docs/api/customer/latest/scalars/Int) The index of the array element that's causing the error. * field [\[String!\]](https://shopify.dev/docs/api/customer/latest/scalars/String) The path to the input field that caused the error. * message [String!](https://shopify.dev/docs/api/customer/latest/scalars/String) non-null The error message. *** ## Map No referencing types *** ## Mutations * [metafields​Set](https://shopify.dev/docs/api/customer/latest/mutations/metafieldsSet) mutation Sets metafield values. Metafield values will be set regardless if they were previously created or not. Allows a maximum of 25 metafields to be set at a time. This operation is atomic, meaning no changes are persisted if an error is encountered. As of `2024-07`, this operation supports compare-and-set functionality to better handle concurrent requests. If `compareDigest` is set for any metafield, the mutation will only set that metafield if the persisted metafield value matches the digest used on `compareDigest`. If the metafield doesn't exist yet, but you want to guarantee that the operation will run in a safe manner, set `compareDigest` to `null`. The `compareDigest` value can be acquired by querying the metafield object and selecting `compareDigest` as a field. If the `compareDigest` value does not match the digest for the persisted value, the mutation will return an error. You can opt out of write guarantees by not sending `compareDigest` in the request. *** ## <\~> MetafieldsSetUserError Mutations ### Mutated by * <\~>[metafields​Set](https://shopify.dev/docs/api/customer/latest/mutations/metafieldsSet) *** ## Interfaces * [Displayable​Error](https://shopify.dev/docs/api/customer/latest/interfaces/DisplayableError) interface *** ## ||-MetafieldsSetUserError Implements ### Implements * ||-[Displayable​Error](https://shopify.dev/docs/api/customer/latest/interfaces/DisplayableError)