> 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/click-to-pay/implement-click-to-pay-issuers/opt-out-cards-from-click-to-pay/opt-out-by-d1-api.md).

# Opt out with the D1 API

## Overview

This page explains how the issuer backend can opt a card out of Click to Pay by calling the D1 API [Click to Pay opt-out](/click-to-pay/integrate-the-d1-api/d1-api-summary.md).

Use this backend flow when:

* You want to remove a card from Click to Pay without any action from the end user in the issuer application (for example, card closure, fraud, or regulatory reasons).
* You orchestrate opt-out operations from the issuer backend or the Customer care interface.

When the opt-out operation succeeds:

* The card is deleted from the Click to Pay directory.
* The payment network deletes the associated digital card.
* The card no longer appears as an available payment method during Click to Pay checkout.

Opt-out is final. If needed, you can re-enroll the card by calling the API [Click to Pay enrol](/click-to-pay/integrate-the-d1-api/d1-api-summary.md).

{% hint style="info" %}
**Click to Pay consumer opt-out**

The flows below also apply to consumer opt-out, with the following exceptions:

* The dedicated API uses `consumerId` instead of `cardId`.
* The notification sent at the end of the operation is **Notify Consumer Operations** instead of **Notify Card Operations**.
  {% endhint %}

## User experience

<figure><img src="/files/pyo1PEmYOH1JzIV6nTEV" alt=""><figcaption><p>Opt a card out of Click to Pay from the issuer backend.</p></figcaption></figure>

## Flow

The diagram below shows the overall backend opt-out flow:

<figure><img src="/files/amYB4XWNbM1tlZLDPdnk" alt=""><figcaption><p>Backend Click to Pay opt-out flow.</p></figcaption></figure>

### Sequence diagram

The sequence diagram below illustrates the opt-out by `cardId` flow initiated from the issuer backend:

<figure><img src="/files/OFnuOKkf3UfKZ95AFxWe" alt=""><figcaption><p>Sequence diagram for backend Click to Pay opt-out.</p></figcaption></figure>

The sequence diagram below illustrates the opt-out by `consumerId` flow initiated from the issuer backend:

<figure><img src="/files/RnbTKlY97rdfybOhhROZ" alt=""><figcaption><p>Sequence diagram for backend Click to Pay consumer opt-out.</p></figcaption></figure>

### Effects of opt-out

Depending on the selected opt-out type, the operation deletes either the card or the full consumer profile and all cards from Click to Pay.

As a result, the payment network deletes all associated details.

When the end user checks out on a merchant site with Click to Pay, the deleted card no longer appears as a payment method.

{% hint style="info" %}
Through D1, the [Delete card](/click-to-pay/integrate-the-d1-api/d1-api-summary.md) request propagates to all linked services. As a result, the deletion request also triggers opt-out of the card from Click to Pay. No further action is required from the issuer.
{% endhint %}

{% hint style="info" %}
**Recommendation**

* For consumers with several cards, use granular opt-out with the **Click to Pay opt-out card** API. The cardholder details remain in the Click to Pay directory as long as at least one card exists. When the last card is opted out, D1 automatically deletes the cardholder details from Click to Pay. This ensures that no cardholder details remain in the Click to Pay directory without an associated card.
* For consumers with a single card, use **Click to Pay opt-out consumer** to ensure full deletion in a single call.
  {% endhint %}


---

# 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/click-to-pay/implement-click-to-pay-issuers/opt-out-cards-from-click-to-pay/opt-out-by-d1-api.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.
