> 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/preliminary-documentation-scra-dynafamily-programmers-manual/preliminary-documentation-commands/preliminary-documentation-read-mobile-document-command-group-0x12nn/preliminary-documentation-0x1201-read-mobile-document.md).

# (Preliminary Documentation) 0x1201 - Read Mobile Document

The host uses this command to start a mobile document transaction.

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

{% stepper %}
{% step %}
The host composes a command request in the format below, and sends it to the device. It may cancel the transaction in process by calling <mark style="color:red;">**Command 0x1008 - Cancel Transaction**</mark>.
{% 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 %}

{% hint style="info" %}
**Note:** If the subscription is disabled, the device return a failure response with status code 0x1E.&#x20;
{% endhint %}

## Codes for Command 0x1201 - Read Mobile Document

<table><thead><tr><th width="235.3636474609375"></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 01</td><td>// command 0x1201</td></tr><tr><td>84 3F 12 01</td><td>// command payload</td></tr><tr><td>81 01 00</td><td>// timeout: 30 seconds</td></tr><tr><td>83 0C</td><td>// select bit mapped request items</td></tr><tr><td>00 00 00 00 00 00 00 CD</td><td>// ISO, Bit 0, 2, 3, 6, 7 are enabled</td></tr><tr><td>00 00 08 00</td><td>// AAMVA, Bit 11 is enabled</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>// BCR reader is enabled</td></tr><tr><td>A4 27</td><td>// audio cue options</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</td></tr><tr><td>84 08 01B8009603700096</td><td>// BLE Transfer complete/mDoc complete</td></tr><tr><td>85 08 012C009600960096</td><td>// mDL transaction error</td></tr></tbody></table>

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

<table data-header-hidden><thead><tr><th width="55"></th><th width="60"></th><th></th><th width="61"></th><th width="62"></th><th width="84"></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>81</td><td>01</td><td><p>This parameter select the namespace to operate.</p><p>·         0x00 = ISO 18013-5 and AAMVA.</p><p>·         0x01 = ISO 23220-4.</p><p>·         0x02 to 0xFF = Reserved.</p></td><td>B</td><td>R</td><td> </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><p>·         0x00 = No timeout</p><p>·         0x01 to 0xFF = 1 to 255 seconds</p></td><td>B</td><td>R</td><td> </td></tr><tr><td>83</td><td>0C</td><td><p>This parameter defines the 96 bits (12 bytes) of bit mapped request items. (Note: At least 1 valid bit shall be enabled, else return error status.)</p><p> </p><p>If the namespace of Tag 0x81 is 0x00, then V[0-B] bytes are:</p><p>·         V[0] – V[3],  Bit 63 – 32 for ISO 18013-5, Byte 7 – 4.</p><p>·         V[4] – V[7],  Bit 31 – 00 for ISO 18013-5, Byte 3 – 0.</p><p>·         V[8] – V[B], Bit 31 – 00 for AAMVA. Byte 3 – 0. </p><p> </p><p>If the namespace of Tag 0x81 is 0x01, then V[0-B] bytes are:</p><p>·         V[0] – V[3],  Bit 31 – 00 for ISO 23220-4, Byte 3 – 0.</p><p>·         V[4] – V[B], 8 bytes are Reserved.</p></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><p>·         0x00, security is disabled.</p><p>·         0x01, security is enabled.</p></td><td>B</td><td>R</td><td> </td></tr><tr><td>87</td><td>01</td><td>It defines the reader shall or shall not retain the <br>received data elements.<br>• 0x00, Shall not retain the data.<br>• 0x01, Shall retain the data</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><p>·         0x00 = Disabled</p><p>·         0x01 = Enabled</p></td><td>B</td><td>R</td><td> </td></tr><tr><td>/85</td><td>01</td><td><p>QR Code Mode</p><p>·         0x00 = Disabled</p><p>·         0x01 = Enabled</p><p>·         0x02 = Onboard BCR Disabled, BCR data from Tag 86</p></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>O/R</td><td> </td></tr><tr><td>A4</td><td>var</td><td>Audio Cue Options</td><td>T</td><td>R</td><td> </td></tr><tr><td>/81</td><td>01</td><td><p>Device Audio Mode</p><p>0x00 = disabled</p><p>0x01 = auto</p><p>0x02 = command, the following 4 TLVs are required if the </p><p>            value is 0x02</p><p> </p><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 · 0x0000..0x0031 (&#x3C; 50 Hz, Silent) · 0x0032 - Min (50 Hz)</p><p>Value / Description Typ Req · 0x0FA0 - Max (4000 Hz) · 0x0FA1..0xFFFF (> 4000 Hz, Error)</p><p>Byte 2-Byte3 – Duration of tone in units of 1 millisecond · 0x0001 – Min (1 ms) · 0xFFFF – Max (65535 ms)</p></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><p>mDL transaction error</p><p>2 set of data parameter for each tone as above</p></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/preliminary-documentation-scra-dynafamily-programmers-manual/preliminary-documentation-commands/preliminary-documentation-read-mobile-document-command-group-0x12nn/preliminary-documentation-0x1201-read-mobile-document.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.
