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

# (7/30/26 Draft Version) 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 %}

## Codes for Command 0x1201 - Read Mobile Document

{% code overflow="wrap" %}

```
AA 00                      	// marker
81 04 01 05 12 01          	// command 0x1201
84 43 12 01                	// command payload
81 01 00                   	// select name spaces, 0x00=ISO 18013-5 and AAMVA
82 01 1E                   	// timeout: 30 seconds
83 0C                      	// select bit mapped request items 
00 00 00 00 00 00 00 CD	    // ISO, Bit 0, 2, 3, 6, 7 are enabled
00 00 08 00                	// AAMVA, Bit 11 is enabled
85 01 00			              // Output Data security is disabled
87 01 00                    // Do not retain the received data  
A3 06                      	// reader options
83 01 01                   	// NFC reader is enabled 
85 01 01                   	// BCR reader is enabled
A4 1D				                // audio cue options
81 01 02			              // command mode
82 04 03B80040			        // Start engagement profile
83 08 01B8009603700096	    // Finish engagement profile
84 08 01B8009603700096	    // BLE Transfer complete/mDoc complete: we update the default tone         to this one 
85 08 012C009600960096       // mDL transaction error
```

{% endcode %}

## 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 3 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://developer.magtek.com/api-and-command-reference/7-30-26-draft-version-scra-dynafamily-programmers-manual/7-30-26-draft-version-commands/7-30-26-draft-version-read-mobile-document-command-group-0x12nn/7-30-26-draft-version-0x1201-read-mobile-document.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
