> 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/implement-card-activation/activate-a-card.md).

# Activate a card

This section describes how to activate a physical card when the card has been received.

For each product type, issuer has the flexibility to decide the card activation method:

* CVV
* Last 4 digits of the PAN

### User Experience

<figure><img src="/files/aAwOhoFwviwbPScf109L" alt=""><figcaption><p>Sample card activation screen in the Issuer Application</p></figcaption></figure>

The activation challenge (last four digits of the PAN or CVV) is captured securely by D1 SDK.

### Flow

<figure><img src="/files/owstr474tK5wRyLr8cyd" alt=""><figcaption><p>High-level flow to activate a card</p></figcaption></figure>

1. The user authenticates on the banking app and request to activate the card.
2. An internal call is made to the SDK
3. Capture securely the last 4 digits of the PAN
4. D1 BackEnd API
5. D1 validates the last 4 digits of the PAN with the one used to register card
6. D1 pushes card activation request to issuer backend

### Sequence Diagram

#### Pre-requisites

* Consumer, account and card already registered in D1
* SDK is properly initialized
* Issuer App called D1 SDK login API.

<figure><img src="/files/CZZNBOONKzsUZbowjr5j" alt=""><figcaption><p>Sequence diagram for card activation</p></figcaption></figure>

### Required APIs

| API                                                                                                                                                                               | Inbound/Outbound    | Description                                               |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------- | --------------------------------------------------------- |
| [Get authorization token](/pin-management/integrate-the-d1-api/d1-api-reference/outbound-api-from-d1/oauth2-api.md#post-oauth2-token)                                             | Issuer <- Thales D1 | Get an OAuth 2.0 access token to call the Issuer backend. |
| [Activate card](/pin-management/integrate-the-d1-api/d1-api-reference/outbound-api-from-d1/card-activation-api.md#post-cms-api-v1-issuers-issuerid-physicalcards-cardid-activate) | Issuer <- Thales D1 | Activate a physical card in issuer backend                |

### SDK

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

```java
SecureEditText secureEditText = <Object of type SecureEditText>;
EntryUI entryUI = new EntryUI(secureEditText);
String cardID = "<Card ID>";

d1Task.activatePhysicalCard(cardID, entryUI, new D1Task.Callback<Void>() {
    @Override
    public void onSuccess(Void data) {
        // Proceed with subsequent flows. The card is now activated.
    }
    
    @Override
    public void onError(D1Exception exception) {
        // Refer to D1 SDK Integration – Error Management section
    }
});
```

{% endtab %}

{% tab title="iOS" %}

```swift
let secureTextField = <Object of type D1SecureTextField>
let entryUI = EntryUI(entryTextField: secureTextField)
let cardID = <Card ID>

d1Task.activatePhysicalCard(cardID, entryUI: entryUI) { error in
    if let error = error {
        // Refer to D1 SDK Integration – Error Management section
    } else {
        // Proceed with subsequent flows. The card is now activated.
    }
}
```

{% 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/pin-management/implement-card-activation/activate-a-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.
