# Application Group 0x05 - PAN Messages

**Command 0x05::0x01 - Read PAN**

The host uses this command to retrieve the Primary Account Number (PAN) of the last card it successfully read, regardless of the interface used to read the card. Generally the host would use this command in solutions that use an external Encrypting PIN Pad (EPP), to retrieve the PAN and provide it to the EPP so it can create a PIN block.

For the host to successfully retrieve the plaintext PAN using this command, the device must have determined the card matched one or more entries in the device’s PAN Whitelist (see Command 0x03::0x80 - Read PAN Whitelist / Account Data Whitelist). If the card does not match an entry in the whitelist, the PAN will be available in encrypted form, but only if oDynamo is currently paired with a Cryptera EPP. The EPP decrypts the PAN and uses it to form the encrypted PIN block. Otherwise the device returns 0x0000 in parameter C4 to indicate the PAN is not available.

After successful return of the PAN to the host or a timeout, the device erases the PAN from memory. For MSR transactions, the timeout for the host to follow up with the device to retrieve the PAN is 3 seconds. Because EMV transactions may require more time for the cardholder and operator to complete, the timeout for EMV transactions is 255 seconds. If a timeout occurred, the device returns 0x0000 in parameter C4 to indicate the requested item is not available.

## Table - Message Structure for Command 0x05::0x01 - Read PAN

<table data-header-hidden><thead><tr><th width="73.3636474609375" valign="top"></th><th width="68.54541015625" valign="top"></th><th width="187.5455322265625" valign="top"></th><th></th></tr></thead><tbody><tr><td valign="top">Tag</td><td valign="top">Len</td><td valign="top">Value(s) / Description</td><td></td></tr><tr><td valign="top">C0</td><td valign="top">01</td><td valign="top">01</td><td>Message Type Data Object (Tag C0) = 0x01 Command</td></tr><tr><td valign="top">C1</td><td valign="top">01</td><td valign="top">05</td><td>Application ID Data Object (Tag C1) = 0x05 PAN Messages</td></tr><tr><td valign="top">C2</td><td valign="top">01</td><td valign="top">01</td><td>Command ID Data Object (Tag C2) = 0x01 Request PAN</td></tr></tbody></table>

## Table - Response to Command 0x05::0x01 - Read PAN

<table data-header-hidden><thead><tr><th width="75.18182373046875" valign="top"></th><th width="108.54547119140625" valign="top"></th><th valign="top"></th><th></th></tr></thead><tbody><tr><td valign="top">Tag</td><td valign="top">Len</td><td valign="top">Value(s) / Description</td><td></td></tr><tr><td valign="top">C0</td><td valign="top">01</td><td valign="top">02</td><td>Message Type Data Object (Tag C0) = 0x02 Response</td></tr><tr><td valign="top">C1</td><td valign="top">01</td><td valign="top">05</td><td>Application ID Data Object (Tag C1) = 0x05 PAN Messages</td></tr><tr><td valign="top">C2</td><td valign="top">01</td><td valign="top">01</td><td>Command ID Data Object (Tag C2) = 0x01 Request PAN</td></tr><tr><td valign="top">C3</td><td valign="top">01</td><td valign="top">00</td><td>Result Code Data Object (Tag C3) = 0x00 OK / Done or 0x11 = Timeout occurred.</td></tr><tr><td valign="top"><p> </p><p> </p><p> </p><p> </p><p> </p><p>C4</p></td><td valign="top"><p> </p><p> </p><p> </p><p> </p><p> </p><p>Calculated</p></td><td valign="top"><p>Byte 0 PAN Status</p><p>0x00 = PAN is not in PAN Whitelist, can not be transferred 0x01 = PAN is in PAN whitelist, full PAN is available</p><p>0x02 = PAN is in PAN whitelist, 12 digits of PAN are available 0x03 = PAN is encrypted for use with paired Cryptera EPP</p><p> </p><p>Byte 1 PAN Length</p><p> </p><p>Bytes 2..n PAN Value (if available)</p><p>If the PAN is encrypted, the value will be 16 bytes and can be used as the data portion of parameter P2 for the EPP command READPIN_EXT.</p></td><td></td></tr></tbody></table>


---

# Agent Instructions: 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:

```
GET https://developer.magtek.com/hardware/oem-readers-and-components/oem-readers/odynamo/documentation/programmers-manuals/programmers-manual-commands/command-set/application-group-0x05-pan-messages.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
