Skip to main content
object

A cart represents the merchandise that a buyer intends to purchase, and the estimated cost associated with the cart. Learn how to interact with a cart during a customer's session.

•[AppliedGiftCard!]!
non-null

The gift cards that have been applied to the cart.

•Attribute

An attribute associated with the cart.

Arguments

•String!
required

The key of the attribute.


•[Attribute!]!
non-null

The attributes associated with the cart. Attributes are represented as key-value pairs.

•CartBuyerIdentity!
non-null

Information about the buyer that's interacting with the cart.

•URL!
non-null

The URL of the checkout for the cart.

•CartCost!
non-null

The estimated costs that the buyer will pay at checkout. The costs are subject to change and changes will be reflected at checkout. The cost field uses the buyerIdentity field to determine international pricing.

•DateTime!
non-null

The date and time when the cart was created.

•CartDelivery!
non-null

The delivery properties of the cart.

•CartDeliveryGroupConnection!
non-null

The delivery groups available for the cart, based on the buyer identity default delivery address preference or the default address of the logged-in customer.

Arguments

•Int

Returns up to the first n elements from the list.

•String

Returns the elements that come after the specified cursor.

•Int

Returns up to the last n elements from the list.

•String

Returns the elements that come before the specified cursor.

•Boolean
Default:false

Reverse the order of the underlying list.

•Boolean
Default:false

Whether to include carrier-calculated delivery rates in the response.

By default, only static shipping rates are returned. This argument requires mandatory usage of the @defer directive.

For more information, refer to fetching carrier-calculated rates for the cart using @defer.


•[CartDiscountAllocation!]!
non-null

The discounts that have been applied to the entire cart.

•[CartDiscountCode!]!
non-null

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

•ID!
non-null

A globally-unique ID.

•BaseCartLineConnection!
non-null

A list of lines containing information about the items the customer intends to purchase.

Arguments

•Int

Returns up to the first n elements from the list.

•String

Returns the elements that come after the specified cursor.

•Int

Returns up to the last n elements from the list.

•String

Returns the elements that come before the specified cursor.

•Boolean
Default:false

Reverse the order of the underlying list.


•Metafield

A custom field, including its namespace and key, that's associated with a Shopify resource for the purposes of adding and storing additional information.

Arguments

•String

The container the metafield belongs to. If omitted, the app-reserved namespace will be used.

•String!
required

The identifier for the metafield.


•[Metafield]!
non-null

A list of custom fields that a merchant associates with a Shopify resource.

Arguments

•[HasMetafieldsIdentifier!]!
required

The list of metafields to retrieve by namespace and key.

The input must not contain more than 250 values.


•String

A note that's associated with the cart. For example, the note can be a personalized message to the buyer.

•Int!
non-null

The total number of items in the cart.

•DateTime!
non-null

The date and time when the cart was updated.

•CartEstimatedCost!
non-nullDeprecated

Was this section helpful?

•query

Retrieve a cart by its ID. For more information, refer to Manage a cart with the Storefront API.

Arguments

•ID!
required

The ID of the cart.



Was this section helpful?

•mutation

Updates the attributes on a cart.

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 customer information associated with a cart. Buyer identity is used to determine international pricing and should match the customer's shipping address.

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.

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 the cart.

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 the cart without replacing existing ones.

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 the gift card codes applied to the cart.

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.

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 the cart.

Arguments

•ID!
required

The ID of the cart.

•String!
required

The note on the cart.


•mutation

Update the selected delivery options for a 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?