--- title: CartUserError - Storefront API description: Represents an error that happens during execution of a cart mutation. api_version: 2025-10 api_name: storefront type: object api_type: graphql source_url: html: 'https://shopify.dev/docs/api/storefront/latest/objects/CartUserError' md: 'https://shopify.dev/docs/api/storefront/latest/objects/CartUserError.md' --- # Cart​User​Error object Represents an error that happens during execution of a cart mutation. ## Fields * code [Cart​Error​Code](https://shopify.dev/docs/api/storefront/latest/enums/CartErrorCode) The error code. * 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​Attributes​Update](https://shopify.dev/docs/api/storefront/latest/mutations/cartAttributesUpdate) mutation Updates the attributes on a cart. * attributes [\[Attribute​Input!\]!](https://shopify.dev/docs/api/storefront/latest/input-objects/AttributeInput) required ### Arguments An array of key-value pairs that contains additional information about the cart. The input must not contain more than `250` values. * cart​Id [ID!](https://shopify.dev/docs/api/storefront/latest/scalars/ID) required The ID of the cart. *** * [cart​Buyer​Identity​Update](https://shopify.dev/docs/api/storefront/latest/mutations/cartBuyerIdentityUpdate) mutation Updates customer information associated with a cart. Buyer identity is used to determine [international pricing](https://shopify.dev/custom-storefronts/internationalization/international-pricing) and should match the customer's shipping address. * cart​Id [ID!](https://shopify.dev/docs/api/storefront/latest/scalars/ID) required ### Arguments The ID of the cart. * buyer​Identity [Cart​Buyer​Identity​Input!](https://shopify.dev/docs/api/storefront/latest/input-objects/CartBuyerIdentityInput) required The customer associated with the cart. Used to determine [international pricing](https://shopify.dev/custom-storefronts/internationalization/international-pricing). Buyer identity should match the customer's shipping address. *** * [cart​Create](https://shopify.dev/docs/api/storefront/latest/mutations/cartCreate) mutation Creates a new cart. * input [Cart​Input](https://shopify.dev/docs/api/storefront/latest/input-objects/CartInput) ### Arguments The fields used to create a cart. *** * [cart​Delivery​Addresses​Add](https://shopify.dev/docs/api/storefront/latest/mutations/cartDeliveryAddressesAdd) mutation Adds delivery addresses to the cart. * cart​Id [ID!](https://shopify.dev/docs/api/storefront/latest/scalars/ID) required ### Arguments The ID of the cart. * addresses [\[Cart​Selectable​Address​Input!\]!](https://shopify.dev/docs/api/storefront/latest/input-objects/CartSelectableAddressInput) required A list of delivery addresses to add to the cart. The input must not contain more than `250` values. *** * [cart​Delivery​Addresses​Remove](https://shopify.dev/docs/api/storefront/latest/mutations/cartDeliveryAddressesRemove) mutation Removes delivery addresses from the cart. * cart​Id [ID!](https://shopify.dev/docs/api/storefront/latest/scalars/ID) required ### Arguments The ID of the cart. * address​Ids [\[ID!\]!](https://shopify.dev/docs/api/storefront/latest/scalars/ID) required A list of delivery addresses by handle to remove from the cart. The input must not contain more than `250` values. *** * [cart​Delivery​Addresses​Replace](https://shopify.dev/docs/api/storefront/latest/mutations/cartDeliveryAddressesReplace) mutation Replaces delivery addresses on the cart. * cart​Id [ID!](https://shopify.dev/docs/api/storefront/latest/scalars/ID) required ### Arguments The ID of the cart. * addresses [\[Cart​Selectable​Address​Input!\]!](https://shopify.dev/docs/api/storefront/latest/input-objects/CartSelectableAddressInput) required A list of delivery addresses to replace on the cart. The input must not contain more than `250` values. *** * [cart​Delivery​Addresses​Update](https://shopify.dev/docs/api/storefront/latest/mutations/cartDeliveryAddressesUpdate) mutation Updates one or more delivery addresses on a cart. * cart​Id [ID!](https://shopify.dev/docs/api/storefront/latest/scalars/ID) required ### Arguments The ID of the cart. * addresses [\[Cart​Selectable​Address​Update​Input!\]!](https://shopify.dev/docs/api/storefront/latest/input-objects/CartSelectableAddressUpdateInput) required The delivery addresses to update. The input must not contain more than `250` values. *** * [cart​Discount​Codes​Update](https://shopify.dev/docs/api/storefront/latest/mutations/cartDiscountCodesUpdate) mutation Updates the discount codes applied to the cart. * cart​Id [ID!](https://shopify.dev/docs/api/storefront/latest/scalars/ID) required ### Arguments The ID of the cart. * discount​Codes [\[String!\]](https://shopify.dev/docs/api/storefront/latest/scalars/String) The case-insensitive discount codes that the customer added at checkout. The input must not contain more than `250` values. *** * [cart​Gift​Card​Codes​Add](https://shopify.dev/docs/api/storefront/latest/mutations/cartGiftCardCodesAdd) mutation Adds gift card codes to the cart without replacing existing ones. * cart​Id [ID!](https://shopify.dev/docs/api/storefront/latest/scalars/ID) required ### Arguments The ID of the cart. * gift​Card​Codes [\[String!\]!](https://shopify.dev/docs/api/storefront/latest/scalars/String) required The case-insensitive gift card codes to add. The input must not contain more than `250` values. *** * [cart​Gift​Card​Codes​Remove](https://shopify.dev/docs/api/storefront/latest/mutations/cartGiftCardCodesRemove) mutation Removes the gift card codes applied to the cart. * cart​Id [ID!](https://shopify.dev/docs/api/storefront/latest/scalars/ID) required ### Arguments The ID of the cart. * applied​Gift​Card​Ids [\[ID!\]!](https://shopify.dev/docs/api/storefront/latest/scalars/ID) required The gift cards to remove. The input must not contain more than `250` values. *** * [cart​Gift​Card​Codes​Update](https://shopify.dev/docs/api/storefront/latest/mutations/cartGiftCardCodesUpdate) mutation Updates the gift card codes applied to the cart. * cart​Id [ID!](https://shopify.dev/docs/api/storefront/latest/scalars/ID) required ### Arguments The ID of the cart. * gift​Card​Codes [\[String!\]!](https://shopify.dev/docs/api/storefront/latest/scalars/String) required The case-insensitive gift card codes. The input must not contain more than `250` values. *** * [cart​Lines​Add](https://shopify.dev/docs/api/storefront/latest/mutations/cartLinesAdd) mutation Adds a merchandise line to the cart. * cart​Id [ID!](https://shopify.dev/docs/api/storefront/latest/scalars/ID) required ### Arguments The ID of the cart. * lines [\[Cart​Line​Input!\]!](https://shopify.dev/docs/api/storefront/latest/input-objects/CartLineInput) required A list of merchandise lines to add to the cart. The input must not contain more than `250` values. *** * [cart​Lines​Remove](https://shopify.dev/docs/api/storefront/latest/mutations/cartLinesRemove) mutation Removes one or more merchandise lines from the cart. * cart​Id [ID!](https://shopify.dev/docs/api/storefront/latest/scalars/ID) required ### Arguments The ID of the cart. * line​Ids [\[ID!\]!](https://shopify.dev/docs/api/storefront/latest/scalars/ID) required The merchandise line IDs to remove. The input must not contain more than `250` values. *** * [cart​Lines​Update](https://shopify.dev/docs/api/storefront/latest/mutations/cartLinesUpdate) mutation Updates one or more merchandise lines on a cart. * cart​Id [ID!](https://shopify.dev/docs/api/storefront/latest/scalars/ID) required ### Arguments The ID of the cart. * lines [\[Cart​Line​Update​Input!\]!](https://shopify.dev/docs/api/storefront/latest/input-objects/CartLineUpdateInput) required The merchandise lines to update. The input must not contain more than `250` values. *** * [cart​Note​Update](https://shopify.dev/docs/api/storefront/latest/mutations/cartNoteUpdate) mutation Updates the note on the cart. * cart​Id [ID!](https://shopify.dev/docs/api/storefront/latest/scalars/ID) required ### Arguments The ID of the cart. * note [String!](https://shopify.dev/docs/api/storefront/latest/scalars/String) required The note on the cart. *** * [cart​Selected​Delivery​Options​Update](https://shopify.dev/docs/api/storefront/latest/mutations/cartSelectedDeliveryOptionsUpdate) mutation Update the selected delivery options for a delivery group. * cart​Id [ID!](https://shopify.dev/docs/api/storefront/latest/scalars/ID) required ### Arguments The ID of the cart. * selected​Delivery​Options [\[Cart​Selected​Delivery​Option​Input!\]!](https://shopify.dev/docs/api/storefront/latest/input-objects/CartSelectedDeliveryOptionInput) required The selected delivery options. The input must not contain more than `250` values. *** *** ## <\~> CartUserError Mutations ### Mutated by * <\~>[cart​Attributes​Update](https://shopify.dev/docs/api/storefront/latest/mutations/cartAttributesUpdate) * <\~>[cart​Buyer​Identity​Update](https://shopify.dev/docs/api/storefront/latest/mutations/cartBuyerIdentityUpdate) * <\~>[cart​Create](https://shopify.dev/docs/api/storefront/latest/mutations/cartCreate) * <\~>[cart​Delivery​Addresses​Add](https://shopify.dev/docs/api/storefront/latest/mutations/cartDeliveryAddressesAdd) * <\~>[cart​Delivery​Addresses​Remove](https://shopify.dev/docs/api/storefront/latest/mutations/cartDeliveryAddressesRemove) * <\~>[cart​Delivery​Addresses​Replace](https://shopify.dev/docs/api/storefront/latest/mutations/cartDeliveryAddressesReplace) * <\~>[cart​Delivery​Addresses​Update](https://shopify.dev/docs/api/storefront/latest/mutations/cartDeliveryAddressesUpdate) * <\~>[cart​Discount​Codes​Update](https://shopify.dev/docs/api/storefront/latest/mutations/cartDiscountCodesUpdate) * <\~>[cart​Gift​Card​Codes​Add](https://shopify.dev/docs/api/storefront/latest/mutations/cartGiftCardCodesAdd) * <\~>[cart​Gift​Card​Codes​Remove](https://shopify.dev/docs/api/storefront/latest/mutations/cartGiftCardCodesRemove) * <\~>[cart​Gift​Card​Codes​Update](https://shopify.dev/docs/api/storefront/latest/mutations/cartGiftCardCodesUpdate) * <\~>[cart​Lines​Add](https://shopify.dev/docs/api/storefront/latest/mutations/cartLinesAdd) * <\~>[cart​Lines​Remove](https://shopify.dev/docs/api/storefront/latest/mutations/cartLinesRemove) * <\~>[cart​Lines​Update](https://shopify.dev/docs/api/storefront/latest/mutations/cartLinesUpdate) * <\~>[cart​Note​Update](https://shopify.dev/docs/api/storefront/latest/mutations/cartNoteUpdate) * <\~>[cart​Selected​Delivery​Options​Update](https://shopify.dev/docs/api/storefront/latest/mutations/cartSelectedDeliveryOptionsUpdate) *** ## Interfaces * [Displayable​Error](https://shopify.dev/docs/api/storefront/latest/interfaces/DisplayableError) interface *** ## ||-CartUserError Implements ### Implements * ||-[Displayable​Error](https://shopify.dev/docs/api/storefront/latest/interfaces/DisplayableError)