Donating to a Donor-Advised Fund (DAF) Guide
Welcome to the Donating to a Donor-Advised Fund (DAF) Guide. This document will walk you through the process of donating to a Donor-Advised Fund (DAF) on the Endaoment platform. We will be creating a simple donation flow that will allow users to donate to a Donor-Advised Fund (DAF) on the Endaoment platform. This guide will cover adding a donation form to your frontend, preparing a donation URL, and processing the donation. Since there are a variety of donation types (cash, stock, crypto), we will cover each type in a separate section. Please refer to the appropriate section based on the donation type you would like to implement.What is a Donation?
A donation on the Endaoment platform occurs when a user contributes assets (like cash, stocks, or cryptocurrency) to any of the following:- A Donor-Advised Fund (DAF) - A charitable giving account that the donor can use to support multiple organizations over time
- An Organization - A direct contribution to a specific 501(c)(3) nonprofit organization
- A Subproject - A dedicated fundraising initiative within an organization
- They are elligible to receive an immediate tax deduction for their charitable contribution
- The assets are converted to USDC (a stablecoin pegged to USD) if not already in that form
- The USDC amount is now available to be granted (in the case of DAF donations) or directed to the specified organization
Prerequisites
Before you begin, ensure your application is capable of the following flows:- Logging in a user as users must be authenticated to interact with DAFs
- Creating a DAF as you will need to have a DAF to donate to
Flow Overview
Wire Cash Donation
Important Wire Donation Considerations
Before implementing wire donations, developers should understand these key aspects:- Wire donations are asynchronous: Unlike some payment methods, wire donations are not completed instantly when the pledge is created. The donation is only completed after the user actually sends the wire transfer and Endaoment receives and processes the funds.
-
Manual wire transfer required: The wire is not sent automatically. Users must manually initiate the wire transfer using the banking details obtained from the
v1/donation-pledges/wire/details/domestic
API. Your application must clearly display these wire instructions and set proper expectations for users. - Communication expectations: While Endaoment will send an email to users with wire instructions, your application should also prominently display these details to reinforce the expectations and ensure users understand the next steps.
- Development environment testing: When working in development environments, you’ll need to contact the Endaoment team to simulate wire pledge closures on our side. This ensures you can fully test your donation flow without having to make actual wire transfers. Note that we are working on an API to allow developers to programmatically handle wire pledge closures, which will make testing easier in the future. Make sure to check in with us if that API is complete to make your integration experience smoother.
Step-by-Step Instructions (Wire Cash Donation)
1. Set up fund selection
In order for the user to initiate any donation, they must first select a DAF to donate to. This can be done by listing the available DAFs for the user to choose from. The list of available DAFs should be retrieved from the Endaoment API through the use of your backend server. Create a route on your backend server that will make a request to the Endaoment API to retrieve the list of DAFs/get-dafs
.
The following code snippet, taken from the backend/routes/get-dafs.ts file in the quickstart example, demonstrates how to call the API:
https://api.dev.endaoment.org/v1/funds/mine
API being called, check the API docs
The following code snippet, taken from the frontend/components/all-dafs/AllDAFs.tsx file in the quickstart example, demonstrates how to display the list of DAFs to the user:
2. Retrieve wire instructions
Since the user will be donating using a wire transfer, they will need to be provided with the wire instructions for Endaoment. Create a route on your backend server that will make a request to the Endaoment API to retrieve the wire instructions for the selected DAF/get-wire-instructions
.
Remember that the wire instructions can change, so it is recommended to fetch the wire instructions each time a user decides to donate.
2. Set up the donation form
Once the user has selected a DAF and selected to donate by wire, you should display the wire instructions to the user and ask them to enter the amount they would like to donate in a simple form./wire-donation
route. We will set up this route in the next step.
3. Orchestrate the donation request
When the user submits the donation form, the details will be sent to your backend service. We will need to create an endpoint that can receive this information and then send it to the Endaoment API to create the donation request. For the purposes of this guide, we will assume that the endpoint is/wire-donation
.
The following code snippet, taken from the backend/routes/wire-donation.ts file in the quickstart example, demonstrates how to call the API: