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

CartLine

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

## Type Signature

`CartLine`

## Fields

* `attributes`

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

  购物车商品行属性，属性为键值对

* `discountAllocations`

  [[CartDiscountAllocation]](https://developer.shopline.com/zh-hans-cn/docs/storefront-api/cart/objects/cart-discount-allocation.md)

  购物车商品行应用的折扣

* `id`

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

  全局唯一id

* `image`

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

  商品图片链接

* `price`

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

  商品价格

* `productId`

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

  product id

* `productVariant`

  [ProductVariant!](https://developer.shopline.com/zh-hans-cn/docs/storefront-api/products/objects/product-variant.md)

  商品变体代表商品的不同款式，例如不同的颜色，或不同的尺寸。

* `quantity`

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

  顾客要购买的商品数量

* `selectStatus`

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

  是否选中

* `selectedOptions`

  [[SelectedOption]!](https://developer.shopline.com/zh-hans-cn/docs/storefront-api/common-objects/objects/selected-option.md)

  客户选择商品的属性。商品可以有多种选择，例如不同的尺寸或颜色。

* `singleSelect`

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

  能否单独选中

* `taxable`

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

  是否需要收税

* `title`

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

  商品标题

* `variantId`

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

  variant id

## Schema Definition

```graphql
type CartLine { 
	attributes: [Attribute]
	discountAllocations: [CartDiscountAllocation]
	id: ID!
	image: String
	price: Decimal
	productId: String!
	productVariant: ProductVariant!
	quantity: String!
	selectStatus: Boolean
	selectedOptions: [SelectedOption]!
	singleSelect: Boolean
	taxable: Boolean
	title: String
	variantId: String! 
}
```

## Field from

* [Cart](https://developer.shopline.com/zh-hans-cn/docs/storefront-api/cart/objects/cart.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)。

