> For the complete documentation index, see [llms.txt](https://docs.payments.thalescloud.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.payments.thalescloud.io/transit-digitization/implement-apple-transit/card-based-ticketing-cbt/lifecycle-management/read-applet-data.md).

# Read Applet Data

The Read Applet Data use case can be triggered by Transit Issuer when there is a need for the Back Office to read the last known state of the applet data.

This section provides an overview of the workflow, including detailed steps, sequence diagrams, and potential error scenarios.

### Workflow <a href="#workflow" id="workflow"></a>

Below are the high level steps of the read applet data workflow:

1. **Read Applet Data session triggering**: Transit issuer initiates the read of the applet data.
2. **Read Applet Data execution**: D1 Transit notifies the device through APNS that it needs to connect to D1 Transit platform in order to execute the Transit Issuer commands.

### Sequence diagram <a href="#sequence-diagram" id="sequence-diagram"></a>

#### Read Applet Data session triggering <a href="#read-applet-data-session-triggering" id="read-applet-data-session-triggering"></a>

The Transit issuer instructs D1 Transit through handleEvent to start a session with the targeted device for reading the digital card applet data.

#### Read Applet Data execution <a href="#read-applet-data-execution" id="read-applet-data-execution"></a>

Once device is online, it will connect to D1 Transit server with a get pending commands request. D1 Transit sends **getDigitalCardBundleCommands** to Transit Issuer to fetch the commands that shall be returned and executed on device side.

Several round trips may occur to complete the read session.

At the end of the read session, D1 Transit sends a retrieve bundle data notification to Transit Issuer.

**Error Scenarios**

**Device Offline**

As the request is not device-initiated, there is no certainty that the device will be online. In such cases, the request to read applet data may never reach the device.

<figure><img src="https://1928701359-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZoFRCpZeaDWwcHYhJY7B%2Fuploads%2FBwtIj3fLEavRiYbdLeYj%2FSequence%20Diagram%20%E2%80%93%20Read%20Applet%20Data.svg?alt=media&amp;token=0f21ca6c-b84c-4ddf-b201-40dc41ae33a5" alt=""><figcaption></figcaption></figure>


---

# 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://docs.payments.thalescloud.io/transit-digitization/implement-apple-transit/card-based-ticketing-cbt/lifecycle-management/read-applet-data.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.
