Identifiers: GTIN, SKU and What Identifies What
One product needs exactly one GS1 identifier: the GTIN. Where the connector finds it, why your SKU is a different thing, and how batch, serial and logistics-unit levels build on top.
One product, one GS1 identifier
Every integration project runs into the same confusion in its first week, and it is worth settling before anything is configured. The number your company uses to order, pick and invoice a product is usually a different number from the one the world uses to identify it. A product needs exactly one GS1 identifier, and that identifier is the GTIN. It identifies the model: the article as such, the thing a shopper would call "this shirt in size M, in blue". The individual garment on the shelf and the box it arrived in are identified at other levels, described further down.
If your master data calls this field EAN, nothing is missing. EAN and GTIN are the same key under two names: EAN is the older European term and GTIN the current global one, so a thirteen-digit EAN-13 is a GTIN-13. A GTIN written with fourteen digits is the same key padded on the left with a zero, so that all trade-item keys share one length.
How a GTIN is built
A GTIN has an internal structure of three parts, and reading them apart explains most of what the connector does with it:
9 5 2 1 2 3 4 0 0 0 1 2 9
└─── prefix ─┘ └─ item ─┘ └ check digit
reference
The GS1 Company Prefix (the base number) is licensed to one company and identifies it globally. The item reference is yours to assign: you decide that 00012 is the linen shirt, and nobody outside your company has a say in it. The final digit is a check digit computed from all the others, so that a mistyped key almost always shows up as invalid and very rarely points at somebody else's product by accident.
The digits alone do not show where the prefix ends. Company prefixes vary in length, and 9521234000129 could in principle carry a seven-digit or a nine-digit prefix. The boundary comes from the GS1 GCP Length Table, which the platform reads from the same openepcis-epc-digitallink-translator toolkit that supplies its identifier grammar. No connector reimplements the table or guesses the boundary.
9521234 is a test prefix. Every key printed on this page sits in the GS1 test range, the keys beginning 952…, which exist so that examples can be worked through without touching a licensed prefix. They are safe to copy into a sandbox and must never be printed on a package. Your own keys come from your own licensed prefix; see test prefixes.
The example is also chosen so that the split above is the real one: the GCP Length Table gives the entry 9521 a length of seven, so the prefix genuinely ends where the diagram shows it. An invented prefix usually lands on a different length, and the item reference then begins a digit earlier or later than intended.
The SKU is your own number
The SKU is the article number your company assigns for its own purposes. Your PIM or ERP stores its record under it, and your colleagues quote it on the phone. It has no GS1 meaning whatsoever, which is the part that surprises people. Sometimes a SKU happens to be a GTIN, because the business bought the goods with a manufacturer's EAN and adopted it as its own record key. Sometimes a SKU contains the item reference of the GTIN, because someone chose that numbering years ago. And in a great many companies the SKU is LIN-SHIRT-BLUE-M, an internal ordering scheme with a history of its own that is unrelated to any GS1 key.
The connector therefore makes no assumption about the SKU. Each adapter knows where its host system keeps the GS1 key, and the SKU's role is stated explicitly in the connection's configuration.
In UnoPim the SKU is the record's unique key and the PIM knows nothing of GS1, so a single option, source.options.gtin-from, decides everything. It takes one of three values:
composed, the default: the connector builds the GTIN itself from the company prefix configured as the connection'starget.gcp-prefixes, the SKU as the item reference, and the check digit, left-padding to twelve data digits.sku: the SKU is the complete GTIN. This is the right setting for traded goods that arrived with a foreign EAN, where composing would be wrong because the base number belongs to another company.- an attribute code, usually
dpp_gtin: the key lives in a field of its own. This is the setting for SKUs that are not numeric or not derived from the prefix.
Composing raises a question that a PIM forces on you: SKUs are unique, yet every batch of a product shares its model's GTIN. Under composed, the connector therefore reads only the part of the SKU in front of the first hyphen as the item reference. It always cuts at the first hyphen, so 95201-DE-L240815 also reduces to 95201, and 95201 and 95201-L240815 both compose the same key 9521234952015. The suffix only keeps the two records distinct in UnoPim. Which batch the second record stands for is stated in an attribute of its own, dpp_batch_identifier by default and configurable as source.options.batch-from, and the connector never parses it back out of the SKU. A record that carries a batch number is published only at its instance path, as an LGTIN, so batch master data can never overwrite the model record.
This splitting happens only in the UnoPim adapter and only under composed. Under sku and under an attribute code the value is taken as the key exactly as it stands, hyphens and all, and nothing is cut out of it. The other adapters read their key from a dedicated field and do no SKU arithmetic at all, so their batches are independent of how a SKU is written.
In ERPNext the key comes from the Item's barcodes child table. Rows are read in table order, and the first row with a GS1-family barcode_type whose value passes the check digit wins. A row with the right type and a broken check digit is skipped without failing the record, so one mistyped legacy barcode cannot hide a correct one below it. In metasfresh the GTIN lives in the product's ean field and a GLN in the gln of a business partner's locations; here, too, the first value that passes the check digit is used.
In Narravero the payload is open by design, so the connector tries a configurable list of payload paths in order (ids.ean, ids.gtin, ean and gtin by default) and takes the first value that passes the check digit. The identifiers an interface files for a record are merged in under ids first, so the connector reads the key Narravero itself knows before it falls back to a plain payload field; see the Narravero connector.
When there is no GTIN
A record without a publishable key is skipped, and only that record. The connector logs which record it was and what was wrong with the key, advances the cursor and carries on with the batch, so one unpublishable article cannot hold up the two hundred behind it. Under composed, UnoPim names a specific reason for each refusal: no SKU, no configured prefix, more than one prefix (the connector will not pick one for you), a non-numeric SKU, or a prefix and reference that together exceed the available digits.
A tenant licensed for several prefixes is a normal case. List them all as target.gcp-prefixes, keep the keys in the source system and point source.options.gtin-from at the attribute that holds them. Ownership is then decided across all listed prefixes; only composing requires a single one.
The connector does not create a first GTIN. In UnoPim, the plugin's panel offers a product without a key two equally prominent paths: draw the next number from your own prefix pool, or deposit a GTIN you already have. Both go through the platform. Drawing calls the bridge's POST /v1/identifiers/allocate. Depositing sends the typed number to the bridge first, and when the verdict reports a data problem, the number is refused in the bridge's own words. If the key sits on the tenant's own prefix and the connection composes, only the item reference is written into the SKU, so the product keeps a single place where its identity lives.
Model, batch, item, pallet
Once the model has its GTIN, every more specific level is that GTIN plus a qualifier. The rest of this chapter relies on the following vocabulary.
| Level | Key | Digital Link path | What the catalog holds |
|---|---|---|---|
| Model | GTIN | /01/{gtin} | The product record: name, brand, GPC, net content, measurements, images |
| Batch | LGTIN (GTIN + AI 10) | /01/{gtin}/10/{lot} | An instance document carrying hasBatchLotNumber |
| Item | SGTIN (GTIN + AI 21) | /01/{gtin}/21/{serial} | An instance document carrying hasSerialNumber |
| Logistics unit | SSCC (AI 00) | /00/{sscc} | Nothing; the SSCC is an event subject without a catalog record |
The GTIN carries everything said about the article in general, and it is the level at which registries ask their questions: brand name, GPC category and a product description are required of a model and never of a batch. It is also the only level a PIM contributes, because a PIM describes articles.
An LGTIN is a GTIN qualified by a batch or lot. Although it names something narrower, it is still a class, because a batch is a quantity of things. An EPCIS event therefore reports it as an epcClass in a quantityList and never in the epcList. Use it for what is true of a production run: a manufacturing date, a best-before date, a certificate.
The catalog stores each batch as its own instance document beneath the model's GTIN, with the qualifier stated inside the document as well as in the path. The resolver derives the per-instance anchor from that term in the document, and the anchor is what makes ?linkType=masterData stop at the batch without redirecting up to the model. The resolver merges linksets from the most specific anchor downwards, where a model-level entry would otherwise always win, so the Java connectors explicitly register a gs1:masterData link on the instance anchor after every instance write. Batches reach the catalog from ERPNext's Batch DocType, UnoPim's dpp_batch_identifier and Odoo's lots.
An SGTIN is a GTIN qualified by a serial number, and it is an individual thing, such as one battery or one appliance, so an event names it in the epcList. Use it wherever a warranty, a repair history or an individual passport has to attach to a single item. ERPNext feeds this level from its Serial No records, and Odoo from those stock.lot records whose product is tracked by unique serial number (the same record type yields a batch when the product is tracked by lot). A PIM does not feed this level, because a PIM has no serialised goods to describe. A record can also carry both qualifiers at once, which the catalog addresses as /01/{gtin}/10/{lot}/21/{serial}.
An SSCC identifies the logistics unit: this carton, this pallet, this roll cage. It is the one GS1 number a company always assigns entirely by itself, made up of an extension digit, your company prefix, a serial reference of your choosing and a check digit, eighteen digits in all. The SSCC identifies the packed unit and says nothing about its contents; the link between the two is made by an aggregation event whose parentID is the SSCC. Odoo mints an SSCC as soon as a package is created, so that even the earliest events concerning the package already have something to name it by.
One more point saves an afternoon of confusion: a serial number that was never registered as its own document still resolves. The resolver walks up to the nearest level it knows and serves the model's links, so an unregistered item behaves like its model and keeps resolving.
Check digit and verdict
The check digit is the cheapest correctness test there is, and the connectors apply it wherever a key enters the system. The rightmost data digit is weighted three, the weights alternate moving leftwards, the weighted digits are summed, and the check digit is the number that brings that sum up to a multiple of ten. 952123400012 gives 9, so 9521234000129 is a well-formed key and 9521234000123 is not.
That arithmetic is one of several statements the bridge makes about an identifier. When an adapter asks the bridge to resolve a key, the answer is a verdict made up of separately meaningful parts: whether the value matches the grammar of its Application Identifier, whether the check digit agrees, where the company prefix ends, whether that prefix is yours, how far the Verified by GS1 lookup got, who GS1 says licenses the key, and the canonical Digital Link that all of this adds up to. Every offline statement (syntax, check digit, prefix boundary, canonical link) is computed before anything can fail, so it stands even on a call where the registry never answered.
Read the verdict's reason before its booleans. A verdict sets dataProblem only when a person editing the record can actually fix what is wrong. An unreachable registry, an expired credential or a spent quota make the verdict degraded and say nothing against the data. A user interface that shows "invalid" after an unfinished registry lookup would accuse your colleagues of bad data every time a token expires, which is why the connectors branch on dataProblem and never on the registry status.
Own prefix, foreign prefix
Besides marking where the number ends, the prefix boundary answers a second question: whether the key sits inside a prefix your tenant is licensed for. own_prefix means it does: you issued this key, and no external lookup is needed to know who it belongs to. foreign_prefix means the key is perfectly valid but belongs to somebody else, which is the normal state of a supplier's article in your catalogue. In that case a registry call is worth making, because only GS1 can say who the licensee is. unknown means no prefix boundary could be established at all, so ownership cannot be decided and nothing should be concluded from it.
Ownership has practical consequences beyond display. It decides whether a lookup happens at all, and it decides commissioning: unless a product explicitly says otherwise, the connector mints an EPCIS commissioning event only for keys on a prefix the tenant is licensed for. A connector should never announce on your behalf that you brought a supplier's article into existence.