Updated

Getting Started with the Donations API

Use the Donations API to easily make charitable contributions through your platform. The API manages the entire donation lifecycle from initial creation to final deposit. All funds are routed through Our Change Foundation to ensure expedient and secure payouts.

Let’s see how easy it is to make a donation with CHANGE.

Get your credentials

The Donations API uses basic authentication. Sign up for a CHANGE account to get access to test credentials. (Don’t worry, you can follow along without credentials too!)

To view your test credentials, click the “View Test Data” button on the left, then go to your Home page. Your sandbox keys have the prefix test, and your production keys have the prefix live.

Create a donation

To create a donation, send a request with your credentials to the donations/create endpoint. Pop open a terminal, and send the following request (insert your own test credentials).

curl https://api.getchange.io/api/v1/donations \
-u YOUR_PUBLIC_KEY:YOUR_SECRET_KEY \
-d 'amount=500&nonprofit_id=n_IfEoPCaPqVsFAUI5xl0CBUOx&funding_source=customer'

Bada bing, bada boom! You just made a (test) donation to Watsi, a healthcare nonprofit.

Is it really that easy?

Yes! The CHANGE platform manages the rest of the donation lifecycle. All funds are routed through Our Change Foundation to ensure expedient and secure payouts.

You control the amount of the donation, the nonprofit, the funding source, and more.

ParameterDescription
amount requiredDonation amount USD cents. For example, a $5 donation has an amount of 500.
nonprofit_id requiredID of the nonprofit the donation is being sent to. To search for nonprofit partners, please use our Nonprofits API. We support most US-based nonprofits!
funding_source requiredIndicator for the source of funds that can be either customer or merchant. Use customer when you are collecting money from the customer for the donation. Use merchant when you want to fund it yourself. Either way, your company will be billed at the end of each month for the donation funds.

For more parameters, see the Donations API reference.

Share your donation

CHANGE does more than make donations easy. We also generate social media content for your users to share. Send a request to our content API, and get back a set of sharing-ready URLs for your customers.

curl https://api.getchange.io/api/v1/nonprofits/n_IfEoPCaPqVsFAUI5xl0CBUOx/social_media_content \
-d 'public_key=YOUR_PUBLIC_KEY' \
-G

Example Response

Social media content for Watsi from the API. The theme is Pink.Social media content for Watsi from the API. The theme is Black.Social media content for Watsi from the API. The theme is White.
[
{
"theme": "pink",
"url": "https://generated-social-media-content--production.s3.us-west-1.amazonaws.com/bc470139f3db7120b2e5de99507e2418.jpg"
},
{
"theme": "white",
"url": "https://generated-social-media-content--production.s3.us-west-1.amazonaws.com/c4f1280a75c890ec697dcda0225ad33d.jpg"
},
{
"theme": "black",
"url": "https://generated-social-media-content--production.s3.us-west-1.amazonaws.com/340ed7919e61062605e5a8f9b330e57a.jpg"
}
]

🔴 Go live!

When you’re ready to go live, connect your bank account from the CHANGE dashboard, and swap your test credentials for your live credentials. At that point, you’ll be making real-world donations.

To learn more about our donations API, check out the API reference.

Made with ❤ in San Francisco