> 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/digital-card-issuance-dci.md).

# Digital Card Issuance (DCI)

The Digital Card Issuance process enables the issuance of a new, anonymous transit card directly from Apple Wallet.

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

Below are the high level steps of the DCI workflow:

1. **Fare Product Selection & Payment**: user selects the fare product he wants to purchase. Once selected, user authorizes the purchase of the selected fare product and the payment is processed by the PSP.
2. **Provisioning**: Apple fetches the provisioning bundle containing the card details.
3. **Provisioning Outcome**: Apple sends a notification indicating the provisioning result.

### Sequence diagram

#### Fare Product Selection & Payment

The user begins by selecting the transit card within the Apple Wallet and loading it with an eligible fare product of their choice. Before proceeding to payment, Apple Wallet will present the transit issuer's terms and conditions, which the user must review and accept to continue. Once accepted, the user will be directed to a payment interface displaying a payment sheet, where they can choose an eligible payment card to complete the purchase.

**Error scenarios**

When a payment failure or timeout occurs, Apple Wallet displays a red exclamation mark to the user. The user can retry the payment using the same or a different payment sheet, with either the same or a different payment credential.

**Retry with same payment sheet**

In this case, the same orderId will be used. Transit issuer needs to check the status of the payment linked to that orderId. It's possible that the existing payment was successfully processed by the PSP, but due to a delay, the previous attempt timed out.

**Retry with a different payment sheet**

Here, a new orderId is generated for this new payment request.

{% hint style="info" %}
It is important to note that the Transit Issuer shall start preparing the data required to issue the digital card as soon as the payment request is validated with the PSP
{% endhint %}

<figure><img src="/spaces/SokLBgfEhZisVFcUdPiW/files/a9iWKT8OS95WGarf8lNR" alt=""><figcaption></figcaption></figure>

#### **Provisioning**

Once the user has successfully completed payment, Apple sends a request to obtain an encrypted provisioning bundle.

**Error Scenarios**

**No request from Apple to get the provisioning bundle**

A timeout period between perform payment response and request from Apple is set on D1 Transit side.

If the provisioning bundle request is not received by D1 Transit within this timeout period, card account and digital card references are completely discarded. Transit issuer shall refund the customer.

If Apple requests the provisioning bundle after the timeout, D1 Transit will notify Apple that the bundle is no longer available, prompting Apple to halt the provisioning workflow.

<figure><img src="/spaces/SokLBgfEhZisVFcUdPiW/files/17MttZDTBrDEVvFoIRgJ" alt=""><figcaption></figcaption></figure>

#### **Provisioning Outcome**

Once Apple receives the provisioning bundle, the keys and data are securely extracted and stored on the applet. After completing personalization, a notification is sent to D1 Transit to report the outcome of the provisioning workflow.

**Error Scenarios**

**Card fails to provision onto device**

If provisioning fails, Apple sends a notification to D1 Transit indicating the provisioning failure. D1 Transit notifies Transit issuer about the failure. Transit Issuer can either:

* refund the customer and notify D1 Transit that the card account is deleted.
* Allow the customer to reinitiate provisioning: When the users selects the transit card in Wallet, they will see the previously purchased card in 'Pending Purchase' state and can reinitiate the provisioning process.

**No notification from Apple**

D1 Transit has a timeout period after sending the provisioning bundle to Apple. If no notification is received within the specified timeframe, D1 Transit sends a getStatus request to Apple to check the current state of the card.

If the card's state is active, meaning the card successfully provisioned onto the device and is available for use, D1 Transit completes the workflow considering the provisioning as successful

If the card's state is not active, D1 Transit completes the workflow considering the provisioning as failed, i.e. Transit issuer is notified so it can refund the customer.

<figure><img src="/spaces/SokLBgfEhZisVFcUdPiW/files/bQsOcMjjCLk644soTcgh" alt=""><figcaption></figcaption></figure>

<figure><img src="/spaces/SokLBgfEhZisVFcUdPiW/files/IBy26YaB5R5G1MAAI6W6" 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/digital-card-issuance-dci.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.
