---
id: "gs1_ai_21"
kind: "datatype"
status: "draft"
is_pii: false
categories: ["gs1", "objectids"]
langs: ["common"]
quality: 85
url: "http://registry.apicrafter.io/datatype/gs1_ai_21"
---

# Serial number (GS1 AI 21) (`gs1_ai_21`)

> **Draft.** Draft records have not been reviewed yet and may be incomplete or wrong; do not treat them as authoritative for legal or compliance decisions.

GS1 element string of Application Identifier (21): '21' followed by the serial number of one instance of a trade item, up to 20 characters of GS1 character set 82. GS1 format N2+X..20. With the GTIN in AI (01) it identifies one item, the serialised GTIN (SGTIN). It is a key qualifier in GS1 Digital Link. In the human-readable text under a barcode it is written as (21) and the value.

- Personal data (PII): no
- Categories: GS1 standards (gs1), Objects identifiers (objectids)
- Countries: global
- Languages: Common to most languages (common)
- Classification: identifier

## Detection

Regular expression (Python `re`):

```
^21[!%-?A-Z_a-z\x22]{1,20}$
```

## Examples

- `21SN58213X` — Serial number SN58213X
- `217XK29` — Serial number 7XK29
- `21AAAAAAAAAAAAAAAAAAAAA` (invalid example) — Serial number longer than 20 characters

## Mappings

- gs1_ai: `21`

## Sources

- doc: <https://ref.gs1.org/ai/21>
- wikipedia: <https://en.wikipedia.org/wiki/Serial_number>

## Quality

Score 85/100. Missing: translation, detector coverage.

JSON: <http://registry.apicrafter.io/api/v1/datatypes/gs1_ai_21.json> · Edit: <https://github.com/apicrafter/metacrafter-registry/edit/main/data/datatypes/any/gs1/gs1_ai_21.yaml>
