---
title: CartLineInput - Storefront API
description: >-
  The input fields for adding a merchandise line to a cart. Each line represents
  a [`ProductVariant`](/docs/api/storefront/2026-10/objects/ProductVariant)

  the buyer intends to purchase, along with the quantity and optional
  [`SellingPlan`](/docs/api/storefront/2026-10/objects/SellingPlan)

  for subscriptions.


  Used by the [`cartCreate`](/docs/api/storefront/2026-10/mutations/cartCreate)
  mutation when creating a cart with initial items, and the
  [`cartLinesAdd`](/docs/api/storefront/2026-10/mutations/cartLinesAdd)

  mutation when adding items to an existing cart.
api_version: 2026-10
source_url:
  html: 'https://shopify.dev/docs/api/storefront/latest/input-objects/CartLineInput'
  md: >-
    https://shopify.dev/docs/api/storefront/latest/input-objects/CartLineInput.md
api_name: storefront
api_type: graphql
type: input-object
---

# Cart​Line​Input

input\_object

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

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

## Fields

* attributes

  [\[Attribute​Input!\]](https://shopify.dev/docs/api/storefront/latest/input-objects/AttributeInput)

  An array of key-value pairs that contains additional information about the merchandise line.

  The input must not contain more than `250` values.

* merchandise​Id

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

  non-null

  The ID of the merchandise that the buyer intends to purchase.

* parent

  [Cart​Line​Parent​Input](https://shopify.dev/docs/api/storefront/latest/input-objects/CartLineParentInput)

  The parent line item of the cart line.

* quantity

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

  Default:1

  The quantity of the merchandise.

* selling​Plan​Id

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

  The ID of the selling plan that the merchandise is being purchased with.

***

## Mutations using this input

* [cart​Lines​Add.lines](https://shopify.dev/docs/api/storefront/latest/mutations/cartLinesAdd#arguments-lines)

  ARGUMENT

***

## Input objects using this input

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

  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

### Mutations using this input

* [cart​Lines​Add.lines](https://shopify.dev/docs/api/storefront/latest/mutations/cartLinesAdd#arguments-lines)

### Input objects using this input

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