---
title: "CartLineInput"
description: "CartLineInput"
doc_type: graphql
doc_category: storefront
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/zh-hans-cn/docs/storefront-api/cart/inputs/cart-line-input'
  md: 'https://developer.shopline.com/zh-hans-cn/docs/storefront-api/cart/inputs/cart-line-input.md'
---
# CartLineInput

CartLineInput

- **API Version:** v20270301
- **API Type:** Storefront
- **API Protocol:** GraphQL
- **Operation Type:** Input

## Type Signature

`CartLineInput`

## Input Fields

* `quantity`

  [Int!](https://developer.shopline.com/zh-hans-cn/docs/storefront-api/common/scalars/int.md)

  商品数量

* `variantId`

  [String!](https://developer.shopline.com/zh-hans-cn/docs/storefront-api/common/scalars/string.md)

  variant id

* `attributes`

  [[AttributeInput]](https://developer.shopline.com/zh-hans-cn/docs/storefront-api/common-objects/inputs/attribute-input.md)

  商品行自定义属性

## Schema Definition

```graphql
input CartLineInput { 
	quantity: Int!
	variantId: String!
	attributes: [AttributeInput] 
}
```

## Input field from

* [CartLinesAddInput](https://developer.shopline.com/zh-hans-cn/docs/storefront-api/cart/inputs/cart-lines-add-input.md).lines

  添加到购物车的商品列表

* [CartInput](https://developer.shopline.com/zh-hans-cn/docs/storefront-api/cart/inputs/cart-input.md).lines

  购物车商品列表

## Error Handling

关于更多通用错误码说明，参考：[状态码和错误码](https://developer.shopline.com/zh-hans-cn/docs/apps/api-instructions-for-use/storefront-api/overview.md#status-and-error-codes)。

