DEV Community

Flowup Insights Team
Flowup Insights Team

Posted on

Build a Product Master Sheet Before a Thai Distributor Asks: Barcodes, Case Codes and Check Digits for 7-Eleven

When a brand gets close to a 7-Eleven (7-11) listing in Thailand, the distributor sends a product data form. Brands that keep product facts scattered across artwork files, factory specs and email threads lose days answering it, and sometimes find a missing barcode after packaging has already been printed.

This post sets out a small method: one master sheet, one row per sellable unit and per shipping case, plus a check-digit function so errors are caught before anyone types them into a retailer's system. The business background on barcodes in Thai modern trade is here: https://www.flowupth.com/en/insights/barcode-before-modern-trade?utm_source=devto&utm_campaign=P494

1. Decide what a "row" is

The most common mistake is one row per product name. Barcodes don't follow names; they follow sellable units.

Give a unit its own row (and its own number) when any of these differ:

  • size or net content
  • flavour or variant
  • pack type (sachet, bottle, box)
  • shipping case quantity (a case of 12 and a case of 24 are different items)

A simple rule for the sheet: if a store scanner or a warehouse would need to tell two things apart, they are two rows.

2. The columns

Keep it boring and complete. A workable starting set:

Column Notes
row_type unit or case
parent_unit for cases, the unit row they contain
name_th / name_en the exact names that will appear on the label
variant flavour, colour, size wording
gtin 13 digits for units in Thailand (EAN-13)
case_code for case rows
units_per_case integer
net_content with unit of measure
dims_mm / weight_g unit and case, measured, not from the drawing
shelf_life_days from production
fda_status registration status for the category
artwork_version the file that carries this barcode
artwork_sent_to_print date, empty until it happens

The last two columns matter more than they look. They let you see, at a glance, whether any artwork has gone to print with a number that is not yet assigned.

3. Where the numbers come from

In Thailand, brands obtain GTIN numbers through GS1 Thailand, and Thai-issued numbers start with the prefix 885. The application needs company documents, and the numbers are then assigned per product in GS1's member system. Check GS1 Thailand's own pages for current documents and fees; they can change.

Two planning points for the sheet:

  • Count before you apply. Every unit row and case row needs a number. Leave room for products you already know are coming.
  • Imported goods: if the product already has a home-country barcode, record it in gtin and add a gtin_owner column. Whether it can be used in Thailand is a question for the distributor and the brand owner, not something to assume.

4. Case codes

A shipping case is not scanned at the till, but warehouses and distribution centres need to identify it. GS1's approach for a case of identical units is to take the unit number without its check digit, put a packaging-level indicator digit in front, and calculate a new check digit for the resulting 14-digit code. Use different indicator digits for different case quantities.

Confirm the exact case format your distributor expects before printing outer cartons.

5. Validate check digits in code

A typo in one digit can produce a number that looks fine and points to nothing. The GS1 check digit catches most of these. The rule is the same for 13- and 14-digit codes: starting from the digit just left of the check digit and moving left, multiply digits alternately by 3 and 1, sum them, and the check digit is whatever brings the sum up to the next multiple of 10.

def gs1_check_digit(body: str) -> int:
    """body = all digits except the final check digit"""
    total = 0
    for i, ch in enumerate(reversed(body)):
        total += int(ch) * (3 if i % 2 == 0 else 1)
    return (10 - total % 10) % 10

def is_valid_gs1(code: str) -> bool:
    return code.isdigit() and int(code[-1]) == gs1_check_digit(code[:-1])
Enter fullscreen mode Exit fullscreen mode

Example only, with made-up digits that are not a real product: for the 12-digit body 885000012345, the function returns 0, so the full number would be 8850000123450.

Run is_valid_gs1 over the gtin and case_code columns every time the sheet changes. In a spreadsheet you can do the same with a helper column, but code is easier to keep correct.

6. Checks before anything goes to print

Add three automatic flags:

  1. Duplicate numbers. Two rows with the same GTIN is almost always a copy-paste error.
  2. Missing numbers on printed artwork. artwork_sent_to_print filled and gtin empty is the expensive one: stickers or a reprint.
  3. Case rows without a parent. A case code with no unit row means someone added a carton format nobody documented.

A pandas version is a few lines:

import pandas as pd
df = pd.read_csv("product_master.csv", dtype=str)
dupes = df[df.duplicated("gtin", keep=False) & df.gtin.notna()]
unprinted_risk = df[df.artwork_sent_to_print.notna() & df.gtin.isna()]
orphans = df[(df.row_type == "case") & ~df.parent_unit.isin(df.gtin)]
Enter fullscreen mode Exit fullscreen mode

7. Why bother

None of this is clever. The point is sequencing: number assignment and validation happen before artwork is final, and the distributor receives a sheet that answers their form instead of a folder of PDFs. In our work at Flowup Thailand, missing or late product data is one of the quieter reasons a listing timeline slips, and it is entirely within the brand's control.

Limits: each chain's exact data requirements are not published, so treat these columns as a starting point and extend them with whatever your distributor's form asks for.


Written by the Flowup Thailand team (flowupth.com), which helps brands grow sales through 7-Eleven Thailand and TikTok Shop.

Top comments (0)