---
title: "DiscountAutomaticBxgy"
description: "Buy X Get Y (BXGY) automatic discount."
doc_type: graphql
doc_category: adminGraphQL
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/docs/admin-graph-ql-api/discounts-and-marketing/objects/discount-automatic-bxgy'
  md: 'https://developer.shopline.com/docs/admin-graph-ql-api/discounts-and-marketing/objects/discount-automatic-bxgy.md'
---
# DiscountAutomaticBxgy

Buy X Get Y (BXGY) automatic discount.

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

## Type Signature

`DiscountAutomaticBxgy`

## Fields

* `asyncUsageCount`

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

  The number of times the discount has been redeemed. This value is updated asynchronously and may not match the actual usage count.

* `combinesWith`

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

  which discount classes the discount can combine with.

* `createdAt`

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

  The time when discount created.

* `customerBuys`

  [DiscountCustomerBuys](https://developer.shopline.com/docs/admin-graph-ql-api/discounts-and-marketing/objects/discount-customer-buys.md)

  Eligible items for the discount and the quantity of each item the customer must purchase.

* `customerGets`

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

  Eligible items in the order, the quantity of each item, and the total discount value.

* `discountClass`

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

  The class of the discount for combining purposes.
  
  

* `endsAt`

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

  The time when discount ends. use null for open-ended discounts.

* `startsAt`

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

  The time when the discount starts.

* `status`

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

  The discount status.

* `summary`

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

  summary of the discount.
  
  

* `title`

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

  discount title.

* `updatedAt`

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

  The time when the discount was updated.

* `usesPerOrderLimit`

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

  Times that the discount can be applied to an order.

## Schema Definition

```graphql
type DiscountAutomaticBxgy { 
	asyncUsageCount: Int
	combinesWith: DiscountCombinesWith
	createdAt: Date
	customerBuys: DiscountCustomerBuys
	customerGets: DiscountCustomerGets
	discountClass: MerchandiseDiscountClass
	endsAt: Date
	startsAt: Date
	status: DiscountStatus
	summary: String
	title: String
	updatedAt: Date
	usesPerOrderLimit: Int 
}
```

## Error Handling

For detailed information about common codes, see [Status and error codes](https://developer.shopline.com/docs/apps/api-instructions-for-use/graph-ql-admin-api/overview.md#status-and-error-codes).

