---
title: AttributeInput - Storefront API
description: >
  A custom key-value pair that stores additional information on a
  [cart](/docs/api/storefront/2026-04/objects/Cart) or [cart
  line](/docs/api/storefront/2026-04/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-04
api_name: storefront
type: input-object
api_type: graphql
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
---

# Attribute​Input

input\_object

A custom key-value pair that stores additional information on a [cart](https://shopify.dev/docs/api/storefront/2026-04/objects/Cart) or [cart line](https://shopify.dev/docs/api/storefront/2026-04/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.

***

## 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

### 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)
