# Delete a Card
source: https://developer.mastercard.com/donations/documentation/use-cases/manage-cards/delete-a-card/index.md

## Overview {#overview}

The **Delete Card** endpoint deletes the details of a card from the donor profile associated with it. To delete a card, provide both the unique `donor_id` and the card `card_id` in the endpoint request.

The endpoint checks for existing recurring donations associated with the card. If a card has active donations set up on it, the endpoint sends an error message asking to delete all active donation setups before deleting the said card data.

A successful request returns the `HTTP 204 This card with this ID `*xxx*` is deleted` status.

## Pre-requisite {#pre-requisite}

Before deleting a card, delete all donations active on the card.
Tip:   

* To know your existing donation setups, refer to the [Retrieve all Recurring Donation Setups](https://developer.mastercard.com/donations/documentation/use-cases/manage-recur-donations/retrieve-all-recur-donations/index.md) section.
* To delete a donation setup, refer to the [Delete a Recurring Donation](https://developer.mastercard.com/donations/documentation/use-cases/manage-recur-donations/delete-a-recur-donation/index.md) section.

## Sequence Diagram {#sequence-diagram}

The following outlines the sequence of events:
Diagram delete-a-card

## Execution Steps {#execution-steps}

The following details the steps in the above sequence diagram:

1. The donor requests the partner user interface to view all added cards.
2. The partner user interface displays the list of cards registered with the donor.
3. The donor selects the card to delete.
4. The partner user interface forwards the request to the partner server.
5. The partner server calls the `DELETE /donors/{donor_id}/cards/{card_id}` endpoint and provides the `donor_id` and `card_id` in the endpoint request to Mastercard Donate Service.
6. The Mastercard Donate service verifies the donor identifier.
7. The Mastercard Donate service verifies the card ID if it finds the donor.
8. The Mastercard Donate service validates the request and checks for existing active donation setups associated with the card if it finds the card identifier.
9. The Mastercard Donate service deletes the card and its tokens if it does not find any active donation setup associated with the card.
10. The Mastercard Donate service then confirms to the partner server that the card is deleted.
11. The partner server forwards the confirmation to the partner user interface.
12. The partner user interface displays the confirmation to the donor that the card is deleted.
13. The Mastercard Donate service sends the error message, 'Please delete donation setup', to the partner server if it finds active donation setups.
14. The partner server forwards the error message to the partner user interface.
15. The partner user interface displays the error message to the donor asking to delete active donation setups.
16. The Mastercard Donate service sends an error message to the partner server if it does not find the card identifier.
17. The partner server forwards the error message to the partner user interface.
18. The partner user interface displays the error message to the donor.
19. The Mastercard Donate service sends an error message to the partner server if it does not find the donor ID.
20. The partner server forwards the error message to the partner user interface.
21. The partner user interface displays the error message to the donor.

## Endpoint {#endpoint}


API Reference: `DELETE /donors/{donor_id}/cards/{card_id}`

## Endpoint Parameters {#endpoint-parameters}

For more details on the endpoint parameters, refer to the [Parameters to Delete a Card](https://developer.mastercard.com/donations/documentation/parameters/manage-cards-param/delete-a-card-param/index.md) section.

## Sample Request and Response {#sample-request-and-response}

For more details on the sample request and response, refer to the [Delete a Card](https://developer.mastercard.com/donations/tutorial/donation-api-details/cardsapinew/index.md#delete-donors) tutorial.
