--- title: Cart - Storefront API description: | 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](https://shopify.dev/custom-storefronts/internationalization/international-pricing) during a customer's session. api_version: 2025-10 api_name: storefront type: object api_type: graphql source_url: html: https://shopify.dev/docs/api/storefront/latest/objects/Cart md: https://shopify.dev/docs/api/storefront/latest/objects/Cart.md --- # Cart 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](https://shopify.dev/custom-storefronts/internationalization/international-pricing) during a customer's session. ## Fields * applied​Gift​Cards [\[Applied​Gift​Card!\]!](https://shopify.dev/docs/api/storefront/latest/objects/AppliedGiftCard) non-null The gift cards that have been applied to the cart. * attribute [Attribute](https://shopify.dev/docs/api/storefront/latest/objects/Attribute) An attribute associated with the cart. * attributes [\[Attribute!\]!](https://shopify.dev/docs/api/storefront/latest/objects/Attribute) non-null The attributes associated with the cart. Attributes are represented as key-value pairs. * buyer​Identity [Cart​Buyer​Identity!](https://shopify.dev/docs/api/storefront/latest/objects/CartBuyerIdentity) non-null Information about the buyer that's interacting with the cart. * checkout​Url [URL!](https://shopify.dev/docs/api/storefront/latest/scalars/URL) non-null The URL of the checkout for the cart. * cost [Cart​Cost!](https://shopify.dev/docs/api/storefront/latest/objects/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](https://shopify.dev/custom-storefronts/internationalization/international-pricing). * created​At [Date​Time!](https://shopify.dev/docs/api/storefront/latest/scalars/DateTime) non-null The date and time when the cart was created. * delivery [Cart​Delivery!](https://shopify.dev/docs/api/storefront/latest/objects/CartDelivery) non-null The delivery properties of the cart. * delivery​Groups [Cart​Delivery​Group​Connection!](https://shopify.dev/docs/api/storefront/latest/connections/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. * discount​Allocations [\[Cart​Discount​Allocation!\]!](https://shopify.dev/docs/api/storefront/latest/interfaces/CartDiscountAllocation) non-null The discounts that have been applied to the entire cart. * discount​Codes [\[Cart​Discount​Code!\]!](https://shopify.dev/docs/api/storefront/latest/objects/CartDiscountCode) non-null The case-insensitive discount codes that the customer added at checkout. * id [ID!](https://shopify.dev/docs/api/storefront/latest/scalars/ID) non-null A globally-unique ID. * lines [Base​Cart​Line​Connection!](https://shopify.dev/docs/api/storefront/latest/connections/BaseCartLineConnection) non-null A list of lines containing information about the items the customer intends to purchase. * metafield [Metafield](https://shopify.dev/docs/api/storefront/latest/objects/Metafield) A [custom field](https://shopify.dev/docs/apps/build/custom-data), including its `namespace` and `key`, that's associated with a Shopify resource for the purposes of adding and storing additional information. * metafields [\[Metafield\]!](https://shopify.dev/docs/api/storefront/latest/objects/Metafield) non-null A list of [custom fields](https://shopify.dev/docs/apps/build/custom-data) that a merchant associates with a Shopify resource. * note [String](https://shopify.dev/docs/api/storefront/latest/scalars/String) A note that's associated with the cart. For example, the note can be a personalized message to the buyer. * total​Quantity [Int!](https://shopify.dev/docs/api/storefront/latest/scalars/Int) non-null The total number of items in the cart. * updated​At [Date​Time!](https://shopify.dev/docs/api/storefront/latest/scalars/DateTime) non-null The date and time when the cart was updated. * estimated​Cost [Cart​Estimated​Cost!](https://shopify.dev/docs/api/storefront/latest/objects/CartEstimatedCost) non-nullDeprecated *** ## Map ### Possible type in * [Metafield​Parent​Resource](https://shopify.dev/docs/api/storefront/latest/unions/MetafieldParentResource) *** ## Queries * [cart](https://shopify.dev/docs/api/storefront/latest/queries/cart) query Retrieve a cart by its ID. For more information, refer to [Manage a cart with the Storefront API](https://shopify.dev/custom-storefronts/cart/manage). *** ## \Cart Queries ### Queried by * \[cart](https://shopify.dev/docs/api/storefront/latest/queries/Cart) *** ## Mutations * [cart​Attributes​Update](https://shopify.dev/docs/api/storefront/latest/mutations/cartAttributesUpdate) mutation Updates the attributes on a 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​Create](https://shopify.dev/docs/api/storefront/latest/mutations/cartCreate) mutation Creates a new cart. * [cart​Delivery​Addresses​Add](https://shopify.dev/docs/api/storefront/latest/mutations/cartDeliveryAddressesAdd) mutation Adds delivery addresses to the cart. * [cart​Delivery​Addresses​Remove](https://shopify.dev/docs/api/storefront/latest/mutations/cartDeliveryAddressesRemove) mutation Removes delivery addresses from the cart. * [cart​Delivery​Addresses​Replace](https://shopify.dev/docs/api/storefront/latest/mutations/cartDeliveryAddressesReplace) mutation Replaces delivery addresses on the cart. * [cart​Delivery​Addresses​Update](https://shopify.dev/docs/api/storefront/latest/mutations/cartDeliveryAddressesUpdate) mutation Updates one or more delivery addresses on a cart. * [cart​Discount​Codes​Update](https://shopify.dev/docs/api/storefront/latest/mutations/cartDiscountCodesUpdate) mutation Updates the discount codes applied to the cart. * [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​Gift​Card​Codes​Remove](https://shopify.dev/docs/api/storefront/latest/mutations/cartGiftCardCodesRemove) mutation Removes the gift card codes applied to the cart. * [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​Lines​Add](https://shopify.dev/docs/api/storefront/latest/mutations/cartLinesAdd) mutation Adds a merchandise line to the cart. * [cart​Lines​Remove](https://shopify.dev/docs/api/storefront/latest/mutations/cartLinesRemove) mutation Removes one or more merchandise lines from the cart. * [cart​Lines​Update](https://shopify.dev/docs/api/storefront/latest/mutations/cartLinesUpdate) mutation Updates one or more merchandise lines on a cart. * [cart​Note​Update](https://shopify.dev/docs/api/storefront/latest/mutations/cartNoteUpdate) mutation Updates 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 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 * * [Has​Metafields](https://shopify.dev/docs/api/storefront/latest/interfaces/HasMetafields) interface * [Node](https://shopify.dev/docs/api/storefront/latest/interfaces/Node) interface *** ## ||-Cart Implements ### Implements * ||-[Has​Metafields](https://shopify.dev/docs/api/storefront/latest/interfaces/HasMetafields) * ||-[Node](https://shopify.dev/docs/api/storefront/latest/interfaces/Node)