---
title: CartInputMetafieldInput - Storefront API
description: >-
  The input fields for a cart metafield value to set.


  Cart metafields will be copied to order metafields at order creation time if

  there is a matching order metafield definition with the [`cart to order
  copyable`](https://shopify.dev/docs/apps/build/metafields/use-metafield-capabilities#cart-to-order-copyable)

  capability enabled.
api_version: 2026-10
source_url:
  html: >-
    https://shopify.dev/docs/api/storefront/latest/input-objects/CartInputMetafieldInput
  md: >-
    https://shopify.dev/docs/api/storefront/latest/input-objects/CartInputMetafieldInput.md
api_name: storefront
api_type: graphql
type: input-object
---

# Cart​Input​Metafield​Input

input\_object

The input fields for a cart metafield value to set.

Cart metafields will be copied to order metafields at order creation time if there is a matching order metafield definition with the [`cart to order copyable`](https://shopify.dev/docs/apps/build/metafields/use-metafield-capabilities#cart-to-order-copyable) capability enabled.

## Fields

* key

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

  non-null

  The key name of the metafield.

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

***

## Input objects using this input

* [Cart​Input.metafields](https://shopify.dev/docs/api/storefront/latest/input-objects/CartInput#fields-metafields)

  INPUT OBJECT

  The input fields for creating a [`Cart`](https://shopify.dev/docs/api/storefront/current/objects/Cart). Used by the [`cartCreate`](https://shopify.dev/docs/api/storefront/current/mutations/cartCreate) mutation.

  Accepts merchandise lines, discount codes, gift card codes, and a note. You can also set custom attributes, metafields, buyer identity for international pricing, and delivery addresses.

***

## Map

### Input objects using this input

* [Cart​Input.metafields](https://shopify.dev/docs/api/storefront/latest/input-objects/CartInput#fields-metafields)
