---
title: "DiscountCodeBxgyInput"
description: "用于创建和更新买 X 送 Y 折扣码活动的输入字段。"
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/inputs/discount-code-bxgy-input'
  md: 'https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/discounts-and-marketing/inputs/discount-code-bxgy-input.md'
---
# DiscountCodeBxgyInput

用于创建和更新买 X 送 Y 折扣码活动的输入字段。

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

## Input Fields

* `code`

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

  折扣码。

* `customerSelection`

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

  指定可参与此折扣的客户范围。在更新操作中，若为 `null` 或不传，则保持原值不变。

* `startsAt`

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

  折扣开始的日期和时间。

* `customerBuys`

  [DiscountCustomerBuysInput](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/discounts-and-marketing/inputs/discount-customer-buys-input.md)

  符合折扣资格的商品以及客户必须购买的每件商品的数量。

* `usesPerOrderLimit`

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

  折扣可在单个订单中使用的最大次数。若为 `null` 或不传，则表示不限制次数。

* `title`

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

  折扣的标题。

* `appliesTimesPerCustomer`

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

  每个客户可使用该折扣的最大次数。若为 `null` 或不传，则表示不限制使用次数。    
  取值范围：1-99,999,999

* `endsAt`

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

  折扣结束的日期和时间。若为 `null` 或不传，则表示该折扣无到期时间。

* `combinesWith`

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

  该折扣可叠加使用的折扣类型。若为 `null`、空对象（`{}`）或不传，则该折扣不与其他折扣叠加。

* `customerGets`

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

  将享受折扣的合格商品、每件商品的数量以及折扣的总价值。

* `usageLimit`

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

  折扣可使用的最大次数。若为 `null` 或不传，则表示不限制总共使用次数。         
  取值范围：1-99,999,999

## Argument from

* [Mutation](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/discounts-and-marketing/mutations/discount-code-bxgy-create.md).discountCodeBxgyCreate

* [Mutation](https://developer.shopline.com/zh-hans-cn/docs/admin-graph-ql-api/discounts-and-marketing/mutations/discount-code-bxgy-update.md).discountCodeBxgyUpdate

