---
title: "DiscountCodeBasic"
description: "代码折扣，为客户提供特定产品、系列或整个订单的百分比或固定金额折扣"
doc_type: graphql
doc_category: adminGraphQL
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/discounts-and-marketing/objects/discount-code-basic'
  md: 'https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/discounts-and-marketing/objects/discount-code-basic.md'
---
# DiscountCodeBasic

代码折扣，为客户提供特定产品、系列或整个订单的百分比或固定金额折扣

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

## Type Signature

`DiscountCodeBasic`

## Fields

* `appliesTimesPerCustomer`

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

  对每个客户使用次数限制

* `asyncUsageCount`

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

  折扣已使用的次数

* `codeCount`

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

  折扣兑换代码的数量

* `codes`

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

  折扣活动的折扣码，最多返回20个

* `combinesWith`

  [DiscountCombinesWith](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/discounts-and-marketing/objects/discount-combines-with.md)

  确定折扣可以与哪些折扣级别结合

* `createdAt`

  [Date](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/common/scalars/date.md)

  创建折扣的日期和时间

* `customerGets`

  [DiscountCustomerGets](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/discounts-and-marketing/objects/discount-customer-gets.md)

  订单中符合条件的商品、每件商品的数量以及折扣总价值

* `customerSelection`

  [DiscountCustomerSelection](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/discounts-and-marketing/unions/discount-customer-selection.md)

  可以使用折扣的顾客

* `discountClass`

  [MerchandiseDiscountClass](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/discounts-and-marketing/enums/merchandise-discount-class.md)

  用于合并目的的折扣类别

* `endsAt`

  [Date](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/common/scalars/date.md)

  折扣结束的日期和时间。对于无限期折扣，请使用 null

* `minimumRequirement`

  [DiscountMinimumRequirement](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/discounts-and-marketing/unions/discount-minimum-requirement.md)

  应用折扣所需的最小小计或数量

* `shareableUrls`

  [[DiscountShareableUrl]](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/discounts-and-marketing/objects/discount-shareable-url.md)

  可用于共享折扣的 URL。
  

* `shortSummary`

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

  折扣的简短摘要

* `startsAt`

  [Date](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/common/scalars/date.md)

  折扣开始的日期和时间

* `status`

  [DiscountStatus](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/discounts-and-marketing/enums/discount-status.md)

  折扣活动的状态

* `summary`

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

  折扣的详细摘要

* `title`

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

  折扣的标题

* `totalSales`

  [MoneyV2](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/common-objects/objects/money-v2.md)

  使用折扣的订单的总销售额。
  

* `updatedAt`

  [Date](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/common/scalars/date.md)

  折扣更新的日期和时间

* `usageLimit`

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

  折扣可使用的最大次数

## Schema Definition

```graphql
type DiscountCodeBasic { 
	appliesTimesPerCustomer: Int
	asyncUsageCount: Int
	codeCount: Int
	codes: [String]
	combinesWith: DiscountCombinesWith
	createdAt: Date
	customerGets: DiscountCustomerGets
	customerSelection: DiscountCustomerSelection
	discountClass: MerchandiseDiscountClass
	endsAt: Date
	minimumRequirement: DiscountMinimumRequirement
	shareableUrls: [DiscountShareableUrl]
	shortSummary: String
	startsAt: Date
	status: DiscountStatus
	summary: String
	title: String
	totalSales: MoneyV2
	updatedAt: Date
	usageLimit: Int 
}
```

## Error Handling

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

