# Delete a Donor Profile
source: https://developer.mastercard.com/donations/documentation/use-cases/manage-donor/delete-donor/index.md

## Overview {#overview}

Donors have the possibility to delete their profiles, which remove all their personal information from the Mastercard Donate platform. The **Delete Donor** endpoint removes the donor profile from the Mastercard Donate database.

Unlike other objects, you can retrieve deleted donors through the API. This allows tracking of donor history while still ensuring removal of their credit card information to prevent further operations.

To delete a donor, provide the `donorId` in the request. A successful response returns the `HTTP 204 (No Content)` status.

## Pre-requisites {#pre-requisites}

Ensure that you properly terminate all related financial activities before the donor data is removed:

* Inactivate all recurring donations associated with the donor profile
* Delete all cards registered with the donor profile

## Validations {#validations}

When you make a delete request, the endpoint checks for active cards associated with the donor. If the endpoint finds active cards, it displays an error message instructing the donor to delete active cards first before proceeding with the donor profile deletion.

This endpoint returns an error if:

* The `donorId` does not exist.
* There are existing donation setups and payment cards in the donor profile before deleting it.  

## Sequence of Operations {#sequence-of-operations}

### 1. Delete cards {#1-delete-cards}

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

### 2. Delete donor profile {#2-delete-donor-profile}

After the recurring donation setups and registered cards are deleted from the donor's profile, the donor can proceed to delete the profile.

#### Sequence Diagram {#sequence-diagram}

The following outlines the sequence of events:
Diagram delete-donor

#### Execution Steps {#execution-steps}

1. The donor requests to delete the profile.
2. The partner user interface forwards the request to the partner server.
3. The partner server calls the `DELETE Donor` endpoint and provides the `donorId` in the endpoint request to Mastercard Donate.
4. The Mastercard Donate service verifies the donor identifier.
5. The Mastercard Donate service checks for active payment cards if it finds the donor identifier.
6. The Mastercard Donate service sends an error message to the partner server if it finds payment cards in the profile.
7. The partner server forwards the error message to the partner user interface.
8. The partner user interface displays the message to the donor.
9. The Mastercard Donate service deletes the donor profile if it does not find existing payment cards.
10. After deleting the donor profile, Mastercard Donate sends a confirmation to the partner server.
11. The partner server forwards the confirmation to the partner user interface.
12. The partner user interface sends the confirmation to the donor.
13. If the Mastercard Donate service does not find the donor identifier, it sends an error message to the partner server.
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.

## Endpoint {#endpoint}


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

## Endpoint parameter {#endpoint-parameter}

For more details on the endpoint parameters, refer to the [Parameters to Delete a Donor](https://developer.mastercard.com/donations/documentation/parameters/enroll-manage-donor-param/delete-donor-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 Donor](https://developer.mastercard.com/donations/tutorial/donation-api-details/donorsapi/index.md#delete-donors) tutorial.
