---
title: CartMetafieldsSetInput - Storefront API
description: The input fields for a cart metafield value to set.
api_version: 2026-10
source_url:
  html: >-
    https://shopify.dev/docs/api/storefront/latest/input-objects/CartMetafieldsSetInput
  md: >-
    https://shopify.dev/docs/api/storefront/latest/input-objects/CartMetafieldsSetInput.md
api_name: storefront
api_type: graphql
type: input-object
---

# Cart​Metafields​Set​Input

input\_object

The input fields for a cart metafield value to set.

## Fields

* key

  [String!](https://shopify.dev/docs/api/storefront/latest/scalars/String)

  non-null

  The key name of the cart metafield. This can either be a composite key (`namespace.key`) or a simple key that relies on the default app-reserved namespace.

* owner​Id

  [ID!](https://shopify.dev/docs/api/storefront/latest/scalars/ID)

  non-null

  The ID of the cart resource.

* type

  [String!](https://shopify.dev/docs/api/storefront/latest/scalars/String)

  non-null

  The type of data that the cart metafield stores. The type of data must be a [supported type](https://shopify.dev/apps/metafields/types).

* value

  [String!](https://shopify.dev/docs/api/storefront/latest/scalars/String)

  non-null

  The data to store in the cart metafield. The data is always stored as a string, regardless of the metafield's type.

***

## Mutations using this input

* [cart​Metafields​Set.metafields](https://shopify.dev/docs/api/storefront/latest/mutations/cartMetafieldsSet#arguments-metafields)

  ARGUMENT

***

## Map

### Mutations using this input

* [cart​Metafields​Set.metafields](https://shopify.dev/docs/api/storefront/latest/mutations/cartMetafieldsSet#arguments-metafields)
