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