Skip to main content
object

Represents an error that happens during execution of a cart mutation.

•CartErrorCode

The error code.

•[String!]

The path to the input field that caused the error.

•String!
non-null

The error message.


Was this section helpful?

•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.

Arguments

•[AttributeInput!]!
required

An array of key-value pairs that contains additional information about the cart.

The input must not contain more than 250 values.

•ID!
required

The ID of the cart.


•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.

Arguments

•ID!
required

The ID of the cart.

•CartBuyerIdentityInput!
required

The customer associated with the cart. Used to determine international pricing. Buyer identity should match the customer's shipping address.


•mutation

Creates a new Cart for 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 checkoutUrl that directs the buyer to complete their purchase.

Arguments

•CartInput

The fields used to create a cart.


•mutation

Adds delivery addresses to the cart.

Arguments

•ID!
required

The ID of the cart.

•[CartSelectableAddressInput!]!
required

A list of delivery addresses to add to the cart.

The input must not contain more than 250 values.


•mutation

Removes delivery addresses from the cart.

Arguments

•ID!
required

The ID of the cart.

•[ID!]!
required

A list of delivery addresses by handle to remove from the cart.

The input must not contain more than 250 values.


•mutation

Replaces delivery addresses on the cart.

Arguments

•ID!
required

The ID of the cart.

•[CartSelectableAddressInput!]!
required

A list of delivery addresses to replace on the cart.

The input must not contain more than 250 values.


•mutation

Updates one or more delivery addresses on a cart.

Arguments

•ID!
required

The ID of the cart.

•[CartSelectableAddressUpdateInput!]!
required

The delivery addresses to update.

The input must not contain more than 250 values.


•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 CartDiscountCode in the cart's discountCodes field to see whether the code is applicable to the cart's current contents.

Arguments

•ID!
required

The ID of the cart.

•[String!]!
required

The case-insensitive discount codes that the customer added at checkout.

The input must not contain more than 250 values.


•mutation

Adds gift card codes to a Cart without replacing any codes already applied. Gift card codes are case-insensitive.

To replace all gift card codes instead of adding to them, use cartGiftCardCodesUpdate.

Arguments

•ID!
required

The ID of the cart.

•[String!]!
required

The case-insensitive gift card codes to add.

The input must not contain more than 250 values.


•mutation

Removes gift cards from a Cart using their IDs. You can retrieve the IDs of applied gift cards from the cart's appliedGiftCards field.

Arguments

•ID!
required

The ID of the cart.

•[ID!]!
required

The gift cards to remove.

The input must not contain more than 250 values.


•mutation

Updates the gift card codes applied to the cart. Unlike cartGiftCardCodesAdd, which adds codes without replacing existing ones, this mutation sets the gift card codes for the cart. Gift card codes are case-insensitive.

Arguments

•ID!
required

The ID of the cart.

•[String!]!
required

The case-insensitive gift card codes.

The input must not contain more than 250 values.


•mutation

Adds a merchandise line to the cart.

Arguments

•ID!
required

The ID of the cart.

•[CartLineInput!]!
required

A list of merchandise lines to add to the cart.

The input must not contain more than 250 values.


•mutation

Removes one or more merchandise lines from the cart.

Arguments

•ID!
required

The ID of the cart.

•[ID!]!
required

The merchandise line IDs to remove.

The input must not contain more than 250 values.


•mutation

Updates one or more merchandise lines on a cart.

Arguments

•ID!
required

The ID of the cart.

•[CartLineUpdateInput!]!
required

The merchandise lines to update.

The input must not contain more than 250 values.


•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.

Arguments

•ID!
required

The ID of the cart.

•String!
required

The note on the cart.


•mutation

Updates the selected delivery option for one or more CartDeliveryGroup 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 deliveryOptionHandle identifies which CartDeliveryOption to select for each delivery group.

Arguments

•ID!
required

The ID of the cart.

Anchor to selectedDeliveryOptionsselectedDeliveryOptions
•[CartSelectedDeliveryOptionInput!]!
required

The selected delivery options.

The input must not contain more than 250 values.



Was this section helpful?


Was this section helpful?