> 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). Agents can also search and read this documentation through its [MCP server](https://docs.payments.thalescloud.io/~gitbook/mcp).

# 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](https://docs.payments.thalescloud.io/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](https://docs.payments.thalescloud.io/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="https://747329373-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuKGiYHoxBTUoHkwRFlXH%2Fuploads%2Fq9kkDJiXMKMo662EB58c%2FUX%20-%20Opt%20out%20C2P.svg?alt=media&amp;token=7449859c-521f-4e03-9966-0f545252f18c" 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="https://747329373-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuKGiYHoxBTUoHkwRFlXH%2Fuploads%2Fbvsj2AFd2VKObdqEHr96%2FFlow%20-%20%20Opt%20out%20by%20D1%20API.svg?alt=media&amp;token=4d329b6b-dffd-40d0-95f8-a07efb9ffaaf" 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="https://747329373-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuKGiYHoxBTUoHkwRFlXH%2Fuploads%2FGNFj5aX1NeX4cOdOyIqc%2FSequence%20Diagram%20-%20Opt%20out%20by%20D1%20API%20-%20cardID.svg?alt=media&amp;token=c4dfe869-12ec-46a5-8b4c-b4dddac57e9a" 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="https://747329373-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuKGiYHoxBTUoHkwRFlXH%2Fuploads%2FEsJNNlhqkLfKiCN5c8sB%2FSequence%20Diagram%20-%20Opt%20out%20by%20D1%20API%20-%20consumerId.svg?alt=media&amp;token=aeb00d60-1c1c-4bc8-abd6-1b8f1143a6ed" alt=""><figcaption><p>Sequence diagram for backend Click to Pay consumer opt-out.</p></figcaption></figure>


---

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