---
title: "How to Generate SKUs and Barcodes Automatically? Designing a Stock Code Scheme, Code Logic for Variant Products, Conflicts and Compatibility with Old Codes, Common Mistakes, Code Plan Generator and Checklist"
description: "How do you generate SKUs and barcodes automatically? Learn how to design a stock code pattern, how code logic works for products with variations, and common mistakes, with a code planning tool."
url: https://www.faprika.com/en/blog/how-to-generate-skus-and-barcodes-automatically
language: en
site: Faprika
---

# How to Generate SKUs and Barcodes Automatically? Designing a Stock Code Scheme, Code Logic for Variant Products, Conflicts and Compatibility with Old Codes, Common Mistakes, Code Plan Generator and Checklist

> How do you generate SKUs and barcodes automatically? Learn how to design a stock code pattern, how code logic works for products with variations, and common mistakes, with a code planning tool.

As a catalog grows, product codes become one of the quietest sources of problems. The person adding a new product types the stock code as it comes to mind, skips the barcode field or copies it from an old spreadsheet; three months later there are two products with the same code, a variation with no barcode at all and a code logic nobody can explain. In stock counts, marketplace matching and warehouse picking, these inconsistencies come back order after order.

This guide treats **automatic SKU and barcode generation** as a production routine: why you should generate automatically instead of typing by hand, how to use the buttons in Faprika, what to watch for if you are designing your own code pattern, how to structure codes for products with variations, how to avoid conflicts with legacy codes and which mistakes are the most common. There are also two small tools: a generator that produces a code plan for your catalog and an eight-point code pattern audit. We cover the concepts themselves in separate articles: [what a SKU is](https://www.faprika.com/en/blog/what-is-an-sku) and [what a barcode is](https://www.faprika.com/en/blog/what-is-barcode); here we assume you know the concepts and focus on production and workflow.

Key Takeaway

“Automatic code generation is not about writing codes faster; it is about taking the code out of one person's memory and handing it to a system. Once uniqueness, consistency and leaving no field empty are entrusted to the system, the team can focus on adding products; the one thing the system cannot generate is the pattern itself: you decide in advance what each code means, how variations are ordered and what happens to legacy codes.”

## What Is Automatic SKU and Barcode Generation?

Automatic SKU and barcode generation means the system generates a product's stock code (SKU) and barcode number instead of you typing them by hand. In Faprika, this is done with one click using the “Generate SKU” and “Generate Barcode” buttons on the product edit screen.

The two codes have different jobs. The SKU (stock code) is the internal code your business uses to identify a product and its variation; stock tracking, order processing and reporting rely on it. The barcode is the machine-readable number that identifies the product quickly and accurately with a scanner; it is used at the point of sale, in the warehouse, in counting and in the shipping process. One is a code a person can read and understand, the other is read by a device, and both must be unique per product. The buttons in the Faprika panel can be used both when adding a new product and when editing an existing one.

| Code | Who is it for? | Where is it used? | What to expect from automatic generation |
| --- | --- | --- | --- |
| SKU (stock code) | Internal to the business, read by people | Stock, orders, reports, marketplace matching | Unique, readable, fixed pattern |
| Barcode | Read by a device | Warehouse, counting, point of sale, labels | Unique, compatible with scanners, present on every sellable unit |

We recommend reading

What Is a SKU? How Do You Create a Stock Code (SKU)?

## Why Generate Stock Codes and Barcodes Automatically Instead of Entering Them by Hand?

Hand-entered codes repeat, stay empty and lose their pattern over time; automatic generation hands you a unique code ready on every new product. The difference is not felt in small catalogs; it becomes clear as the catalog grows and new people join the team.

In the tutorial's words, the feature provides time savings, fewer errors, efficiency, standardization, easy inventory management and a tidy appearance. Translated into daily work, they read like this:

- **Time:** thinking up a code, checking whether it was used before and typing it all disappear.
- **Errors:** human-caused problems such as typos, two similar-looking codes and the same number given to two products are reduced.
- **Consistency:** three different people do not write the code in three different ways; the list stays readable.
- **Completeness:** no product is left with an empty barcode field; warehouse and counting processes work on every product.
- **Reporting:** unique, orderly codes make stock counts and reports reliable.

| Topic | With hand entry | With automatic generation |
| --- | --- | --- |
| Uniqueness | Needs checking every time | A code that has not been used before is generated |
| Speed | Thinking and typing for each product | The field fills in with one click |
| Pattern | Varies by person | Every product comes from the same generation logic |
| Empty field | The barcode is often forgotten | Filled with one click on both new and incomplete products |
| Meaningful code | You can build any logic you want | The code's logic lives in the system that generates it |

The last row shows an important balance: automatic codes give you speed and uniqueness, but if you are building a meaningful code pattern yourself, that pattern has to be entered by hand or with a bulk operation. That is why we cover below which route to choose.

Tip

First decide “who generates the code?”

If one person in the team assigns codes by hand, the pattern ends when that person leaves. If the system generates them, the pattern stays in the system. Whichever you choose, write the decision in one sentence and share it with everyone who adds products.

## How Do You Generate SKUs and Barcodes Automatically in Faprika?

In Faprika, you open the product from Product Management under Catalog and click the “Generate SKU” button next to the Stock Code field and the “Generate Barcode” button next to the Barcode field; the system generates the codes and writes them into the fields, and you save the product.

*Görsel: Faprika panel Catalog, Product Management edit screen: the Stock Code and Barcode fields with the Generate SKU and Generate Barcode buttons next to them (The Generate SKU and Generate Barcode buttons on the product edit screen (values are examples))*

The steps follow the order in the tutorial. For a detailed screen walkthrough, see the [Automatic SKU and Barcode Generation tutorial](https://www.faprika.com/en/tutorials/automatic-sku-barcode).

1. **Log in to the admin panel:** select the Catalog tab from the left menu, then Product Management.
2. **Open the product:** click the name of an existing product or click the Add New Product button at the top right. There is a [tutorial on adding a new product](https://www.faprika.com/en/tutorials/add-new-product) from scratch.
3. **Click Generate SKU:** when you click the button next to the Stock Code field under the Product Information heading, the system generates a unique code that has not been used before and writes it into the field.
4. **Click Generate Barcode:** with the button next to the Barcode field, the system generates a unique, 10-digit barcode number and enters it into the field.
5. **Repeat for variations:** on the Product Variations tab, click the Edit button of each variation and use the same two buttons; each variation has its own SKU and barcode field.
6. **Save:** click the Save button at the bottom of the page. The code is not part of the product record until you save.

The SKU generated for the example product in the tutorial is a code made of hyphenated segments such as “KAD-25Y-SYH-9394”; the barcode example is a 10-digit number such as “1102608053”. These are only examples. The tutorial does not describe a setting that changes the rule the button uses to generate; the system determines the code's structure. So if you want a custom code logic, you manage it yourself by entering codes with the pattern described below.

Tip

Try it on a new product first

The tutorial does not separately describe how the button behaves with an existing code. Before changing a filled-in field, use the button on a new product as a trial, see the result and only then apply it to the existing catalog.

We recommend reading

What Is a Barcode? How Do You Get, Read and Use a Product Barcode in

E-Commerce

?

## How Do You Design a Good Code Pattern?

A good code pattern consists of codes that are readable, short, built in a fixed order and never reused. Constantly changing information (price, campaign, supplier name) is not put inside the code; the code is the product's identity, not its status.

If you use the code the system generates as it is, this section is a short check; if you are building your own pattern, it is a guide. The graphic below summarizes the anatomy of a segmented code and why each segment is there; the abbreviations are examples.

*Görsel: Code structure for automatic SKU generation: category abbreviation, sequence number and variation suffix segments (Structure of a segmented stock code (abbreviations are examples))*

### 1. Keep the code short and readable

For the person in the warehouse who reads the code aloud, writes it on a label by hand or reports it by phone, a short code lowers the margin for error. A very long code increases typos and does not fit on the label. Avoiding look-alike characters (zero and O, one and I) also keeps it readable.

### 2. Build the segments in a fixed order

In a segmented code, the order must never change: for example, category first, then sequence number, then variation suffix. The same product written in two different orders looks like two separate codes and splits across filters. Instead of changing the order later, get it right from the start.

### 3. Leave room in the sequence number

Plan the sequence number for the size your catalog will reach in the future, not its size today. Four digits allow up to 9,999 products; five digits allow ten times as many. The code plan generator below does this calculation for you.

### 4. Do not put changing information in the code

If you write information that changes over time, such as price, campaign name, supplier, or season, into the code, the code stays wrong once that information changes. Keep this kind of information as a product attribute, a tag, or a separate field; see the [product attributes](https://www.faprika.com/en/blog/what-are-product-attributes) article for product attributes.

### 5. Never reuse a code

Even if a product is removed from sale, do not give its code to another product. Past orders, return records, and reports are tied to the old code; assigning the same code to another product muddles that history. Once a code has been used, it belongs to that product.

| Principle | Good example | Example to avoid |
| --- | --- | --- |
| Short and readable | KAT-0001 | KATEGORI-ADI-TEDARIKCI-SEZON-RENK-BEDEN-ID |
| Fixed order | KAT-0001-02 | KAT-0001-02 and 02-KAT-0001 at the same time |
| Digit headroom | Four- or five-digit sequence | Just enough digits for today's product count |
| Information that does not change | Category + sequence | Writing price or campaign into the code |
| Single use | A removed product's code is retired | Giving an old code to a new product |

### Code plan generator

The tool below lets you try out the code layout you have in mind for a category and shows the first sample codes, the total number of codes, and whether the number of digits is enough. It generates sequential codes up to the third sample; Turkish characters in the category abbreviation are converted to plain letters. The result is based on the assumptions you enter and does not show the format of the code produced by the button in Faprika; it is meant to help you plan your own layout.

Code plan generator

Number of products in the category

Category abbreviation (3 letters)

Sequence number digits

Variations per product

Total number of codes in this category**750**

Code length (characters)**11**

First 3 sample codes**KAD-0001-01, KAD-0001-02, KAD-0001-03**

Sequence capacity (products)**9.999**

The number of digits is sufficient: the category uses only a small share of the capacity.

The variation suffix is set to 2 or 3 digits depending on the number of variations. The thresholds are only for readability and are not a standard.

Keep two points in mind when reading the tool. First, the total number of codes is the product count multiplied by the variation count; in categories with many variations, the number of codes grows quickly. Second, the capacity calculation only shows whether the sequence number will run out; whether the code is meaningful is a separate matter, and a code layout only works if the people using it can understand it.

Tip

Choose between a meaningful code and a meaningless code

A meaningful code (such as category + sequence) makes it easier for people to read; a meaningless, random code brings the risk of collision close to zero. Rather than mixing the two in one code, keep a code for people to read and a barcode for devices to read separate: let the SKU be readable and let the barcode simply be unique.

## How Do You Set Up SKUs and Barcodes for Products with Variations?

In a product with variations, each sellable variation carries its own SKU and barcode; the main product code stays shared and the variation suffix changes. In Faprika, variations have their own SKU and Barcode fields, and the automatic generation buttons also work per variation.

This takes as many codes as there are combinations of options such as size and color. A product with three colors and four sizes has twelve sellable combinations; if each is to be tracked with its own stock, twelve separate SKUs and twelve separate barcodes are needed. For what a variation is and how it is defined, see the [what is a product variant](https://www.faprika.com/en/blog/what-is-a-product-variant) article, and for the panel steps, see the [product variations tutorial](https://www.faprika.com/en/tutorials/product-variations).

1. **Save the main product first:** enter the product information and set the main product's Stock Code and Barcode fields.
2. **Define the variations:** enter the options in the Product Variations tab; decide in advance which combinations will actually be sold.
3. **Open each variation:** use the Edit button to enter the variation and click the Generate SKU and Generate Barcode buttons.
4. **Check the relationship with the main code:** if the system assigns the code automatically, see whether the variation codes have a readable relationship with the main product; if not, there must be another field (category, attribute) to total up per product in reports.
5. **Save and verify:** add a variation to the cart and check that the correct code appears in the order flow.

| Situation | Recommended code logic | Point to watch |
| --- | --- | --- |
| Size and color | Each combination gets its own SKU and barcode | Do not create codes for combinations that will not be sold |
| Single-option product | The main product code is enough; no variation suffix is needed | If options are added later, do not break the layout |
| Bundle and set | Gets its own SKU and barcode | Give it a code independent of its components; see the [product types](https://www.faprika.com/en/blog/what-are-product-types) article for product types |
| Multi-package | Single and multi-pack get separate codes | The same barcode is not used because contents and price differ |

We recommend reading

What Is a Product Variant?

## How Do You Manage Conflicts and Compatibility with Old Codes?

If the catalog was previously coded by hand, the safest approach is to start automatic generation on new products without touching existing codes. Changing old codes in bulk can break the link to order history, ERP records, and marketplace matches.

There are three separate situations, and each calls for a different decision. For new products, starting automatic generation is easy. For old products with an empty code, it is enough to run generation on those products and complete the records. For old products whose code is filled in but inconsistent, changing the code is a decision in itself: if a marketplace match, ERP, or accounting integration depends on the old code, changing it can make the product look like a new one. In that case, keeping the old code and applying the new layout only to new products is less risky.

*Görsel: Automatic SKU and barcode generation workflow: audit existing codes, define the pattern, generate on new products, repeat for variations, save and verify (Workflow for moving to automatic code generation)*

1. **Take stock of the current situation:** export the product list and count the empty, duplicate, and inconsistent codes. Empty codes are completed right away; duplicates are resolved first.
2. **Identify integration dependencies:** note which codes depend on matching on the marketplace, accounting, or ERP side. Before touching these codes, find out the impact on the other side.
3. **Decide:** put in writing whether automatic generation will apply only to new products, to empty ones as well, or to all of them.
4. **Test with a small group:** apply it to one category or a few products and make sure the order, stock, and integration flows are not disrupted.
5. **Roll out and document:** turn the decision and layout into a team rule so that everyone adding a new product follows the same steps.

If you need bulk operations for a large number of products, the [bulk product update](https://www.faprika.com/en/blog/how-to-do-a-bulk-product-update) article and the [bulk product update tutorial](https://www.faprika.com/en/tutorials/bulk-product-update) will guide you; before making code changes in bulk, keep an exported backup.

Tip

Do not delete the old code; leave a note

If you have to change a product's code, write the old code down somewhere (a notes field or a change list). Because past orders and ERP records will continue to refer to the old code, losing the mapping between the two leaves traces in reports.

## What Should You Watch for to Stay Compatible with Marketplaces and ERP?

Marketplace, ERP, and accounting integrations mostly match products by stock code or barcode. That is why it is a basic condition of integration that both codes are unique, stable, and filled in on every sellable unit.

Three points are especially important. First, once a code has been matched, it should not change; if the match relies on the code, changing it makes the product look like a separate record. Second, if your ERP and accounting software has code length or character restrictions, the code must fit those limits; find out the limits before the integration is set up. Third, the type of barcode: an internal number generated by the system works in the warehouse and in the store, but a registered product barcode (GTIN) may be needed to list the product with a marketplace or external catalogs. For your own brand or marketplace sales, a registered number is used; for another brand's product, the manufacturer's barcode is used. For details, see the “Can I generate barcodes for my own warehouse?” section of the [what is a barcode](https://www.faprika.com/en/blog/what-is-barcode) article.

| Situation | Which code? | Note |
| --- | --- | --- |
| Shelving, counting, and picking in the warehouse | The internal barcode generated by the system is enough | Specific to your business, does not travel outside |
| Listing products on a marketplace | A registered product barcode if needed | Check the marketplace's rule |
| Another brand's product | The manufacturer's barcode | No new number is generated |
| ERP and accounting matching | Unique and stable SKU | Find out the code length and character limit |

For syncing stock with marketplaces and the role of codes in this flow, there is the [marketplace stock synchronization](https://www.faprika.com/en/blog/how-to-synchronize-marketplace-stock) article, and for the journey of product data between systems, the [product data flow](https://www.faprika.com/en/blog/what-is-a-product-data-feed) article. The importance of the stock code on the marketplace side is also covered in the [stok kodunun önemi](https://www.faprika.com/blog/pazaryerleri-ve-e-ticaret-siteleri-icin-stok-kodunun-onemi) article.

We recommend reading

How to Do Marketplace Stock Synchronization

## Most Common Mistakes When Generating SKUs and Barcodes Automatically

Most mistakes come not from the generate button but from a layout left undecided: mixed code formats, variations without barcodes, overwritten old codes, and bulk operations that were never verified top this list.

1. **Using mixed formats:** coding some products by hand and some automatically and mixing the two in the same category. The list becomes unreadable.
2. **Skipping variations:** giving the main product a code and leaving variations empty; orders and counts work at the variation level.
3. **Changing filled codes in bulk:** overwriting old codes without checking integration dependencies.
4. **Forgetting to save:** not realizing that a code generated with the button is not permanent until the product is saved.
5. **Assuming an internal barcode is valid everywhere:** assuming a number that works in the warehouse is enough to list the product on a marketplace.
6. **Embedding changing information in the code:** writing the price, season, or campaign name into the code.
7. **Reusing a code:** giving a removed product's code to a new product.
8. **Not testing the label:** sticking the label on the box after printing the barcode number without trying it with a scanner.

Tip

The same two-minute check for every new product

After saving the new product, check that the Stock Code and Barcode fields are filled, that the variations are filled too, and that the barcode can be read with a scanner. This two-minute habit prevents hours of counting errors months later.

We recommend reading

How Do You Do a Stock Count?

## Code Layout Checklist

The eight items below are an audit to check before starting automatic generation and at regular intervals. The safest approach is not to run bulk operations until every item is ticked.

*Görsel: Code pattern checklist: who generates the code, fixed order, digit reserve, variation, legacy codes, integration, barcode type and verification (Eight checks for your code pattern)*

Code layout audit

Who or what will generate the code has been defined in writing

The order of code segments is fixed and documented

The sequence number has enough digit headroom for growth

Every sellable variation has its own SKU and barcode

It has been decided whether old, filled-in codes will be changed

The dependence of marketplace, accounting, and ERP matches on the codes has been checked

It is clear whether the barcode will be for internal use or a registered product barcode

After saving a new product, the codes and label were verified with a scanner

Items that apply**2 / 8**

The code layout does not seem settled yet. First clarify who will generate the code, the order, and the variation setup.

The basic decisions are in place but gaps remain. Complete the items on old codes, integration dependencies, and verification.

Your code layout is solid. Keep up the same discipline with every new product and every new category.

| Field | Check | Done? |
| --- | --- | --- |
| The manufacturer | Who or what generates the code is documented | Yes / No |
| Order | Segment order is fixed and documented | Yes / No |
| Digits | Enough digit headroom for growth | Yes / No |
| Variation | Every sellable variation has a SKU and barcode | Yes / No |
| Old codes | Decision made for filled-in codes | Yes / No |
| Integrations | Marketplace, accounting, and ERP dependencies checked | Yes / No |
| Barcode type | Internal use or registered product barcode is clear | Yes / No |
| Verification | Codes and label were tested with a scanner | Yes / No |

## When Is It Better to Enter the Code by Hand?

Entering the code by hand is better when it follows a meaningful layout or when a number from outside is mandatory; if the goal is simply to find a unique, filled-in code, automatic generation is enough.

For a product that carries a barcode assigned by its manufacturer, the system does not need to generate a new number; the existing barcode is entered. If your accounting or ERP software requires its own coding layout, the code must be entered according to that layout. For a product that already has a registered product barcode, do not replace its barcode with automatic generation. Beyond these cases, especially when adding many new products, the buttons save time and errors. If you like, use both approaches together: enter the existing code for products from outside sources and generate with the button for your own products; keep in writing which group follows which path.

## Automatic SKU and Barcode Generation with Faprika

In Faprika, under Catalog in Product Management, the Generate SKU and Generate Barcode buttons on the product edit screen work on new and existing products, and also on each variation's own edit screen.

The practical advantage is that the code is generated in the same place as the product information, on the same screen: you do not need to switch to a separate tool or spreadsheet while adding or editing the product. According to the tutorial, the system generates a SKU that has not been used before and a unique 10-digit barcode, so the uniqueness check is taken off your hands. For the panel usage steps, see the [Automatic SKU and Barcode Generation tutorial](https://www.faprika.com/en/tutorials/automatic-sku-barcode); for adding products, the [adding a new product tutorial](https://www.faprika.com/en/tutorials/add-new-product); and for the feature's availability by plan, the [e-commerce plans](https://www.faprika.com/en/pricing) page. If you would like to talk through how to apply it to your own catalog, you can contact our team.

## Frequently Asked Questions

**What is automatic SKU and barcode generation?**

It means the system generates a product's stock code and barcode number instead of you typing them by hand. In Faprika, you click the Generate SKU and Generate Barcode buttons on the product edit screen; the system fills the fields with unique codes.

**How do you generate a SKU automatically in Faprika?**

Open the product from Product Management under Catalog, click the Generate SKU button next to the Stock Code field under Product Information, and save the product. The system generates a unique code that has not been used before.

**How many digits does an automatically generated barcode have?**

According to the tutorial, the Generate Barcode button produces a unique, 10-digit barcode number. If you need a registered product barcode for marketplaces or external catalogs, remember that this is a separate matter.

**How do you generate SKUs and barcodes for products with variations?**

On the Product Variations tab, open each variation's Edit button and use the Generate SKU and Generate Barcode buttons. Because each variation has its own SKU and Barcode field, codes are generated per variation.

**Should the codes of existing products be changed?**

Generally no; if codes are tied to marketplace, accounting or ERP matching, changing them can make the product look like a new one. Use automatic generation on new products and empty codes, and change filled-in codes only once you know the impact.

**Is an automatically generated barcode valid on marketplaces?**

Not always. The internal number the system generates works in the warehouse and in the store; marketplaces may have different barcode rules and may ask for a registered product barcode. You need to check the rules of the marketplace you will sell on and, if necessary, enter the product's existing barcode.

Generate your product codes with the system, not by hand

When adding a new product in Faprika, generate the stock code and barcode with one click; manage your variations, stock, and integrations in an orderly way from a single panel. Let's plan your catalog together.

Request a Demo

#### You May Also Like

- [**What Is a SKU? How Is a Stock Code (SKU) Created?**](https://www.faprika.com/en/blog/what-is-an-sku)
- [**What Is a Barcode? How Do You Get a Product Barcode in E-Commerce?**](https://www.faprika.com/en/blog/what-is-barcode)
- [**What Is a Product Variant?**](https://www.faprika.com/en/blog/what-is-a-product-variant)
- [**How Do You Update Products in Bulk?**](https://www.faprika.com/en/blog/how-to-do-a-bulk-product-update)
