--- title: DiscountAutomaticBxgyInput - GraphQL Admin description: >- The input fields for creating or updating a [buy X get Y discount (BXGY)](https://help.shopify.com/manual/discounts/discount-types/buy-x-get-y) that's automatically applied on a cart and at checkout. When creating, required fields are: - `customerBuys` - `customerGets` - `startsAt` - `title` api_version: unstable api_name: admin source_url: html: >- https://shopify.dev/docs/api/admin-graphql/unstable/input-objects/DiscountAutomaticBxgyInput md: >- https://shopify.dev/docs/api/admin-graphql/unstable/input-objects/DiscountAutomaticBxgyInput.md metadata: domain: admin --- # Discount​Automatic​Bxgy​Input input\_object The input fields for creating or updating a [buy X get Y discount (BXGY)](https://help.shopify.com/manual/discounts/discount-types/buy-x-get-y) that's automatically applied on a cart and at checkout. When creating, required fields are: * `customerBuys` * `customerGets` * `startsAt` * `title` ## Fields * combines​With [Discount​Combines​With​Input](https://shopify.dev/docs/api/admin-graphql/unstable/input-objects/DiscountCombinesWithInput) The [discount classes](https://help.shopify.com/manual/discounts/combining-discounts/discount-combinations) that you can use in combination with [Shopify discount types](https://help.shopify.com/manual/discounts/discount-types), and the product discount tags that determine which product discounts can apply together on the same cart line. * context [Discount​Context​Input](https://shopify.dev/docs/api/admin-graphql/unstable/input-objects/DiscountContextInput) The context defining which buyers can use the discount. You can target specific customer IDs, customer segments, or make the discount available to all buyers. Discounts automatically apply on Point of Sale (POS) for Pro locations when the context is not set to ALL. * customer​Buys [Discount​Customer​Buys​Input](https://shopify.dev/docs/api/admin-graphql/unstable/input-objects/DiscountCustomerBuysInput) The items eligible for the discount and the required quantity of each to receive the discount. * customer​Gets [Discount​Customer​Gets​Input](https://shopify.dev/docs/api/admin-graphql/unstable/input-objects/DiscountCustomerGetsInput) The items in the order that qualify for the discount, their quantities, and the total value of the discount. * ends​At [Date​Time](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/DateTime) The date and time when the discount expires and is no longer available to customers. For discounts without a fixed expiration date, specify `null`. * starts​At [Date​Time](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/DateTime) The date and time when the discount becomes active and is available to customers. * tags [\[String!\]](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/String) A list of searchable keywords that are associated with the discount. Use these tags on product discounts to determine which other product discounts can apply to the same cart line when you configure `productDiscountsWithTagsOnSameCartLine` in `combinesWith`. For example, you can apply a `loyalty` tag to discounts that are associated with a loyalty program. Updating `tags` overwrites any existing tags that were previously added to the discount. To add new tags without overwriting existing tags, use the [`tagsAdd`](https://shopify.dev/api/admin-graphql/latest/mutations/tagsadd) mutation. * title [String](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/String) The discount's name that displays to merchants in the Shopify admin and to customers. * uses​Per​Order​Limit [Unsigned​Int64](https://shopify.dev/docs/api/admin-graphql/unstable/scalars/UnsignedInt64) The maximum number of times that the discount can be applied to an order. *** ## Mutations using this input * [discount​Automatic​Bxgy​Create.automaticBxgyDiscount](https://shopify.dev/docs/api/admin-graphql/unstable/mutations/discountAutomaticBxgyCreate#arguments-automaticBxgyDiscount) ARGUMENT * [discount​Automatic​Bxgy​Update.automaticBxgyDiscount](https://shopify.dev/docs/api/admin-graphql/unstable/mutations/discountAutomaticBxgyUpdate#arguments-automaticBxgyDiscount) ARGUMENT *** ## Map ### Mutations using this input * [discount​Automatic​Bxgy​Create.automaticBxgyDiscount](https://shopify.dev/docs/api/admin-graphql/unstable/mutations/discountAutomaticBxgyCreate#arguments-automaticBxgyDiscount) * [discount​Automatic​Bxgy​Update.automaticBxgyDiscount](https://shopify.dev/docs/api/admin-graphql/unstable/mutations/discountAutomaticBxgyUpdate#arguments-automaticBxgyDiscount)