> 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/ja/apple-transit-wosuru/akauntobsunochikettingu-abt/raifusaikuru/kdoakauntowokyanseru.md).

# カードアカウントをキャンセル

The cancel card account workflow is triggered by Transit Issuer when the card account is cancelled (for example end user closed it)

Once a card account is cancelled, it's not possible to provision digital cards linked to it onto devices anymore.

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

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

This workflow is very similar to **Park From Transit Issuer** use case.

Below are the high level steps of the cancel card account workflow:

1. **Card Account Cancellation**: Transit issuer initiates the cancellation of the user's card account.
2. **Unlink Card**: If a digital card linked to the card account is provisioned into a user's device, D1 Transit notifies Apple that it needs to be removed.
3. **Unlink Outcome**: Apple sends a notification to D1 Transit with the outcome of the unlink workflow.

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

#### Card Account Cancellation <a href="#card-account-cancellation" id="card-account-cancellation"></a>

The Transit issuer instructs D1 Transit to cancel the specified card account.

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

If a digital card exists in user's device, D1 Transit will notify Apple server to delete it. Upon receiving a request from D1 Transit to delete card from a device, Apple server will initiate a removal of the associated pass.

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

After the unlink process is completed on the Apple side, an eventNotification is sent to D1 Transit, providing the outcome of the workflow.

D1 Transit will notify Transit Issuer about the digital card deletion outcome.

**Error Scenarios**

**Unlink Failed**

If unlink is unsuccessful, Apple informs D1 Transit via an eventNotification with the eventType parameter set to lifeCycleOutcomeFailure. The Transit Issuer can attempt to retry the process.

**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.

**No notification from Apple**

If D1 Transit platform does not receive an eventNotification within a defined timeout period after the managePass request, a getStatus request will be sent to verify the state of the provisioning bundle.

* If the response indicates an active state, unlink is incomplete. D1 platform notifies the Transit Issuer.
* If the response header contains an HTTP 404 status code, it confirms that the card has been successfully deleted and no longer exists on Apple servers, i.e. unlink was successful.

In both cases, it should not be possible to provision the card anymore.

**Delayed Event Notification request from Apple**

If D1 Transit platform receives an eventNotification from Apple after the predefined timeout period (e.g. the device comes back online after an extended period), D1 Transit deletes the digital card from its system and notifies the Transit Issuer that the unlink was successful.

<figure><img src="broken://spaces/SokLBgfEhZisVFcUdPiW/files/Yvf8IorWU6uYcXSEJkmI" alt=""><figcaption></figcaption></figure>

> In order to have an effective cancellation on Apple side, i.e. card account is fully unlinked from icloud account, Apple needs to send a get status (referenceIdentifier), so D1 Transit can return "cancelled" value in the response.
>
> The get status request from Apple cannot be triggered by D1 Transit platform.


---

# 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/ja/apple-transit-wosuru/akauntobsunochikettingu-abt/raifusaikuru/kdoakauntowokyanseru.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.
