For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Dev Portal
DocsAPI ReferenceLearnCommunityChangelog
DocsAPI ReferenceLearnCommunityChangelog
    • About Our APIs
  • REST
    • Overview
  • GraphQL
    • Overview
      • Playground
      • Explorer
          • MUTcreateCart
          • MUTdeleteCart
          • MUTaddCartLineItems
          • MUTupdateCartLineItem
          • MUTdeleteCartLineItem
          • MUTupdateCartCurrency
          • MUTassignCartToCustomer
          • MUTunassignCartFromCustomer
          • MUTcreateCartMetafield
          • MUTupdateCartMetafield
          • MUTdeleteCartMetafield
          • MUTcreateCartRedirectUrls
          • MUTcreateCheckout
          • MUTupdateCheckout
          • MUTaddCheckoutBillingAddress
          • MUTupdateCheckoutBillingAddress
          • MUTupdateCheckoutCustomerMessage
          • MUTselectCheckoutShippingOption
          • MUTapplyCheckoutCoupon
          • MUTunapplyCheckoutCoupon
          • MUTapplyCheckoutGiftCertificate
          • MUTunapplyCheckoutGiftCertificate
          • MUTapplyCheckoutSpamProtection
          • MUTaddCheckoutShippingConsignments
          • MUTupdateCheckoutShippingConsignment
          • MUTdeleteCheckoutConsignment
          • MUTcompleteCheckout
          • MUTlogin
          • MUTlogout
          • MUTcreateWishlist
          • MUTaddWishlistItems
          • MUTdeleteWishlistItems
          • MUTupdateWishlist
          • MUTdeleteWishlists
          • MUTloginWithCustomerLoginJwt
          • MUTsubmitContactUs
          • MUTgenerateSessionSyncJwt
          • MUTvalidateSessionSyncJwt
          • MUTproductViewedEvent
          • MUTpageViewedEvent
          • MUTvisitStartedEvent
          • MUTsearchProductEvent
          • MUTpreviewGiftCertificate
          • MUTregisterCompany
          • MUTaddProductReview
          • MUTchangePassword
          • MUTrequestResetPassword
          • MUTresetPassword
          • MUTregisterCustomer
          • MUTupdateCustomer
          • MUTaddCustomerAddress
          • MUTupdateCustomerAddress
          • MUTdeleteCustomerAddress
          • MUTpayment
          • MUTsubscribe
          • MUTunsubscribe
  • MCP
    • Overview
Dev Portal
LogoLogo
GraphQLStorefrontMutations

updateCartMetafield

Example Query
1mutation ExampleMutation($input: UpdateCartMetafieldInput) {
2 updateCartMetafield(input: $input) {
3 metafield {
4 id
5 entityId
6 key
7 value
8 description
9 }
10 errors
11 }
12}
Variables
1{
2 "input": {
3 "cartEntityId": "example",
4 "metafieldEntityId": 0,
5 "data": {
6 "key": "example",
7 "value": "example"
8 }
9 }
10}
Example response
1{
2 "data": {
3 "updateCartMetafield": {
4 "metafield": {
5 "id": "example",
6 "entityId": 0,
7 "key": "example",
8 "value": "example",
9 "description": "example"
10 },
11 "errors": [
12 {
13 "message": "example"
14 }
15 ]
16 }
17 }
18}
Updates a metafield for cart object.
Was this page helpful?
Previous

createCartMetafield

Next

deleteCartMetafield

Built with

Arguments

inputUpdateCartMetafieldInputRequired
Update cart's metafield input object.

Returns

an UpdateCartMetafieldResult
errorslist of UpdateCartMetafieldErrors
Errors found during update of cart's metafield.
metafieldMetafields
Successfully updated metafield for cart.