younifyd
Menu

discountCodeBulkDelete

Deletes multiple code-based discounts asynchronously using one of the following: - A search query - A saved search ID - A list of discount code IDs For example, you can delete discounts for all codes that match a…

Use it in a workflow

  1. Add a step and choose the Shopify connector.
  2. Pick the discountCodeBulkDelete action (under Discount).
  3. Fill in the fields below, then reference the result from later steps as {{discountcodebulkdelete.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 DiscountCodeBulkDelete($search: String, $savedSearchId: ID, $ids: [ID!]) {
  discountCodeBulkDelete(
    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.

searchstring

The search query for filtering discounts. <br><br> For more information on the list of supported fields and search syntax, refer to the [`codeDiscountNodes`](https://shopify.dev/docs/api/admin-graphql/latest/queries/codeDiscountNodes#query-arguments) query.

savedSearchIdstring

The ID of the saved search for filtering discounts to delete. Saved searches represent [customer segments](https://help.shopify.com/manual/customers/customer-segments) that merchants have built in the Shopify admin.

idsarray<string>

The IDs of the discounts to delete.

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

Response

Read the result with {{discountcodebulkdelete.response.data.data.discountCodeBulkDelete}}. If the API returns errors, the step fails and they are at {{discountcodebulkdelete.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.

discountCodeBulkDelete — Shopify — Documentation