> For the complete documentation index, see [llms.txt](https://developer.magtek.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.magtek.com/api-and-command-reference/dynafamily-programmers-manual/commands/0x12nn-read-mobile-document/0x1202-age-verification-for-iso-18013-5.md).

# 0x1202 - Age Verification for ISO 18013-5

The host uses this command to start Age Verification through mobile document transaction.

The sequence of events for transactions with device (mDOC Reader) enabled is roughly as follows.

{% stepper %}
{% step %}
**Command 0x1202** is a subset of[ <mark style="color:red;">**Command 0x1201**</mark>](https://developer.magtek.com/api-and-command-reference/preliminary-documentation-scra-dynafamily-programmers-manual/preliminary-documentation-commands/preliminary-documentation-read-mobile-document-command-group-0x12nn/preliminary-documentation-0x1201-read-mobile-document).  It only allows a request item, Age over 18, 21 or 25. It only supports ISO 18013-5 specification. The rest of the features are the same.
{% endstep %}

{% step %}
The device sends a response in the format below, and waits for the mDOC Holder (Apple, Android or other phones) to present a Data Engagement method, either QR Code or NFC. The data exchanged during the Data Engagement phase will be used to generate multiple keys for the encryption/decryption of mDOC messages. The ephemeral key generation algorith is defined in ISO-IEC-18013-5.
{% endstep %}

{% step %}
After the mDOC Holder presents data engagement method, the device sends <mark style="color:red;">**Notification 0x0101 - Transaction Information Update**</mark> to report the Data Engagement status. If Data Engagement phase has completed successfully, then go to the next step to handle Data Retrieval phase. Else, exit with failure.
{% endstep %}

{% step %}
The device will connect to the mDOC holder through BLE connection. The device will build the “mdoc request” message based on the settings of the command string below. The mDOC Holder will send back the “mdoc response" to the device. The device will decode the CBOR encoded response message.
{% endstep %}

{% step %}
The device will authenticate the “mdoc response" message with a pre-loaded certificate. The device will verify the SHA-256 hash of all the response items to validate the Data integrity. If the security validation has completed successfully, the device will send the results to the host through <mark style="color:red;">**Notification 0x0101**</mark>. Otherwise, the device will send a failure message through <mark style="color:red;">**Notification 0x0101**</mark>.
{% endstep %}

{% step %}
Host may set up the A4 TLVs to enable/disable/select the proper Audio Cue during operation.
{% endstep %}
{% endstepper %}

## Codes for Command 0x1201 - Read Mobile Document

<table><thead><tr><th width="256.27276611328125"></th><th></th></tr></thead><tbody><tr><td><strong>Code</strong></td><td><strong>Description</strong></td></tr><tr><td>AA 00</td><td>// marker</td></tr><tr><td>81 04 01 05 12 02</td><td>// command 0x1202</td></tr><tr><td>84 32 12 02</td><td>// command payload</td></tr><tr><td>82 01 1E</td><td>// timeout: 30 seconds</td></tr><tr><td>85 01 00</td><td>// Output Data security is disabled</td></tr><tr><td>87 01 00</td><td>// Do not retain the received data</td></tr><tr><td>A3 06</td><td>// reader options</td></tr><tr><td>83 01 01</td><td>// NFC reader is enabled</td></tr><tr><td>85 01 01</td><td>// BCR reader is enabled</td></tr><tr><td>A4 1D</td><td>// audio cue option</td></tr><tr><td>81 01 02</td><td>// command mode</td></tr><tr><td>82 04 03B80040</td><td>// Start engagement profile</td></tr><tr><td>83 08 01B8009603700096</td><td>// Finish engagement profile</td></tr><tr><td>84 08 0370009600C80096</td><td>// BLE transfer complete profile</td></tr></tbody></table>

### Subscription Requirement

This command requires AC3 firmware or later. During the introductory preview, it runs without a subscription. After the preview ends, it runs only when the device holds an active mDoc subscription (**1.2.9.1.1.1 - Mobile Document Subscription**). Without one, the device does not start the transaction. See **1.2.9.nnn - Enable Mobile Document Features** for details.

Because this command requests only the age-over element, the host can complete an age check without receiving the holder's name, birth date, or other identifying data.

## Request Data for Command 0x1201 - Read Mobile Document

<table data-header-hidden><thead><tr><th width="54"></th><th width="53"></th><th></th><th width="53"></th><th width="59"></th><th width="83"></th></tr></thead><tbody><tr><td>Tag</td><td>Len</td><td>Value / Description</td><td>Typ</td><td>Req</td><td>Default</td></tr><tr><td>82</td><td>01</td><td><p>This parameter defines how long the device waits for the completion of this command..</p><ul><li>0x00 = No timeout</li><li>0x01 to 0xFF = 1 to 255 seconds</li></ul></td><td>B</td><td>R</td><td> </td></tr><tr><td>83</td><td>01</td><td><p>This parameter defines the options of age verification.</p><ul><li>1=18, 2=21, 3=25 years old.</li><li>00, 04-FF:  Reserved</li></ul></td><td>B</td><td>R</td><td> </td></tr><tr><td>85</td><td>01</td><td><p>It defines the security of the Data Container. If security is enabled, Data Container will be Encrypted and MACed.</p><ul><li>0x00, security is disabled.</li><li>0x01, security is enabled.</li></ul></td><td>B</td><td>R</td><td> </td></tr><tr><td>87</td><td>01</td><td><p>It defines the reader shall or shall not retain the<br>received data elements.</p><ul><li>0x00, Shall not retain the data.</li><li>0x01, Shall retain the data.</li></ul></td><td>B</td><td>R</td><td></td></tr><tr><td>A3</td><td>06</td><td><p>Device Engagement Phase Options</p><p>The parameters inside this TLV data object allow the host to enable and disable the various interfaces to start engagement.</p></td><td>T</td><td>R</td><td> </td></tr><tr><td>/83</td><td>01</td><td><p>NFC Mode</p><ul><li>0x00 = Disabled</li><li>0x01 = Enabled</li></ul></td><td>B</td><td>R</td><td> </td></tr><tr><td>/85</td><td>01</td><td><p>QR Code Mode</p><ul><li>0x00 = Disabled</li><li>0x01 = Enabled</li><li>0x02 = Onboard BCR Disabled, BCR data from Tag 86</li></ul></td><td>B</td><td>R</td><td> </td></tr><tr><td>86</td><td>var</td><td>BCR data (optional / required if Tag 85 is 02)</td><td>B</td><td>0/R</td><td> </td></tr><tr><td>A4</td><td>var</td><td>Audio Cue option</td><td>T</td><td>R</td><td> </td></tr><tr><td>/81</td><td>01</td><td><p>Device Audio Mode</p><ul><li>0x00 = disabled</li><li>0x01 = auto</li><li>0x02 = command, the following 4 TLVs are required if the value is 0x02</li></ul><p>If set to 0x01 auto mode. The tone profiles are:</p><p>03B80040                      // Start engagement</p><p>01B8009603700096      // Finish engagement</p><p>01B8009603700096      //BLE/mDoc Transfer complete</p><p>012C009600960096      // mDL transaction error</p></td><td>B</td><td>R</td><td> </td></tr><tr><td>/82</td><td>04</td><td><p>Start engagement profile</p><p>4 bytes data parameter for each tone in the sequence</p><p>Byte0-Byte1 – Frequency in units of 1 Hz </p><ul><li>0x0000..0x0031 (&#x3C; 50 Hz, Silent) </li><li>0x0032 - Min (50 Hz)</li></ul><p>Value / Description Typ Req </p><ul><li>0x0FA0 - Max (4000 Hz) </li><li>0x0FA1..0xFFFF (> 4000 Hz, Error)</li></ul><p>Byte 2-Byte3 – Duration of tone in units of 1 millisecond </p><ul><li>0x0001 – Min (1 ms) </li><li>0xFFFF – Max (65535 ms)</li></ul></td><td>B</td><td>O/R</td><td> </td></tr><tr><td>/83</td><td>08</td><td><p>Finish engagement profile</p><p>2 set of data parameter for each tone as above</p></td><td>B</td><td>O/R</td><td> </td></tr><tr><td>/84</td><td>08</td><td><p>BLE transfer complete profile</p><p>2 set of data parameter for each tone as above</p></td><td>B</td><td>O/R</td><td> </td></tr><tr><td>/85</td><td>08</td><td>mDL transaction error<br>2 set of data parameter for each tone as above</td><td>B</td><td>O/R</td><td></td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developer.magtek.com/api-and-command-reference/dynafamily-programmers-manual/commands/0x12nn-read-mobile-document/0x1202-age-verification-for-iso-18013-5.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
