Start free
2D barcodes at point of sale

Batch, serial number and expiry date inside a 2D barcode.

A linear barcode carries one thing: the product's GTIN. A GS1 Digital Link QR code can carry the GTIN and the batch, the serial number and the expiry date of the pack in your hand. This page shows exactly how those values are written, what reads them, and how PaqLink handles them.

Last reviewed · Sources

The four values and where each one goes

GS1 calls each kind of value an application identifier (AI) and gives it a number. These are the ones PaqLink encodes.

ValueAIFormatPlace in the addressExample
GTIN (always present)0114 digits, zero-padded, check digit verifiedPath/01/09506000134352
Batch or lot10Up to 20 characters from the GS1 character setPath, after the GTIN/10/LOT42
Serial number21Up to 20 characters from the GS1 character setPath, after the batch/21/000123
Expiry or use-by date17Six digits, YYMMDD, checked as a real dateQuery string?17=271231

Best before or use by: AI 15 and AI 17

GS1 keeps the two dates apart, and food law treats them differently. AI 17 is the expiry or use-by date: the day after which the product should not be sold or used. AI 15 is the best-before date: the day until which the product is at its best. PaqLink encodes AI 17, and a hosted product page labels it "Expiry date". It never presents an AI 17 date as a best-before date. To see how any date in a link is read, paste the link into the GS1 Digital Link checker.

A worked example

A pack of the sample product, from lot LOT42, serial 000123, with an expiry date of 31 December 2027:

https://paqlink.com/01/09506000134352/10/LOT42/21/000123?17=271231
application identifiervalue

The order is fixed by the standard: GTIN, then batch, then serial in the path, and the expiry date after the question mark. PaqLink writes them in that order and refuses values that do not fit the format, so a mistake is caught before it reaches your artwork.

The GTIN is GS1's own sample number. Paste the address into the checker to see what a till would read from it.

Who reads what

  • A 2D retail scanner. Scanners that understand GS1 Digital Link read the GTIN, batch, serial and expiry out of the address as separate values, the way they would from a traditional GS1 barcode.
  • A phone camera. It opens the address. The resolver finds the product and redirects, passing the expiry date on to the page.
  • The product page. A hosted product page shows the expiry date from the scanned code and flags an item that is past it.
  • The resolver. It walks up from batch to product, so one product record serves every batch. You do not register each lot.

Where Sunrise 2027 fits in

Sunrise 2027 is a GS1-coordinated industry goal: retail point-of-sale systems worldwide should be able to scan 2D barcodes by the end of 2027. It is voluntary, it is not a law, and it does not remove the linear barcode, which stays on the pack during the transition.

What it changes is what a barcode can say at the till. Once a scanner reads a 2D code, the batch and the expiry date are available at the moment of sale, not only the product number.

Sunrise 2027, explained has the dates that carry legal weight and the position in South Africa.

Before you print variable data

  • Each batch is a different symbol. A code with a batch or expiry in it changes from run to run, so it has to be generated per run, not once for the life of the artwork.
  • Keep the linear barcode. Print the 2D code beside the EAN or UPC.
  • Stay inside the size window. Exports keep the module size within the GS1 range for retail scanning and include the quiet zone. Print-ready QR codes.
  • Test the scanners that matter. The free scanner test tells you whether a till reads 2D codes.
  • Automate it if you print often. Products, their batch and expiry values and their QR images are available through the API.

Sources

Last reviewed by the PaqLink team. Each source below was opened and read on the date shown. Rules and fees change, so check the source before you rely on a figure.

  1. GS1 Barcode Syntax Dictionary, release 2026-01-27 (AI 15 is best before, AI 17 is use by or expiry). Checked 18 November 2026.
  2. GS1 Digital Link standard: URI syntax, release 1.7.0 (August 2026). Checked 18 November 2026.
  3. GS1, 2D Barcodes at Retail Point-of-Sale Implementation Guideline, release 1.1.0 (December 2025). Checked 18 November 2026.

Questions about batch and expiry in 2D barcodes

Is putting batch and expiry in a 2D barcode a legal requirement?

For general consumer goods, no. Sunrise 2027 is a voluntary GS1 industry milestone, not a law. Some sectors do have dated rules of their own. Sunrise 2027, explained lists the ones we track.

Do I need a separate product record for every batch?

No. The resolver walks up from the batch to the product: a scan of a batch-specific code resolves to the one product record and passes the expiry date on to the page it opens.

What does a shopper see when they scan a code with an expiry date?

A hosted product page shows the expiry date from the code that was scanned, not the date of the latest production run, and flags an item that is past it.

Can every till read these codes today?

No. It depends on the scanner and its software. Our free scanner test shows in seconds whether a till or handheld scanner reads 2D codes and how it handles GS1 Digital Link.

Do I keep my linear barcode?

Yes. Print the 2D code beside the EAN or UPC barcode. The linear barcode stays on the pack throughout the transition.

How is the expiry date written?

As six digits, year, month, day (YYMMDD), under application identifier 17, which GS1 defines as the expiry or use-by date. 31 December 2027 is written 271231. PaqLink checks that it is a real date before the code is made. A best-before date is a different field, application identifier 15.

Related: the hosted GS1 Digital Link resolver, recall notices by QR code and the help article on lot, serial and expiry.

One code for the till, the shopper and the batch.

Batch, serial and expiry are included on every plan.

Start free