> 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/pin-management/ja/kdowosuru/kdowosuru.md).

# カードを有効化する

このセクションでは、カードが受け取られた後に物理カードを有効化する方法について説明します。

製品タイプごとに、イシュアはカード有効化方法を柔軟に決定できます：

* CVV
* PANの下4桁

### ユーザーエクスペリエンス

<figure><img src="/files/f84b6448fe878346dc8fab422bb03af126f32124" alt=""><figcaption><p>イシュアアプリケーションのカード有効化画面のサンプル</p></figcaption></figure>

有効化チャレンジ（PANの下4桁またはCVV）はD1 SDKによって安全に取得されます。

### フロー

<figure><img src="/files/4e7792b757e3f5c4e585365ae8fc2bec688d97e7" alt=""><figcaption><p>カードを有効化するためのハイレベルフロー</p></figcaption></figure>

1. ユーザーはバンキングアプリで認証し、カードの有効化を要求します。
2. SDKへの内部呼び出しが行われます
3. PANの下4桁を安全に取得する
4. D1バックエンドAPI
5. D1はPANの下4桁をカード登録時に使用されたものと照合します
6. D1はカード有効化リクエストをイシュアのバックエンドにプッシュします

### シーケンス図

#### 前提条件

* 消費者、口座、およびカードが既にD1に登録されていること
* SDKが適切に初期化されていること
* イシュアアプリがD1 SDKのログインAPIを呼び出していること。

<figure><img src="/files/59db2c967f7de367dfa6a468ba4590fac204fc0c" alt=""><figcaption><p>カード有効化のためのシーケンス図</p></figcaption></figure>

### 必要なAPI

| API                                                                                                                                                     | インバウンド／アウトバウンド    | 説明                                          |
| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------- | ------------------------------------------- |
| [認可トークンの取得](/pin-management/ja/d1-apiwosuru/d1-apirifarensu/autobaundoapid1kara/oauth2-api.md#post-oauth2-token)                                        | イシュア <- Thales D1 | イシュアのバックエンドを呼び出すためのOAuth 2.0アクセストークンを取得します。 |
| [カードの有効化](/pin-management/ja/d1-apiwosuru/d1-apirifarensu/autobaundoapid1kara/kdoapi.md#post-cms-api-v1-issuers-issuerid-physicalcards-cardid-activate) | イシュア <- Thales D1 | イシュアのバックエンドで物理カードを有効化する                     |

### SDK

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

```java
SecureEditText secureEditText = <SecureEditText 型のオブジェクト>;
EntryUI entryUI = new EntryUI(secureEditText);
String cardID = "<カードID>";

d1Task.activatePhysicalCard(cardID, entryUI, new D1Task.Callback<Void>() {
    @Override
    public void onSuccess(Void data) {
        // 以降のフローを進めます。カードは現在有効化されています。
    }
    
    @Override
    public void onError(D1Exception exception) {
        // D1 SDK 統合 – エラー管理セクションを参照してください
    }
});
```

{% endtab %}

{% tab title="iOS" %}

```swift
let secureTextField = <D1SecureTextField 型のオブジェクト>
let entryUI = EntryUI(entryTextField: secureTextField)
let cardID = <カードID>

d1Task.activatePhysicalCard(cardID, entryUI: entryUI) { error in
    if let error = error {
        // D1 SDK 統合 – エラー管理セクションを参照してください
    } else {
        // 以降のフローを進めます。カードは現在有効化されています。
    }
}
```

{% 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, and the optional `goal` query parameter:

```
GET https://docs.payments.thalescloud.io/pin-management/ja/kdowosuru/kdowosuru.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.
