> 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/nfc-payment/implement-nfc-payment/manage-digital-card/manage-default-card.md).

# Manage default card

### Overview

Set a default card before the end user can make a payment.

{% hint style="info" %}
Only one card can be set as the default card at a time.
{% endhint %}

### SDK

#### Set default card

{% tabs %}
{% tab title="Android Java" %}

```java
D1PayWallet d1PayWallet = d1Task.getD1PayWallet();
String d1CardID = "";
d1PayWallet.setDefaultPaymentDigitalCard(
        d1CardID,
        new D1Task.Callback<Void>() {
            @Override
            public void onSuccess(Void ignored) { }

            @Override
            public void onError(@NonNull D1Exception exception) {
                // Refer to D1 SDK Integration – Error Management section
                // Common error: invalid d1CardID
            }
});
```

{% endtab %}
{% endtabs %}

#### Get default card

{% hint style="info" %}
If no default card is set, `getDefaultPaymentDigitalCard` returns `null`.
{% endhint %}

{% tabs %}
{% tab title="Android Java" %}

```java
D1PayWallet d1PayWallet = d1Task.getD1PayWallet();
String d1CardID = "";
d1PayWallet.getDefaultPaymentDigitalCard(
        new D1Task.Callback<String>() {
            @Override
            public void onSuccess(@Nullable String d1CardID) {
                if (d1CardID != null) {
                    // call d1PayWallet.getDigitalCard to retrieve the details
                }
            }

            @Override
            public void onError(@NonNull D1Exception exception) {
                // Refer to D1 SDK Integration – Error Management section
            }
});
```

{% endtab %}
{% endtabs %}

#### Unset default card

{% tabs %}
{% tab title="Android Java" %}

```java
D1PayWallet d1PayWallet = d1Task.getD1PayWallet();
d1PayWallet.unsetDefaultPaymentDigitalCard(
        new D1Task.Callback<Void>() {
            @Override
            public void onSuccess(Void ignored) {
                // the default card is unset
            }

            @Override
            public void onError(@NonNull D1Exception exception) {
                // Refer to D1 SDK Integration – Error Management section
                // Common error: there is no default card.
            }
});
```

{% endtab %}
{% endtabs %}


---

# 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:

```
GET https://docs.payments.thalescloud.io/nfc-payment/implement-nfc-payment/manage-digital-card/manage-default-card.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
