younifyd
Menu

discountCodeRedeemCodeBulkDelete

Asynchronously delete discount codes in bulk that customers can use to redeem a discount.

Use it in a workflow

  1. Add a step and choose the Shopify connector.
  2. Pick the discountCodeRedeemCodeBulkDelete action (under Discount).
  3. Fill in the fields below, then reference the result from later steps as {{discountcoderedeemcodebulkdelete.response.data}}.

Query

This is the mutation the action sends by default. Edit it in the step's Query field to change which fields come back.

graphql
mutation DiscountCodeRedeemCodeBulkDelete($discountId: ID!, $search: String, $savedSearchId: ID, $ids: [ID!]) {
  discountCodeRedeemCodeBulkDelete(
    discountId: $discountId
    search: $search
    savedSearchId: $savedSearchId
    ids: $ids
  ) {
    job {
      done
      id
      query {
        appDiscountTypes
        availableBackupRegions
        availableCarrierServices
        availableLocales
        backupRegion
        businessEntities
        catalogOperations
        collectionConditionMetafieldDefinitions
        collectionRulesConditions
        consentPolicyRegions
        currentAppInstallation
        currentStaffMember
        deliveryPromiseSettings
        financeAppAccessPolicy
        financeKycInformation
        fulfillmentConstraintRules
        giftCardConfiguration
        inventoryProperties
        locationsAvailableForDeliveryProfiles
        metafieldDefinitionTypes
        onlineStore
        pendingOrdersCount
        primaryMarket
        privacySettings
        publicApiVersions
        serverPixel
        shop
        shopBillingPreferences
        shopifyPaymentsAccount
        storeCreditConfiguration
        taxonomy
      }
    }
    userErrors {
      code
      extraInfo
      field
      message
    }
  }
}

Variables

Pass these as a JSON object in the step's Variables field.

discountIdstringrequired

The ID of the [`DiscountCodeNode`](https://help.shopify.com/docs/api/admin-graphql/latest/objects/DiscountCodeNode#field-id) object that the codes will be removed from. For example, `gid://shopify/DiscountCodeNode/123`. You can use the [`codeDiscountNodes` query](https://shopify.dev/docs/api/admin-graphql/latest/queries/codeDiscountNodes) to retrieve the ID.

searchstring

A filter made up of terms, connectives, modifiers, and comparators that you can use to search for code discounts. You can apply one or more filters to a query. Learn more about [Shopify API search syntax](https://shopify.dev/docs/api/usage/search-syntax). For a list of accepted values for the `search` field, refer to the [`query` argument on the `codeDiscountNodes` query](https://shopify.dev/docs/api/admin-graphql/latest/queries/codeDiscountNodes#argument-query).

savedSearchIdstring

The ID of a [saved search](https://shopify.dev/docs/api/admin-graphql/latest/objects/savedsearch#field-id).

idsarray<string>

The IDs of the [`DiscountRedeemCode`](https://shopify.dev/docs/api/admin-graphql/latest/objects/discountredeemcode#field-id) objects to delete. For example, `gid://shopify/DiscountRedeemCode/123`. You can use the [`codeDiscountNodes` query](https://shopify.dev/docs/api/admin-graphql/latest/queries/codeDiscountNodes) to retrieve the ID.

json
{
  "discountId": "string",
  "search": "string",
  "savedSearchId": "string",
  "ids": [
    "string"
  ]
}

Response

Read the result with {{discountcoderedeemcodebulkdelete.response.data.data.discountCodeRedeemCodeBulkDelete}}. If the API returns errors, the step fails and they are at {{discountcoderedeemcodebulkdelete.response.data.errors}}.

jobobject
doneboolean
idstring
queryobject31 fields
userErrorsarray<object>
codeobject
extraInfoobject
fieldobject
messageobject

Need more? See the Shopify guide for connection setup and behaviour shared by every action.

discountCodeRedeemCodeBulkDelete — Shopify — Documentation