# Generate SKU codes for several styles

> Generate the SKU codes of many styles in one run from the Styles list, answer the questions Vestis asks along the way, and copy the codes it created.

Source: https://docs.vestislabs.com/collection-style/bulk-generate-sku-codes/

**Generate SKU Codes** in the Actions menu of the Styles list creates the SKU codes of every colour and size of the styles you select, using the SKU formula of your brand. It does in one run what the **SKU** tab of each style does one style at a time.

**Where to find it:** Collection & Styles → Styles → Actions → Generate SKU Codes

**Requires:** permission `UPDATE_STYLE`

## Before you start

- You need the **Update style** permission.
- Your brand needs a SKU formula. If it has none, the dialog says "This brand has no SKU formula yet. Set one up in Settings → Code Generator before generating codes in bulk." and **Generate** stays disabled. See [Code generator overview](https://docs.vestislabs.com/settings/code-generator-overview/).
- Only the styles on the page you are looking at are included. If you selected styles on other pages, the dialog tells you how many of them will not be included.

## Generate the codes

1. **Select the styles**
   Open the Styles list and tick the styles you want. Selecting several colours of one style counts as one style.

2. **Click "Generate SKU Codes"**
   Click **Actions**, then **Generate SKU Codes**. The dialog **Generate SKU codes for 12 styles** opens (the number is the count of styles you selected). The option is greyed out until at least one style is selected.

3. **Choose what to do with existing codes**
   Under **When a code already exists**, pick one of:
   - **Only fill in the gaps**: nothing already saved is touched.
   - **Also replace auto-generated codes**: manual codes are left alone.
   - **Replace every code**: including manual codes.

   Each option shows how many codes it would generate, and the summary at the top reads, for example, "24 SKU codes will be generated across 6 styles". Styles that have nothing to generate under the chosen option are dimmed with the reason: **No size range assigned**, **No active colors** or **Already has SKU codes**.

4. **Set the order (only when the formula counts up)**
   If the SKU formula contains a sequential number, the list is titled **Generation order** and the codes are numbered in that order. Drag a style by its handle, or use the sort list to pick **Selection order**, **Name A–Z** or **Style code**. If the formula has no sequential number, order cannot change any code and the list is titled **Selected styles** without handles.

5. **Click "Generate"**
   The dialog switches to a progress list that shows each style as **Waiting**, **Generating**, **Needs input**, **Done**, **Skipped** or **Failed**. Styles are processed one after the other.

6. **Answer the questions**
   When a style needs a decision, the run pauses on that style and asks inline:
   - **Which season should (style) use?** Select a season and click **Continue**. Asked when the formula uses the season and the style has more than one season, or when it needs a season the style does not have.
   - **Which material should (style) use?** Select a material and click **Continue**, or click **Continue without a material**. If the style has no style inputs, the question reads "(style) has no style inputs. Generate without a material?" with the button **Generate without material**.
   - **Which style code should (style) use?** Select one of the listed codes and click **Continue**. Asked when the sources of the style code disagree.

   Every question also has **Skip this style**, which leaves that style without new codes and moves on to the next.

7. **Stop if you need to**
   Click **Stop** to end the run. Styles that were not reached are counted as **Not run**. While the run is going or waiting for your answer, the close button is hidden and you cannot close the dialog by clicking outside it; use **Stop** or answer the question.

8. **Review the result**
   When the run ends, the dialog title is **Finished** and shows the counts **Generated**, **Skipped**, **Failed** and **Not run**, and how many SKUs were written. Styles that were skipped or failed are listed under **Needs attention** with the reason.

   Click **View codes** to open **Generated codes**: a table with **Style**, **Colour**, **Size** and **SKU code** for every code that was just created. Type in **Search styles, colours or codes** to filter it, and click **Copy** to copy the rows that are shown, with their style code, as tab-separated text you can paste into a spreadsheet. Click **Back to summary** to return, then **Close**.

> [!NOTE]
> The table lists only the codes created in this run, not codes that were left as they were.

## When something fails

A style that cannot be saved is marked **Failed** and the run carries on with the next style. Under **Needs attention**, its row shows the message of the error. If a style failed after it had been given code numbers, the summary adds "(number) code numbers were reserved for a style that failed and will not be reused, so the sequence will show a gap". If the code counters of your brand cannot be synced before the first style, the run stops at once and the summary shows "Could not sync the code counters" with the reason. Run **Generate SKU Codes** again for the styles marked **Failed**.

## Troubleshooting

**The Generate SKU Codes option is missing from the Actions menu.** You need the **Update style** permission, and the feature must be switched on for your brand. Ask your Brand Admin or contact support.

**Generate is disabled.** Your brand has no SKU formula yet. Set one up in the code generator settings.

## Related

- [SKU codes](https://docs.vestislabs.com/collection-style/style-production-sku/)
- [Style dashboard](https://docs.vestislabs.com/collection-style/style-dashboard/)
- [Code generator overview](https://docs.vestislabs.com/settings/code-generator-overview/)
