---
title: "DiscountCodeBxgy"
description: "为客户提供买 X 送 Y (BXGY) 折扣的代码折扣"
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-bxgy'
  md: 'https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/discounts-and-marketing/objects/discount-code-bxgy.md'
---
# DiscountCodeBxgy

为客户提供买 X 送 Y (BXGY) 折扣的代码折扣

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

## Type Signature

`DiscountCodeBxgy`

## Fields

* `appliesTimesPerCustomer`

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

  每个客户使用次数限制，null表示不限

* `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)

  创建折扣的日期和时间

* `customerBuys`

  [DiscountCustomerBuys](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/discounts-and-marketing/objects/discount-customer-buys.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

* `shareableUrls`

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

  可用于共享折扣的 URL

* `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)

  折扣可使用的最大次数

* `usesPerOrderLimit`

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

  折扣可应用于订单的最大次数

## Schema Definition

```graphql
type DiscountCodeBxgy { 
	appliesTimesPerCustomer: Int
	asyncUsageCount: Int
	codeCount: Int
	codes: [String]
	combinesWith: DiscountCombinesWith
	createdAt: Date
	customerBuys: DiscountCustomerBuys
	customerGets: DiscountCustomerGets
	customerSelection: DiscountCustomerSelection
	discountClass: MerchandiseDiscountClass
	endsAt: Date
	shareableUrls: [DiscountShareableUrl]
	startsAt: Date
	status: DiscountStatus
	summary: String
	title: String
	totalSales: MoneyV2
	updatedAt: Date
	usageLimit: Int
	usesPerOrderLimit: 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)。

