# Create a Recurring Donation
source: https://developer.mastercard.com/donations/documentation/use-cases/manage-recur-donations/create-recur-donations/index.md

## Overview {#overview}

The **Setup Donation** endpoint creates a new recurring donation setup for a specified amount to a selected charity. A successful request returns the `HTTP 200 OK` status and a JSON response body that includes the unique `donationSetupId`, `setupStatus`, and donation setup details.

### Transaction Processing {#transaction-processing}

* The first monthly transaction takes place when the donation is set up.
* Mastercard Donate processes micro and round-up donations the following month due to calculations that depend on the donor's transactions from the previous month.
* You can set explicit timeouts to process a transaction.
* If a transaction fails due to any timeouts, you can use the **Transaction Status API** to retrieve the transaction status later.

For more details on the **Transaction Status API** , refer to the [Retrieve Donation Transaction Status](https://developer.mastercard.com/donations/documentation/use-cases/manage-donation-trns/transaction-status-api/index.md) section.

### Validations {#validations}

* When the donor tries to set up a micro or round-up donation, the setup goes through a zero dollar verification.
* Mastercard Donate creates the setup only if the zero-dollar transaction is successful.
* Mastercard Donate processes subsequent transactions as Merchant-initiated Transactions (MIT) instead of Mail Order/Telephone Order (MOTO) transactions.
* Payment gateways like Stripe and MPGS just process the zero-dollar transaction. Based on your issuer response, payment gateways respond with success or failure.

Tip: **Design Recommendations**   

Provide FAQs (Frequently Asked Questions) and details on how donors can get support.

## Pre-requisite {#pre-requisite}

To set up a recurring donation:

* A cardholder must register as a donor.
* Add payment card information.
* Donors must agree to your terms and conditions

Your terms and conditions should require donors to store their payment details for recurring donations. This allows Mastercard Donate to initiate payments without the active participation of donors.

During the donation setup update, card information is securely tokenized. For more details on tokenization, refer to the [Tokenization](https://developer.mastercard.com/donations/documentation/api-basics/index.md#tokenization) section.

## Sequence Diagram {#sequence-diagram}

The following outlines the sequence of events:
Diagram add-donation-setup

## Execution Steps {#execution-steps}

The following details the steps in the above sequence diagram:

1. The donor requests to display the charities to set up a recurring donation.
2. The partner user interface displays the page with charities.
3. The donor selects the charity to donate.
4. The partner user interface displays the list of donation types.
5. The donor selects the donation type and amount.
6. The partner user interface then displays the list of cards to set up the donation with.
7. The donor chooses the card.
8. The partner user interface displays the details for the donor to review.
9. The donor reviews and confirms to proceed.
10. The partner user interface forwards the request to the partner server.
11. The partner server calls the `POST /donors/{donor_id}/donation-setups` endpoint. It provides the `donorId` in the endpoint request and other details in the request body to the Mastercard Donate service. Note: The `POST /donors/{donor_id}/setups` endpoint is now deprecated and should no longer be used.
12. The Mastercard Donate service creates and saves the donation setup. It also creates a unique donation setup ID.
13. If the donation type is monthly, the Mastercard Donate service instantly initiates a transaction on the card for the donation amount.
14. The Mastercard Donate service then forwards the authorization request to the acquiring bank of the charity institution.
15. The charity's acquirer bank processes the transaction.
16. The charity's acquirer bank then sends the transaction details to the Mastercard Donate service.
17. The Mastercard Donate service then returns the donation setup and transaction details to the partner server.
18. The partner server then sends a confirmation to the donor that the first monthly setup is activated and the first donation transaction is successful.
19. If the donation type is micro or roundup, then the Mastercard Donate service sends the donation setup details to the partner server without charging the payment card for the donation amount.
20. The partner server then saves the donation setup details.
21. The partner server then returns the donation setup details to the partner user interface.
22. The partner server also sends a confirmation to the donor that the donation setup has activated successfully.

## Endpoint {#endpoint}


API Reference: `POST /donors/{donor_id}/setups`


API Reference: `POST /donors/{donor_id}/donation-setups`

## Endpoint Parameter {#endpoint-parameter}

For more details on the endpoint parameters, refer to the [Parameters to Create Recurring Donations](https://developer.mastercard.com/donations/documentation/parameters/manage-recur-donation-param/monthly/index.md) section.

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

For more details, refer to the [Create a Recurring Donation](https://developer.mastercard.com/donations/tutorial/donation-api-details/monthlyapi/index.md#post-donations) tutorial.
