Bulk Update Variants
shopify_bulk_update_variantsApply the same changes to many Shopify variants at once, including pricing, cost, customs codes, and shipping weight. Filter by SKU, product, or query, and preview with a dry run.
Instructions
Apply the same field changes to many variants in one go — customs data, cost, pricing, identifiers and shipping weight.
Select the variants with any combination of skus, productIds, query, onlyMissingHsCode and onlyMissingOrigin (combined with AND). At least one selector is required.
The common customs backfill is: onlyMissingHsCode: true, harmonizedSystemCode: '611030', countryCodeOfOrigin: 'AU'
dryRun defaults to TRUE when price or compareAtPrice is set, and FALSE otherwise — so pricing changes require an explicit dryRun: false, while customs and cost writes apply immediately. A dry run reports exactly which variants would change and writes nothing.
maxVariants (default 500) is a hard refusal, not a truncation: if the selector matches more, nothing is written and you are told the match count.
SKU cannot be changed here — bulk-rewriting SKUs would break the selectors used to address variants. Use shopify_update_inventory_item for single-SKU changes.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cost | No | Unit cost e.g. '12.50' | |
| skus | No | Exact variant SKUs | |
| price | No | Price e.g. '29.99' | |
| query | No | Shopify variant search, e.g. 'product_type:Socks' | |
| dryRun | No | Preview without writing. Defaults true when price fields are set. | |
| barcode | No | Barcode / GTIN | |
| taxCode | No | ||
| taxable | No | ||
| tracked | No | Whether Shopify tracks stock for this SKU | |
| productIds | No | Product GIDs — targets every variant of each | |
| weightUnit | No | ||
| maxVariants | No | Refuse if the selector matches more than this | |
| weightValue | No | Shipping weight, e.g. 0.25 | |
| compareAtPrice | No | Compare-at price e.g. '39.99' | |
| inventoryPolicy | No | Whether to keep selling when out of stock | |
| requiresShipping | No | false for digital/service items | |
| onlyMissingHsCode | No | Restrict to variants with no HS code | |
| onlyMissingOrigin | No | Restrict to variants with no country of origin | |
| countryCodeOfOrigin | No | 2-letter ISO country code e.g. 'AU' | |
| harmonizedSystemCode | No | HS/HTS code, 6-13 digits e.g. '611030' or '6110.30' | |
| provinceCodeOfOrigin | No | Province/state code e.g. 'BC' | |
| countryHarmonizedSystemCodes | No | Destination-specific HTS overrides — replaces the existing list |