Updated

Donations

To create a donation, use the /donations/create endpoint. In the response, you'll get a donation ID, which you can use to retrieve information about your donation. We also have endpoints that simplify making carbon offset donations.

Create a donation

post /api/v1/donations

Creates a donation to any nonprofit. CHANGE keeps track of your donations, bills you at the end of the month, and handles the nonprofit payouts for you.

Parameters

amount string REQUIRED

The amount of the donation in cents.

nonprofit_id string REQUIRED

The id of a nonprofit from the CHANGE network.

funding_source string REQUIRED
Enum: merchant|customer

Source of the donation funds. If you are collecting payment from your customer for the donation, use customer.

zip_code string

The customer's zip code. Provide this to unlock geographic insights.

Request

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&zip_code=94104'

Response

{
"amount": 500,
"id": "d_g2R0UDSwf6e3dk9rD7fc223j",
"live_mode": true,
"merchant_id": "m_HpBJ103KVNBrLd8i1IGia88m",
"nonprofit_id": "n_IfEoPCaPqVsFAUI5xl0CBUOx",
"order_value": null,
"zip_code": "94104",
"external_id": null
}

List your donations

get /api/v1/donations

Retrieves a list of donations you've previously made. The donations are returned in order of creation, with the most recent donations appearing first. This endpoint is paginated.

Parameters

page number

Which page to return. This endpoint is paginated, and returns maximum 30 donations per page.

Request

curl https://api.getchange.io/api/v1/donations \
-u YOUR_PUBLIC_KEY:YOUR_SECRET_KEY \
-d 'page=1' \
-G

Response

{
"donations": [
{
"amount": 486,
"id": "d_AOlMu5Ztm0mL4vPaozyCLvh9",
"live_mode": true,
"merchant_id": "m_KO0TKOgfCJ7aRSJXIzpacbd1",
"nonprofit_id": "n_IfEoPCaPqVsFAUI5xl0CBUOx",
"order_value": 4483,
"zip_code": "42570-2842",
"external_id": null
},
{
"amount": 274,
"id": "d_4bpb84hA1xvljo9Z603PQNqv",
"live_mode": true,
"merchant_id": "m_KO0TKOgfCJ7aRSJXIzpacbd1",
"nonprofit_id": "n_nIstMceV5IXNWwMOzomgHEEV",
"order_value": 4724,
"zip_code": "63192",
"external_id": null
}
],
"page": 1
}

Retrieve a donation

get /api/v1/donations/{id}

Retrieves the details of a donation you've previously made.

Parameters

id string REQUIRED

The id of a donation. Ids are returned when a donation is created.

Request

curl https://api.getchange.io/api/v1/donations/d_NuYL6M2C1kjecXpWzKVODw7W \
-u YOUR_PUBLIC_KEY:YOUR_SECRET_KEY

Response

{
"amount": 125,
"id": "d_8qQziCnXC6REGJvnGZt8GssT",
"live_mode": true,
"merchant_id": "m_ToH6VK25AXA3ghHvPrDiucdm",
"nonprofit_id": "n_MUjmT5yhdf4smx1ykRwO2ovt",
"order_value": 4998,
"zip_code": "22092",
"external_id": null
}

Retrieve carbon offset stats

get /api/v1/donations/{id}/climate_stats

Measures your carbon offset impact in relatable terms. Provide the id of a donation to CarbonFund to see stats about that specific donation.

Parameters

id number REQUIRED

The id of a donation to the CarbonFund nonprofit. Ids are returned when a donation is created.

Request

curl https://api.getchange.io/api/v1/donations/d_NuYL6M2C1kjecXpWzKVODw7W/climate_stats \
-u YOUR_PUBLIC_KEY:YOUR_SECRET_KEY

Response

{
"amount": 381,
"trees": 6.2,
"co2_tonnes_offset": 0.381
}
Made with ❤ in San Francisco