---
title: AttributeInput - Storefront API
description: >-
  A custom key-value pair that stores additional information on a

  [cart](/docs/api/storefront/2026-10/objects/Cart) or [cart

  line](/docs/api/storefront/2026-10/objects/CartLine).

  Attributes capture additional information like gift messages, special

  instructions, or custom order details. Learn more about [managing carts with
  the Storefront
  API](https://shopify.dev/docs/storefronts/headless/building-with-the-storefront-api/cart/manage).
api_version: 2026-10
source_url:
  html: 'https://shopify.dev/docs/api/storefront/latest/input-objects/AttributeInput'
  md: >-
    https://shopify.dev/docs/api/storefront/latest/input-objects/AttributeInput.md
api_name: storefront
api_type: graphql
type: input-object
---

# Attribute​Input

input\_object

A custom key-value pair that stores additional information on a [cart](https://shopify.dev/docs/api/storefront/2026-10/objects/Cart) or [cart line](https://shopify.dev/docs/api/storefront/2026-10/objects/CartLine). Attributes capture additional information like gift messages, special instructions, or custom order details. Learn more about [managing carts with the Storefront API](https://shopify.dev/docs/storefronts/headless/building-with-the-storefront-api/cart/manage).

## Fields

* key

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

  non-null

  Key or name of the attribute.

* value

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

  non-null

  Value of the attribute.

***

## Mutations using this input

* [cart​Attributes​Update.attributes](https://shopify.dev/docs/api/storefront/latest/mutations/cartAttributesUpdate#arguments-attributes)

  ARGUMENT

***

## Input objects using this input

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

  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.

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

  INPUT OBJECT

  The input fields for adding a merchandise line to a cart. Each line represents a [`ProductVariant`](https://shopify.dev/docs/api/storefront/current/objects/ProductVariant) the buyer intends to purchase, along with the quantity and optional [`SellingPlan`](https://shopify.dev/docs/api/storefront/current/objects/SellingPlan) for subscriptions.

  Used by the [`cartCreate`](https://shopify.dev/docs/api/storefront/current/mutations/cartCreate) mutation when creating a cart with initial items, and the [`cartLinesAdd`](https://shopify.dev/docs/api/storefront/current/mutations/cartLinesAdd) mutation when adding items to an existing cart.

* [Cart​Line​Update​Input.attributes](https://shopify.dev/docs/api/storefront/latest/input-objects/CartLineUpdateInput#fields-attributes)

  INPUT OBJECT

  The input fields for updating a merchandise line in a cart. Used by the [`cartLinesUpdate`](https://shopify.dev/docs/api/storefront/current/mutations/cartLinesUpdate) mutation.

  Specify the line item's [`id`](https://shopify.dev/docs/api/storefront/current/input-objects/CartLineUpdateInput#fields-id) along with any fields to modify. You can change the quantity, swap the merchandise, update custom attributes, or associate a different selling plan.

***

## Map

### Mutations using this input

* [cart​Attributes​Update.attributes](https://shopify.dev/docs/api/storefront/latest/mutations/cartAttributesUpdate#arguments-attributes)

### Input objects using this input

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