> 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/park-from-icloud.md).

# Park from iCloud

The iCloud-initiated parking workflow can be triggered by the user through one of the following 2 methods:

1. Signing into their iCloud account via iCloud.com.
2. Using the **Find My** application on another device that is logged in with the same Apple ID.

Initiating this workflow will result in the removal of all cards in the Wallet from the specified device.

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 iCloud initiated parking workflow:

1. **Card Removal**: The user initiates the removal of the cards from his device.
2. **Unlink Card**: Apple notifies D1 Transit platform that the user wants to remove the transit card from his device. Since it's CBT, a park session is started.
3. **Park Card**: Apple device connects to D1 Transit platform in order to read the content of the applet instance, so Transit Issuer can save the card state on backend side.

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

#### Card Removal <a href="#card-removal" id="card-removal"></a>

The user accesses to his iCloud account, he selects the device and press 'Erase Device'. Wallet will instruct Apple server to delete all cards from that device.

#### Unlink card <a href="#unlink-card" id="unlink-card"></a>

For each card, Apple initiates a managePass API call to D1 Transit platform with the action **unlink** to indicate the intention to delete the card.

#### Park card <a href="#park-card" id="park-card"></a>

In CBT ecosystems, the applet instance is not deleted rigth away. Device connects to D1 Transit platform in order to execute commands that can be used for reading and updating applet content.

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 park session.

Once the park session is completed, the applet instance is deleted from the device.

**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 delete the card may never reach the device. For example, the device may be in airplane mode. Therefore, it is strongly recommended to put the provisioned digital cards to deny list to prevent its use for transit.

Transit Issuer must ensure that the deny list has been fully propagated across all relevant readers before allowing the card to be provisioned on another device. This step is critical to prevent the same transit card from being used concurrently on multiple devices and avoiding potential misuse.

<figure><img src="/files/MS5w30Fl5jeHLJsNLSm2" 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/park-from-icloud.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.
