> 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/classic-tokenization/use-cases/card-enrolment/handle-enrollment-failures.md).

# Handle enrollment failures

Enrollment can fail after the end user starts provisioning a card.

When this happens, the token requestor (wallet provider) or the payment network **TSP** can delete the token.

### What the issuer backend receives

Tokenization Service notifies the **issuer backend** using `notifyVirtualCardChange`.

For enrollment failures that result in token deletion, `action` is typically:

* `DELETE` (token deleted on the payment network TSP)
* `DELETE_FROM_APP` (token deleted in the wallet application, **MDES** only)

`notifyVirtualCardChange` also includes:

* `x-correlation-id` (HTTP header) to link the enrollment session.
* `virtualCardId` and `issuerCardRefId` to identify the token and card.
* `source` to indicate who initiated the change (`WALLET`, `TSP`, or `ISSUER`).

<details>

<summary>Example request body (simplified)</summary>

```json
{
  "issuerCardRefId": "string",
  "virtualCardId": "string",
  "walletProviderId": "APPLE_PAY",
  "isPrimary": true,
  "action": "DELETE",
  "source": "TSP"
}
```

</details>

### How to handle enrollment failures

Handle `notifyVirtualCardChange` idempotently. You can receive duplicates or late callbacks.

When `action` indicates deletion:

1. Mark the token as deleted in the issuer backend.
2. Stop any pending step-up authentication for this enrollment.
3. Allow the end user to restart enrollment.

{% hint style="info" %}
`notifyVirtualCardChange` is used for more than enrollment failures. It is also used for state changes like `ACTIVATE`, `SUSPEND`, and `RESUME`.
{% endhint %}

### Related documentation

* [Token state update by the wallet](/classic-tokenization/use-cases/post-enrolment/token-life-cycle-management/update-token-state-from-wallet-provider.md)
* [Outbound (to issuer)](/classic-tokenization/api-reference/issuer-gateway-api/outbound-to-issuer.md)


---

# 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/classic-tokenization/use-cases/card-enrolment/handle-enrollment-failures.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.
