--- title: Attribute - Storefront API description: > A custom key-value pair for storing additional information on [carts](/docs/api/storefront/2026-01/objects/Cart), [cart lines](/docs/api/storefront/2026-01/objects/CartLine), [orders](/docs/api/storefront/2026-01/objects/Order), and [order line items](/docs/api/storefront/2026-01/objects/OrderLineItem). Common uses include gift wrapping requests, customer notes, and tracking whether a customer is a first-time buyer. Attributes set on a cart carry over to the resulting order after checkout. Use the [`cartAttributesUpdate`](/docs/api/storefront/2026-01/mutations/cartAttributesUpdate) mutation to add or modify cart attributes. For a step-by-step guide, see [managing carts with the Storefront API](https://shopify.dev/docs/storefronts/headless/building-with-the-storefront-api/cart/manage). api_version: 2026-01 api_name: storefront type: object api_type: graphql source_url: html: 'https://shopify.dev/docs/api/storefront/latest/objects/Attribute' md: 'https://shopify.dev/docs/api/storefront/latest/objects/Attribute.md' --- # Attribute object A custom key-value pair for storing additional information on [carts](https://shopify.dev/docs/api/storefront/2026-01/objects/Cart), [cart lines](https://shopify.dev/docs/api/storefront/2026-01/objects/CartLine), [orders](https://shopify.dev/docs/api/storefront/2026-01/objects/Order), and [order line items](https://shopify.dev/docs/api/storefront/2026-01/objects/OrderLineItem). Common uses include gift wrapping requests, customer notes, and tracking whether a customer is a first-time buyer. Attributes set on a cart carry over to the resulting order after checkout. Use the [`cartAttributesUpdate`](https://shopify.dev/docs/api/storefront/2026-01/mutations/cartAttributesUpdate) mutation to add or modify cart attributes. For a step-by-step guide, see [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 The key or name of the attribute. For example, `"customersFirstOrder"`. * value [String](https://shopify.dev/docs/api/storefront/latest/scalars/String) The value of the attribute. For example, `"true"`. *** ## Map ### Fields with this object * [BaseCartLine.attribute](https://shopify.dev/docs/api/storefront/latest/interfaces/BaseCartLine#fields-attribute) * [BaseCartLine.attributes](https://shopify.dev/docs/api/storefront/latest/interfaces/BaseCartLine#fields-attributes) * [Cart.attribute](https://shopify.dev/docs/api/storefront/latest/objects/Cart#field-Cart.fields.attribute) * [Cart.attributes](https://shopify.dev/docs/api/storefront/latest/objects/Cart#field-Cart.fields.attributes) * [CartLine.attribute](https://shopify.dev/docs/api/storefront/latest/objects/CartLine#field-CartLine.fields.attribute) * [CartLine.attributes](https://shopify.dev/docs/api/storefront/latest/objects/CartLine#field-CartLine.fields.attributes) * [ComponentizableCartLine.attribute](https://shopify.dev/docs/api/storefront/latest/objects/ComponentizableCartLine#field-ComponentizableCartLine.fields.attribute) * [ComponentizableCartLine.attributes](https://shopify.dev/docs/api/storefront/latest/objects/ComponentizableCartLine#field-ComponentizableCartLine.fields.attributes) * [Order.customAttributes](https://shopify.dev/docs/api/storefront/latest/objects/Order#field-Order.fields.customAttributes) * [OrderLineItem.customAttributes](https://shopify.dev/docs/api/storefront/latest/objects/OrderLineItem#field-OrderLineItem.fields.customAttributes)