---
title: "discountCodeBxgyUpdate"
description: "Update a Buy X Get Y (BXGY) code 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/mutations/discount-code-bxgy-update'
  md: 'https://developer.shopline.com/docs/admin-graph-ql-api/discounts-and-marketing/mutations/discount-code-bxgy-update.md'
---
# discountCodeBxgyUpdate

Update a Buy X Get Y (BXGY) code discount.

- **Required Scopes:** `write_discounts`
- **API Version:** v20270301
- **API Type:** Admin
- **API Protocol:** GraphQL
- **Operation Type:** Mutation

## Required Permissions

* `write_discounts`

An access token is required to call this API. Refer to [Authorization](https://developer.shopline.com/docs/apps/api-instructions-for-use/graph-ql-admin-api/overview.md) for more information about how to obtain the token.

## Arguments

* `bxgyCodeDiscount`

  [DiscountCodeBxgyInput!](https://developer.shopline.com/docs/admin-graph-ql-api/discounts-and-marketing/inputs/discount-code-bxgy-input.md)

  The input data used to update the code discount.

* `id`

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

  The ID of the code discount to be updated.

## Returns

* `userErrors`

  [[DiscountUserError!]!](https://developer.shopline.com/docs/admin-graph-ql-api/discounts-and-marketing/objects/discount-user-error.md)

  Errors that occur when updating a code discount.

* `codeDiscountNode`

  [DiscountCodeNode](https://developer.shopline.com/docs/admin-graph-ql-api/discounts-and-marketing/objects/discount-code-node.md)

  The node of the updated code discount.

## 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).

