discountCodeRedeemCodeBulkDelete mutation

Asynchronously delete discount redeem codes in bulk. Specify the redeem codes to delete by providing a search query, a savedSearchId, or a list of redeem code IDs.

Required access

Apps must have write_discounts access scope.


On this page


Interactive example

This is an example mutation query. Use the embedded interactive tool below to edit the query.

Hint: use Ctrl + Space for autocompleting fields.

mutation discountCodeRedeemCodeBulkDelete($discountId: ID!) { discountCodeRedeemCodeBulkDelete(discountId: $discountId) {
  1. <font style="color:#1F61A0;">job</font> <font style="color:#555555;">{</font>
  2. <font style="color:#1F61A0;">id</font>
  3. <font style="color:#555555;">}</font>
  4. <font style="color:#1F61A0;">userErrors</font> <font style="color:#555555;">{</font>
  5. <font style="color:#1F61A0;">code</font>
  6. <font style="color:#1F61A0;">extraInfo</font>
  7. <font style="color:#1F61A0;">field</font>
  8. <font style="color:#1F61A0;">message</font>
  9. <font style="color:#555555;">}</font>
} } { “discountId”: “Z2lkOi8vU2hvcGlmeS9FeGFtcGxlLzE=” }


Arguments

Argument Description
discountId
(
[ID!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#id-2021-01)

) REQUIRED
The ID of the redeem code’s discount.
ids
(
[[ID!]](https://shopify.dev/docs/admin-api/graphql/reference/scalar#id-2021-01)

)
The IDs of the discount redeem codes to delete.
savedSearchId
(
[ID](https://shopify.dev/docs/admin-api/graphql/reference/scalar#id-2021-01)

)
The ID of the saved search.
search
(
[String](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01)

)
The search query for filtering discount redeem codes.


Return fields

  • job ([Job](https://shopify.dev/docs/admin-api/graphql/reference/common-objects/job))
    The asynchronous job that deletes the discount redeem codes.
  • userErrors ([[DiscountUserError!]!](https://shopify.dev/docs/admin-api/graphql/reference/discounts-and-marketing/discountusererror))
    List of errors that occurred executing the mutation.