Cart User Error
Represents an error that happens during execution of a cart mutation.
Anchor to FieldsFields
- code (CartErrorCode)
- field ([String!])
- message (String!)
- Anchor to codecode•Cart
Error Code The error code.
- Anchor to fieldfield•[String!]
The path to the input field that caused the error.
- Anchor to messagemessage•String!non-null
The error message.
Anchor to MutationsMutations
- cartAttributesUpdate (CartAttributesUpdatePayload)
- cartBuyerIdentityUpdate (CartBuyerIdentityUpdatePayload)
- cartCreate (CartCreatePayload)
- cartDeliveryAddressesAdd (CartDeliveryAddressesAddPayload)
- cartDeliveryAddressesRemove (CartDeliveryAddressesRemovePayload)
- cartDeliveryAddressesReplace (CartDeliveryAddressesReplacePayload)
- cartDeliveryAddressesUpdate (CartDeliveryAddressesUpdatePayload)
- cartDiscountCodesUpdate (CartDiscountCodesUpdatePayload)
- cartGiftCardCodesAdd (CartGiftCardCodesAddPayload)
- cartGiftCardCodesRemove (CartGiftCardCodesRemovePayload)
- cartGiftCardCodesUpdate (CartGiftCardCodesUpdatePayload)
- cartLinesAdd (CartLinesAddPayload)
- cartLinesRemove (CartLinesRemovePayload)
- cartLinesUpdate (CartLinesUpdatePayload)
- cartNoteUpdate (CartNoteUpdatePayload)
- cartSelectedDeliveryOptionsUpdate (CartSelectedDeliveryOptionsUpdatePayload)
- •mutation
Updates the attributes on a
Cart. Attributes are custom key-value pairs that store additional information, such as gift messages, special instructions, or order notes.- Anchor to attributesattributes•[Attribute
Input!]! required An array of key-value pairs that contains additional information about the cart.
The input must not contain more than
250values.- Anchor to cartIdcart•ID!
Id required The ID of the cart.
Arguments
- •mutation
Updates the buyer identity on a
Cart, including contact information, location, and checkout preferences. The buyer's country determines international pricing and should match their shipping address.Use this mutation to associate a logged-in customer via access token, set a B2B company location, or configure checkout preferences like delivery method. Preferences prefill checkout fields but don't sync back to the cart if overwritten at checkout.
- Anchor to cartIdcart•ID!
Id required The ID of the cart.
- Anchor to buyerIdentitybuyer•Cart
Identity Buyer Identity Input! required The customer associated with the cart. Used to determine international pricing. Buyer identity should match the customer's shipping address.
Arguments
- •mutation
Creates a new
Cartfor a buyer session. You can optionally initialize the cart with merchandise lines, discount codes, gift card codes, buyer identity for international pricing, and custom attributes.The returned cart includes a
that directs the buyer to complete their purchase.- Anchor to inputinput•Cart
Input The fields used to create a cart.
Arguments
- •mutation
Adds delivery addresses to the cart.
- Anchor to cartIdcart•ID!
Id required The ID of the cart.
- Anchor to addressesaddresses•[Cart
Selectable Address Input!]! required A list of delivery addresses to add to the cart.
The input must not contain more than
250values.
Arguments
- •mutation
Removes delivery addresses from the cart.
- Anchor to cartIdcart•ID!
Id required The ID of the cart.
- Anchor to addressIdsaddress•[ID!]!
Ids required A list of delivery addresses by handle to remove from the cart.
The input must not contain more than
250values.
Arguments
- •mutation
Replaces delivery addresses on the cart.
- Anchor to cartIdcart•ID!
Id required The ID of the cart.
- Anchor to addressesaddresses•[Cart
Selectable Address Input!]! required A list of delivery addresses to replace on the cart.
The input must not contain more than
250values.
Arguments
- •mutation
Updates one or more delivery addresses on a cart.
- Anchor to cartIdcart•ID!
Id required The ID of the cart.
- Anchor to addressesaddresses•[Cart
Selectable Address Update Input!]! required The delivery addresses to update.
The input must not contain more than
250values.
Arguments
- •mutation
Updates the discount codes applied to a
Cart. This mutation replaces all existing discount codes with the provided list, so pass an empty array to remove all codes. Discount codes are case-insensitive.After updating, check each
in the cart'sfield to see whether the code is applicable to the cart's current contents.- Anchor to cartIdcart•ID!
Id required The ID of the cart.
- Anchor to discountCodesdiscount•[String!]!
Codes required The case-insensitive discount codes that the customer added at checkout.
The input must not contain more than
250values.
Arguments
- •mutation
Adds gift card codes to a
Cartwithout replacing any codes already applied. Gift card codes are case-insensitive.To replace all gift card codes instead of adding to them, use
.- Anchor to cartIdcart•ID!
Id required The ID of the cart.
- Anchor to giftCardCodesgift•[String!]!
Card Codes required The case-insensitive gift card codes to add.
The input must not contain more than
250values.
Arguments
- •mutation
Removes gift cards from a
Cartusing their IDs. You can retrieve the IDs of applied gift cards from the cart'sfield.- Anchor to cartIdcart•ID!
Id required The ID of the cart.
- Anchor to appliedGiftCardIdsapplied•[ID!]!
Gift Card Ids required The gift cards to remove.
The input must not contain more than
250values.
Arguments
- •mutation
Updates the gift card codes applied to the cart. Unlike
, which adds codes without replacing existing ones, this mutation sets the gift card codes for the cart. Gift card codes are case-insensitive.- Anchor to cartIdcart•ID!
Id required The ID of the cart.
- Anchor to giftCardCodesgift•[String!]!
Card Codes required The case-insensitive gift card codes.
The input must not contain more than
250values.
Arguments
- •mutation
Adds a merchandise line to the cart.
- Anchor to cartIdcart•ID!
Id required The ID of the cart.
- Anchor to lineslines•[Cart
Line Input!]! required A list of merchandise lines to add to the cart.
The input must not contain more than
250values.
Arguments
- •mutation
Removes one or more merchandise lines from the cart.
- Anchor to cartIdcart•ID!
Id required The ID of the cart.
- Anchor to lineIdsline•[ID!]!
Ids required The merchandise line IDs to remove.
The input must not contain more than
250values.
Arguments
- •mutation
Updates one or more merchandise lines on a cart.
- Anchor to cartIdcart•ID!
Id required The ID of the cart.
- Anchor to lineslines•[Cart
Line Update Input!]! required The merchandise lines to update.
The input must not contain more than
250values.
Arguments
- •mutation
Updates the note on a
Cart. The note is a text field that stores additional information, such as a personalized message from the buyer or special instructions for the order.- Anchor to cartIdcart•ID!
Id required The ID of the cart.
- Anchor to notenote•String!required
The note on the cart.
Arguments
- •mutation
Updates the selected delivery option for one or more
objects in a cart. Each delivery group represents items shipping to a specific address and offers multiple delivery options with different costs and methods.Use this mutation when a customer chooses their preferred shipping method during checkout. The
identifies whichto select for each delivery group.- Anchor to cartIdcart•ID!
Id required The ID of the cart.
- Anchor to selectedDeliveryOptionsselected•[Cart
Delivery Options Selected Delivery Option Input!]! required The selected delivery options.
The input must not contain more than
250values.
Arguments