> 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/release-notes/sdk/september-2026/d1-sdk-4.5.0/asynchronous-apis-on-d1-sdk-4.5.0.md).

# Asynchronous APIs on D1 SDK 4.5.0

## Asynchronous APIs on D1 SDK 4.5.0

#### Overview

D1 SDK 4.5.0 introduces asynchronous API updates for iOS.

The updated APIs support Swift concurrency.

Use this guide to review the affected APIs and update your issuer application.

#### What changed

The previous API surface is deprecated in D1 SDK 4.5.0.

If your issuer application uses asynchronous calls, replace completion handlers with Swift concurrency APIs.

This page lists the APIs changed in 4.5.0.

#### Migrate to `digitalCardService`

{% stepper %}
{% step %}
**Review your current integration**

Identify the deprecated D1 SDK APIs used by your issuer application.

Focus on the APIs now exposed through `digitalCardService`.
{% endstep %}

{% step %}
**Initialize `digitalCardService`**

Initialize `digitalCardService` from `d1Task` before calling the updated APIs.
{% endstep %}

{% step %}
**Replace completion handlers**

Replace each completion-handler API with the corresponding `async throws` API.
{% endstep %}

{% step %}
**Validate the migrated flows**

Build and test your issuer application after the migration.

Validate the updated digital card flows.
{% endstep %}
{% endstepper %}

#### Update asynchronous handling

Use the Swift concurrency APIs if your issuer application uses Swift concurrency.

This makes asynchronous code easier to read and maintain.

`digitalCardService` calls now use `async throws` instead of completion handlers.

#### API changes in 4.5.0

Use this section to review the APIs changed in D1 SDK 4.5.0.

Initialize the service from `d1Task` before calling the APIs.

```swift
let digitalCardService = try d1Task.digitalCardService()
```

#### `digitalCardService`

**`activateDigitalCard(withDigitalCardID:)`**

Before:

```swift
public func activateDigitalCard(withDigitalCardID digitalCardID: String,
                                   completion: @escaping (D1Error?) -> Void)
```

Now:

```swift
public func activateDigitalCard(withDigitalCardID digitalCardID: String) async throws
```

**`activateDigitalCard(_:)`**

Before:

```swift
public func activateDigitalCard(_ cardID: String,
                                   completion: @escaping (D1Error?) -> Void)
```

Now:

```swift
public func activateDigitalCard(_ cardID: String) async throws
```

**`digitalCardList(_:)`**

Before:

```swift
public func digitalCardList(_ cardID: String,
                               completion: @escaping ([DigitalCard]?, D1Error?) -> Void)
```

Now:

```swift
public func digitalCardList(_ cardID: String) async throws -> [DigitalCard]
```

**`updateDigitalCard(_:digitalCard:action:)`**

Before:

```swift
public func updateDigitalCard(_ cardID: String,
                                 digitalCard: DigitalCard,
                                 action: CardAction,
                                 completion: @escaping (Bool, D1Error?) -> Void)
```

Now:

```swift
public func updateDigitalCard(_ cardID: String,
                                 digitalCard: DigitalCard,
                                 action: CardAction) async throws
```


---

# 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/release-notes/sdk/september-2026/d1-sdk-4.5.0/asynchronous-apis-on-d1-sdk-4.5.0.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.
