Parameters
Every element the encoder accepts, its cap, and its pattern.
Element identifiers
Values are uppercased before encoding. Lowercase input is accepted and normalised.
| ID | Label | Max | Pattern |
|---|---|---|---|
DAQ | License number | 25 | [A-Z0-9-] |
DCS | Family name | 40 | [A-Z0-9 '-] |
DAC | Given name | 40 | [A-Z0-9 '-] |
DAD | Middle name | 40 | [A-Z0-9 '-] |
DBB | Date of birth | 8 | CCYYMMDD in, MMDDYYYY wire |
DBA | Expiry | 8 | CCYYMMDD in, MMDDYYYY wire |
DBD | Issue date | 8 | CCYYMMDD in, MMDDYYYY wire |
DBC | Sex | 1 | 1 · 2 · 9 |
DAG | Street | 40 | [A-Z0-9 '.#-] |
DAH | County / line 2 | 25 | [A-Z '.-] |
DAI | City | 25 | [A-Z '.-] |
DAK | Postal code | 9 | 5 or 9 digits, space-filled to 11 |
DAU | Height | 10 | NNN IN · NNN CM |
DAW | Weight | 6 | NNN LB · NNN KG |
DAY | Eyes | 3 | enumerated |
DAZ | Hair | 3 | enumerated |
DCF | Discriminator | 25 | [A-Z0-9-] |
DCK | Inventory | 25 | [A-Z0-9-] |
DCA | Vehicle class | 4 | [A-Z0-9] |
DCB | Restrictions | 12 | [A-Z0-9 ] |
DCD | Endorsements | 12 | [A-Z0-9 ] |
DCG | Country | 3 | [A-Z]{3} |
DCI | Place of birth | 25 | [A-Z '.-] |
DCL | Race | 3 | [A-Z] |
Derived elements
DAJ is written from state and cannot be set directly. DDE, DDF and DDG are truncation flags emitted automatically when a name exceeds its cap.
Generated elements
DCF and DCK can be derived from the payload instead of copied from
the card. Send a generate object next to fields:
{
"state": "CA",
"generate": {"dd": true, "icn": true},
"fields": {"DAQ": "A1234567", "DCS": "SAMPLE", "DBB": "19900314"}
}
| Flag | Element | Output |
|---|---|---|
dd | DCF | 12 characters from A-Z 2-9, excluding I, O, 0 and 1 |
icn | DCK | 12 digits |
The 12-character shape applies to generated values only. A DCF supplied in
fields is written as provided, inside the element cap and pattern, because
real cards carry jurisdiction-specific shapes. Generation never rewrites an explicit
value.
Both are derived from DAQ + DBB + DCS, so the same three values always produce the
same DCF and DCK across requests and retries. An explicit DCF
or DCK in fields always wins and is never overwritten. Omitting
generate leaves both out of the subfile unless you supplied them.
Generated values are stable and repeatable, which makes them suitable for fixtures and test pipelines. They are not a substitute for the identifier printed on a real card.
Defaults for omitted required elements
Six elements in the v10 required set are often absent from older integrations. When a
field is missing or blank the encoder writes the value below. A supplied value always
wins, including 0 for DDK or DDL.
| Element | Default |
|---|---|
DBD issue date | today, written in the version's wire order |
DAY eyes | BRO |
DAU height | 069 IN |
DCG country | USA |
DDK organ donor | 0 |
DDL veteran | 0 |
These are placeholders, not facts about a cardholder. A production request should send the values printed on the credential.
Validation order
The encoder validates the jurisdiction first, then the required set, then every supplied value: length, pattern, enumeration and date. A missing required element and an unknown element are reported in the same pass, so a form can highlight all of them at once. Values that are not in the allowed set for the jurisdiction are ignored rather than encoded, which prevents an optional field from another state leaking into the subfile.
Patterns are anchored
Every pattern is a full match, not a search. ^[A-Z0-9-]+$ means the whole value
is letters, digits and hyphen with no spaces, no slashes and no trailing full stop. A
value that fails a pattern is rejected rather than cleaned up, because silently rewriting
a name or an address changes the credential.
Dates
Send CCYYMMDD, as in 19900314, or the wire order. Eight digits
beginning 19 or 20 are read as CCYYMMDD; any other
eight digits are read as MMDDYYYY. A correct date is never rejected for
being in the other order. Dates are validated against the real calendar:
19900231 is rejected and 19900228 is accepted, with leap years
handled. The wire order is not the input order. AAMVA v01 writes
CCYYMMDD; v02 and later, including the v10 this encoder targets, write
MMDDYYYY, so 19900314 is emitted as 03141990.
The version on the request drives the conversion, not a single global rule.
DAK is fixed-width on the wire. The encoder space-fills it to 11
characters on v10 and earlier, which is the CDS 2020 representation. Under CDS 2025
(v11) it narrows to nine and zero-fills the unknown trailing digits. A value already
at or over the width is written unchanged: the encoder never truncates a postal code.
T. The flag is the only signal a reader gets that the card name is longer than the symbol name.