API Reference
Donations
To create a donation, use the /api/v1/donations
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. For cryptocurrency donations, please check out the Crypto section.
Parameters
The amount of the donation in cents.
The id of a nonprofit from the CHANGE network.
Whether you are collecting payment for the donation. This helps us issue the correct tax receipt at the end of the year.
The number of donations to submit.
Whether the amount
parameter should include processing fees. Default is false
.
An external ID associated with the donation, e.g. an order ID, SKU, or customer ID.
For Marketplace API donations only. The id of the managed account.
Cart or order volume (in cents) associated with the donation. CHANGE provides AOV metrics if order values are provided.
A zip code to associate with the donation. CHANGE provides geography-based analytics if zip codes are provided.
Request
curl https://api.getchange.io/api/v1/donations \
-u YOUR_PUBLIC_KEY:YOUR_SECRET_KEY \
-H "Content-Type: application/json" \
-d '{
"amount": 500,
"nonprofit_id": "n_IfEoPCaPqVsFAUI5xl0CBUOx",
"funds_collected": false,
"external_id": "customer_1234",
"order_value": 2599,
"zip_code": "94104"
}'
Response
{
"amount": 500,
"id": "d_tQDMgQNQ16aoNADaK6HSw1Up",
"live_mode": true,
"nonprofit_id": "n_IfEoPCaPqVsFAUI5xl0CBUOx",
"order_value": 2599,
"zip_code": "94104",
"external_id": "customer_1234",
"metadata": {},
"currency": "USD"
}
Request
curl https://api.getchange.io/api/v1/donations \
-u YOUR_PUBLIC_KEY:YOUR_SECRET_KEY \
-H "Content-Type: application/json" \
-d '{
"amount": 500,
"nonprofit_id": "n_IfEoPCaPqVsFAUI5xl0CBUOx",
"funds_collected": false,
"external_id": "customer_1234",
"account_id": "a_FTLWVCkjwPI6qu2JR2bkQtYK",
"order_value": 2599,
"zip_code": "94104"
}'
Response
{
"amount": 500,
"id": "d_wC3dtOIPzEy4B32Rphs1v3N4",
"live_mode": true,
"nonprofit_id": "n_IfEoPCaPqVsFAUI5xl0CBUOx",
"order_value": 2599,
"zip_code": "94104",
"external_id": "customer_1234",
"metadata": {},
"currency": "USD",
"account_id": "a_FTLWVCkjwPI6qu2JR2bkQtYK"
}
Request
curl https://api.getchange.io/api/v1/donations \
-u YOUR_PUBLIC_KEY:YOUR_SECRET_KEY \
-H "Content-Type: application/json" \
-d '{
"amount": 100,
"nonprofit_id": "n_IfEoPCaPqVsFAUI5xl0CBUOx",
"funds_collected": false,
"count": 5,
"external_id": "customer_1234",
"order_value": 2599,
"zip_code": "94104"
}'
Response
{
"amount": 100,
"id": "d_d5s0GeTK3XCy00P5HEyCoIkO",
"live_mode": true,
"nonprofit_id": "n_IfEoPCaPqVsFAUI5xl0CBUOx",
"order_value": 2599,
"zip_code": "94104",
"external_id": "customer_1234",
"metadata": {},
"currency": "USD",
"count": 5,
"total_amount": 500
}
Request
curl https://api.getchange.io/api/v1/donations \
-u YOUR_PUBLIC_KEY:YOUR_SECRET_KEY \
-H "Content-Type: application/json" \
-d '{
"amount": 500,
"nonprofit_id": "n_invalid",
"funds_collected": false,
"external_id": "customer_1234",
"order_value": 2599,
"zip_code": "94104"
}'
Response
{
"status": 400,
"code": "nonprofit_invalid",
"title": "The nonprofit is invalid. Please reference a nonprofit in the CHANGE network.",
"detail": "nonprofit_id n_invalid is invalid."
}
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
Which page to return. This endpoint is paginated, and returns maximum 30 donations per page.
For Marketplace API donations only. The id of the managed account.
Request
curl https://api.getchange.io/api/v1/donations \
-u YOUR_PUBLIC_KEY:YOUR_SECRET_KEY \
-d 'page=1' \
-G
Response
{
"donations": [
{
"amount": 1000,
"id": "d_yEUDGfW5GFHT19kmsxttbbR7",
"live_mode": true,
"nonprofit_id": "n_IfEoPCaPqVsFAUI5xl0CBUOx",
"order_value": 4244,
"zip_code": "55116-0195",
"external_id": null,
"metadata": {
"key": "value"
},
"currency": "USD"
},
{
"amount": 500,
"id": "d_cNmomJNEjw4om0MJbAiMNnh4",
"live_mode": true,
"nonprofit_id": "n_nIstMceV5IXNWwMOzomgHEEV",
"order_value": 2313,
"zip_code": "01628",
"external_id": null,
"metadata": {
"key": "value"
},
"currency": "USD"
}
],
"page": 1
}
Retrieve a donation
get /api/v1/donations/{id}
Retrieves the details of a donation you've previously made.
Parameters
The id of a donation. Ids are returned when a donation is created.
Request
curl https://api.getchange.io/api/v1/donations/d_cNmomJNEjw4om0MJbAiMNnh4 \
-u YOUR_PUBLIC_KEY:YOUR_SECRET_KEY
Response
{
"amount": 500,
"id": "d_cNmomJNEjw4om0MJbAiMNnh4",
"live_mode": true,
"nonprofit_id": "n_MUjmT5yhdf4smx1ykRwO2ovt",
"order_value": 2095,
"zip_code": "80660",
"external_id": null,
"metadata": {
"key": "value"
},
"currency": "USD"
}
Retrieve carbon offset stats
get /api/v1/donations/{id}/climate_stats
Measures your impact in relatable terms. Provide the id of the carbon offset to see stats about that specific donation. To see aggregated stats for all of your carbon offsets, see the /climate/stats endpoint.
Parameters
The id of a created carbon offset
Request
curl https://api.getchange.io/api/v1/donations/d_cNmomJNEjw4om0MJbAiMNnh4/climate_stats \
-u YOUR_PUBLIC_KEY:YOUR_SECRET_KEY
Response
{
"amount": 10000,
"trees": 163.9,
"co2_tonnes_offset": 10
}
Nonprofits
Most U.S. nonprofits exist in the CHANGE platform. Each nonprofit has a CHANGE-issued ID; these IDs are used to reference nonprofits throughout our APIs. You can search for nonprofits manually on the dashboard, or you can seach programmatically.
Show a nonprofit
get /api/v1/nonprofits/{id}
Retrieves information for a nonprofit. If a nonprofit does not accept crypto, the response will not include the crypto
field. For more information on cryptocurrency donations, please check out the Crypto section.
Parameters
The id of a nonprofit from the CHANGE network.
Request
curl https://api.getchange.io/api/v1/nonprofits/n_MUjmT5yhdf4smx1ykRwO2ovt \
-u YOUR_PUBLIC_KEY:YOUR_SECRET_KEY
Response
{
"icon_url": "https://d2m0e1zy3fwxmp.cloudfront.net/public-benefit.png",
"id": "n_MUjmT5yhdf4smx1ykRwO2ovt",
"name": "One Tree Planted Inc",
"ein": "464664562",
"pending_payout_amount": 1500,
"socials": {
"facebook": "onetreeplanted",
"instagram": "onetreeplanted",
"twitter": "onetreeplanted",
"youtube": "channel/UCSyNWLnxtob29DOoPGpT1Ug"
},
"email": "[email protected]",
"display_impact": [
"$1 sponsors one tree planted"
],
"crypto": {
"solana_address": "0x819c88a4b88f6b8df630f1c6a6b4a75be7f7ef99",
"ethereum_address": "0x4bd72768968401c737d7645ed0604df3095f5aa9"
},
"pending_payout_amounts": {
"USD": "1500.0",
"ETH": "0.04"
},
"address_line": "145 PINE HAVEN SHORES RD",
"city": "SHELBURNE",
"classification": "T22",
"mission": "Planting trees in areas that need support.",
"state": "VT",
"website": "WWW.ONETREEPLANTED.ORG",
"zip_code": "05482-7703",
"category": "public benefit",
"cover_image_url": null,
"logo_url": null
}
Request
curl https://api.getchange.io/api/v1/nonprofits/n_MUjmT5yhdf4smx1ykRwO2ovt \
-u YOUR_PUBLIC_KEY:YOUR_SECRET_KEY
Response
{
"icon_url": "https://d2m0e1zy3fwxmp.cloudfront.net/public-benefit.png",
"id": "n_MUjmT5yhdf4smx1ykRwO2ovt",
"name": "One Tree Planted Inc",
"ein": "464664562",
"pending_payout_amount": 0,
"socials": {
"facebook": "onetreeplanted",
"instagram": "onetreeplanted",
"twitter": "onetreeplanted",
"youtube": "channel/UCSyNWLnxtob29DOoPGpT1Ug"
},
"email": "[email protected]",
"display_impact": [
"$1 sponsors one tree planted"
],
"crypto": {
"solana_address": "0x27df207f5a52e95c51ff5cf1a73e699c815591e7",
"ethereum_address": "0x8607b80f1b75498fa855c20048e534c70e3815d3"
},
"pending_payout_amounts": {},
"address_line": "145 PINE HAVEN SHORES RD",
"city": "SHELBURNE",
"classification": "T22",
"mission": "Planting trees in areas that need support.",
"state": "VT",
"website": "WWW.ONETREEPLANTED.ORG",
"zip_code": "05482-7703",
"category": "public benefit",
"cover_image_url": "https://fake.cdn/0fr5d1rwa38lv6xyy5zz5gcgfnc5",
"logo_url": "https://fake.cdn/6ncppj1h8ge7j4pf3k8340fa0x29"
}
Request
curl https://api.getchange.io/api/v1/nonprofits/n_MUjmT5yhdf4smx1ykRwO2ovt \
-u YOUR_PUBLIC_KEY:YOUR_SECRET_KEY
Response
{
"icon_url": "https://d2m0e1zy3fwxmp.cloudfront.net/public-benefit.png",
"id": "n_MUjmT5yhdf4smx1ykRwO2ovt",
"name": "One Tree Planted Inc",
"ein": "464664562",
"pending_payout_amount": 0,
"socials": {
"facebook": "onetreeplanted",
"instagram": "onetreeplanted",
"twitter": "onetreeplanted",
"youtube": "channel/UCSyNWLnxtob29DOoPGpT1Ug"
},
"email": "[email protected]",
"display_impact": [
"$1 sponsors one tree planted"
],
"pending_payout_amounts": {},
"address_line": "145 PINE HAVEN SHORES RD",
"city": "SHELBURNE",
"classification": "T22",
"mission": "Planting trees in areas that need support.",
"state": "VT",
"website": "WWW.ONETREEPLANTED.ORG",
"zip_code": "05482-7703",
"category": "public benefit",
"cover_image_url": null,
"logo_url": null
}
Search a nonprofit
get /api/v1/nonprofits
Retrieves a list of nonprofits that match the search parameters. This endpoint is paginated.
Parameters
Your account's public key.
A string to search. This can be the name of a nonprofit, or an EIN. If you do not provide this parameter, you'll get featured nonprofits.
List of categories to search. Valid categories are: 'arts and culture'
, 'education'
, 'environment'
, 'animals'
, 'healthcare'
, 'human services'
, 'international affairs'
, 'public benefit'
, 'religion'
, 'mutual benefit'
, 'unclassified'
.
The page to return. This endpoint is paginated, and returns up to 30 nonprofits at a time.
Request
curl https://api.getchange.io/api/v1/nonprofits \
-d 'public_key=YOUR_PUBLIC_KEY&search_term=watsi&page=1' \
-G
Response
{
"nonprofits": [
{
"icon_url": "https://d2m0e1zy3fwxmp.cloudfront.net/healthcare.png",
"id": "n_IfEoPCaPqVsFAUI5xl0CBUOx",
"name": "Watsi",
"ein": "453236734",
"socials": {
"facebook": "Watsi.org",
"instagram": "watsi",
"twitter": "watsi"
},
"email": "[email protected]",
"display_impact": [
"$100 sponsors one surgery performed"
],
"crypto": {
"solana_address": "0xb47e73fffb82d2485005a7c2b58db5067ad61cff",
"ethereum_address": "0x048253a16829a5c0f8ed8c273c341fc75985504e"
},
"address_line": "548 Market St # 75903",
"city": "San Francisco",
"classification": "E12",
"mission": "Directly connecting people through technology to provide global access to healthcare.",
"state": "CA",
"website": "https://watsi.org/",
"zip_code": "94104",
"category": "healthcare",
"cover_image_url": null,
"logo_url": null,
"stats": [
"$100 sponsors one surgery performed"
]
}
],
"page": 1
}
Request
curl https://api.getchange.io/api/v1/nonprofits \
-d 'public_key=YOUR_PUBLIC_KEY' \
-G
Response
{
"nonprofits": [
{
"icon_url": "https://d2m0e1zy3fwxmp.cloudfront.net/healthcare.png",
"id": "n_IfEoPCaPqVsFAUI5xl0CBUOx",
"name": "Watsi",
"ein": "453236734",
"socials": {
"facebook": "Watsi.org",
"instagram": "watsi",
"twitter": "watsi"
},
"email": "[email protected]",
"display_impact": [
"$100 sponsors one surgery performed"
],
"crypto": {
"solana_address": "0xb960679cb6397b1ec64bfdb744f76ff03b1b6713",
"ethereum_address": "0xe1bec32b2c944201d6215916798c9330dd540062"
},
"address_line": "548 Market St # 75903",
"city": "San Francisco",
"classification": "E12",
"mission": "Directly connecting people through technology to provide global access to healthcare.",
"state": "CA",
"website": "https://watsi.org/",
"zip_code": "94104",
"category": "healthcare",
"cover_image_url": null,
"logo_url": null,
"stats": [
"$100 sponsors one surgery performed"
]
}
],
"page": 1
}
Request
curl https://api.getchange.io/api/v1/nonprofits \
-d 'public_key=YOUR_PUBLIC_KEY&search_term=45-3236734' \
-G
Response
{
"nonprofits": [
{
"icon_url": "https://d2m0e1zy3fwxmp.cloudfront.net/healthcare.png",
"id": "n_IfEoPCaPqVsFAUI5xl0CBUOx",
"name": "Watsi",
"ein": "453236734",
"socials": {
"facebook": "Watsi.org",
"instagram": "watsi",
"twitter": "watsi"
},
"email": "[email protected]",
"display_impact": [
"$100 sponsors one surgery performed"
],
"crypto": {
"solana_address": "0x7c308e2e88c6e24a00b760dd27152f5a9d540a07",
"ethereum_address": "0xdc7265ac5cc2ea096039da73ae699614a54cbb52"
},
"address_line": "548 Market St # 75903",
"city": "San Francisco",
"classification": "E12",
"mission": "Directly connecting people through technology to provide global access to healthcare.",
"state": "CA",
"website": "https://watsi.org/",
"zip_code": "94104",
"category": "healthcare",
"cover_image_url": null,
"logo_url": null,
"stats": [
"$100 sponsors one surgery performed"
]
}
],
"page": 1
}
Request
curl https://api.getchange.io/api/v1/nonprofits \
-d 'public_key=YOUR_PUBLIC_KEY&categories[]=healthcare&categories[]=arts and culture' \
-G
Response
{
"nonprofits": [
{
"icon_url": "https://d2m0e1zy3fwxmp.cloudfront.net/healthcare.png",
"id": "n_IfEoPCaPqVsFAUI5xl0CBUOx",
"name": "Watsi",
"ein": "453236734",
"socials": {
"facebook": "Watsi.org",
"instagram": "watsi",
"twitter": "watsi"
},
"email": "[email protected]",
"display_impact": [
"$100 sponsors one surgery performed"
],
"crypto": {
"solana_address": "0x85156bafbeabfda7a336d4c94e7878e867c40651",
"ethereum_address": "0xa7db9f0fd84f0fd5fe79833aa213c4f4490ad17c"
},
"address_line": "548 Market St # 75903",
"city": "San Francisco",
"classification": "E12",
"mission": "Directly connecting people through technology to provide global access to healthcare.",
"state": "CA",
"website": "https://watsi.org/",
"zip_code": "94104",
"category": "healthcare",
"cover_image_url": null,
"logo_url": null,
"stats": [
"$100 sponsors one surgery performed"
]
}
],
"page": 1
}
Get social media content
get /api/v1/nonprofits/{id}/social_media_content
Retrieves social media content for the given nonprofit. CHANGE generates ready-to-post, social-media optimized images that are customized with your company name. This endpoint is not authenticated; pass your account's public key as a parameter instead. Note that this endpoint does not post anything to social media.
Parameters
The id of a nonprofit from the CHANGE network.
Your account's public key.
For Marketplace API donations only. The id of the managed account.
Request
curl https://api.getchange.io/api/v1/nonprofits/n_IfEoPCaPqVsFAUI5xl0CBUOx/social_media_content \
-d 'public_key=YOUR_PUBLIC_KEY' \
-G
Response
[
{
"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"
}
]
Create an Instant Payout
post /api/v1/nonprofits/{id}/instant_payouts
Immediately starts a payout to a nonprofit. Normally, nonprofits are paid once per month. If you want a nonprofit to receive your donations sooner, use this endpoint. You will receive an invoice for the donation funds within 24 hours of using this endpoint.
Parameters
The id of a nonprofit from the CHANGE network.
Request
curl https://api.getchange.io/api/v1/nonprofits/n_IfEoPCaPqVsFAUI5xl0CBUOx/instant_payouts \
-u YOUR_PUBLIC_KEY:YOUR_SECRET_KEY \
-H "Content-Type: application/json" \
-X POST
Response
{
"instant_payouts": [
{
"name": "Do Good Donuts",
"account_id": "a_X6B8hSNtK8DBfdSdJ8z4aiXT",
"amount": 3000,
"currency": "USD",
"status": "pending"
}
]
}
List your Instant Payouts
get /api/v1/nonprofits/{id}/instant_payouts
Retrieves a list of instant payouts you've previously made that are either pending or complete for the last month. The instant payouts are returned in order of creation, with the most recent instant payouts appearing first.
Parameters
The id of a nonprofit from the CHANGE network.
Request
curl https://api.getchange.io/api/v1/nonprofits/n_IfEoPCaPqVsFAUI5xl0CBUOx/instant_payouts \
-u YOUR_PUBLIC_KEY:YOUR_SECRET_KEY
Response
{
"instant_payouts": [
{
"name": "Do Good Donuts",
"account_id": "a_3u2G4XpymhRKKcjb1rhayDhx",
"amount": 4000,
"currency": "USD",
"status": "pending"
},
{
"name": "Do Good Donuts",
"account_id": "a_3u2G4XpymhRKKcjb1rhayDhx",
"amount": 12000,
"currency": "USD",
"status": "complete"
}
]
}
Nonprofit Requests
If a nonprofit you like isn't in our system, you can request it. We'll review your request, and if everything checks out, we'll add it to our system.
Request a nonprofit
post /api/v1/nonprofit_requests
Requests a nonprofit.
Parameters
The name of the nonprofit.
The EIN of the nonprofit.
The address of the nonprofit.
The city the nonprofit is in.
The state the nonprofit is in.
The NTEE code for the nonprofit.
The mission of the nonprofit.
The social handles of the nonprofit. Accepted keys are: facebook, instagram, tiktok, twitter, youtube.
The website of the nonprofit.
A contact email for the nonprofit.
An email address to use for the nonprofit's payouts.
The URL of an image that represents the nonprofit.
Request
curl https://api.getchange.io/api/v1/nonprofit_requests \
-u YOUR_PUBLIC_KEY:YOUR_SECRET_KEY \
-H "Content-Type: application/json" \
-d '{
"name": "Do Good",
"ein": "123-45678",
"address_line": "123 Charity Ln",
"city": "San Francisco",
"state": "CA",
"classification": "N12",
"mission": "To do more good.",
"socials": {
"twitter": "dogooderz"
},
"website": "dogood.org"
}'
Response
{
"result": {
"address_line": "123 Charity Ln",
"city": "San Francisco",
"classification": "N12",
"contact_email": null,
"ein": "123-45678",
"image_url": null,
"mission": "To do more good.",
"name": "Do Good",
"payout_email": null,
"socials": {
"twitter": "dogooderz"
},
"status": "pending",
"website": "dogood.org",
"id": "nr_M2SxpXLN8D9egnTPaKbQ936U"
}
}
List your nonprofit requests
get /api/v1/nonprofit_requests
Retrieves your nonprofit requests. Check the status
field for the current status of the request. For accepted
requests, the nonprofit_id
field will be populated with your requested nonprofit's Change ID.
Parameters
Request
curl https://api.getchange.io/api/v1/nonprofit_requests \
-u YOUR_PUBLIC_KEY:YOUR_SECRET_KEY
Response
{
"result": [
{
"address_line": "123 Charity Ln",
"city": "San Francisco",
"classification": "N12",
"contact_email": "[email protected]",
"ein": "123-45678",
"image_url": null,
"mission": "To do more good.",
"name": "Do Good",
"payout_email": null,
"socials": {
"twitter": "dogooderz"
},
"status": "pending",
"website": "dogood.org",
"id": "nr_YdehkEfJrYI2n7meNKXcCAaJ"
}
]
}
Show a nonprofit request
get /api/v1/nonprofit_requests/{id}
Retrieves a nonprofit request. Check the status
field for the current status of the request. For accepted
requests, the nonprofit_id
field will be populated with your requested nonprofit's Change ID.
Parameters
The id of a nonprofit request.
Request
curl https://api.getchange.io/api/v1/nonprofit_requests/nr_IaL2wWiGo87x6PFYZbCujXBU \
-u YOUR_PUBLIC_KEY:YOUR_SECRET_KEY
Response
{
"result": {
"address_line": "123 Charity Ln",
"city": "San Francisco",
"classification": "N12",
"contact_email": "[email protected]",
"ein": "123-45678",
"image_url": null,
"mission": "To do more good.",
"name": "Do Good",
"payout_email": null,
"socials": {
"twitter": "dogooderz"
},
"status": "pending",
"website": "dogood.org",
"id": "nr_IaL2wWiGo87x6PFYZbCujXBU"
}
}
Request
curl https://api.getchange.io/api/v1/nonprofit_requests/nr_uWeBcytWzl3Mzz9eDIb53NP1 \
-u YOUR_PUBLIC_KEY:YOUR_SECRET_KEY
Response
{
"result": {
"address_line": "123 Charity Ln",
"city": "San Francisco",
"classification": "N12",
"contact_email": "[email protected]",
"ein": "123-45678",
"image_url": null,
"mission": "To do more good.",
"name": "Do Good",
"payout_email": null,
"socials": {
"twitter": "dogooderz"
},
"status": "accepted",
"website": "dogood.org",
"id": "nr_uWeBcytWzl3Mzz9eDIb53NP1",
"nonprofit_id": "n_dogoodNYuz2muIDefYkvkP02"
}
}
Request
curl https://api.getchange.io/api/v1/nonprofit_requests/nr_am9D6FZf59zlzjJqCdDpD3I9 \
-u YOUR_PUBLIC_KEY:YOUR_SECRET_KEY
Response
{
"result": {
"address_line": "123 Charity Ln",
"city": "San Francisco",
"classification": "N12",
"contact_email": "[email protected]",
"ein": "123-45678",
"image_url": null,
"mission": "To do more good.",
"name": "Do Good",
"payout_email": null,
"socials": {
"twitter": "dogooderz"
},
"status": "rejected",
"website": "dogood.org",
"id": "nr_am9D6FZf59zlzjJqCdDpD3I9"
}
}
Climate
Our Climate API helps you make donations that offset your carbon consumption, whether you're shipping physical items or executing cryptocurrency transactions. You can also get understandable stats about your contributions to the environment that are easy to share with your users.
Draft a shipping carbon offset
get /api/v1/climate/shipping_offset
If you want to calculate and donate a carbon offset in one step, skip to Create a Shipping Offset. Drafts a carbon offset for the amount needed to offset a physical shipment. The amount depends on the weight, primary transportation method, and distance of the shipment. Provide the distance of the shipment using the origin and destination address, or directly with the number of miles. This endpoint returns the id of the drafted carbon offset that remains valid for one week. You can capture a drafted carbon offset by providing the id when you create a shipping offset. See the Carbon offsets guide for more on using this endpoint.
Parameters
air|truck|rail|sea
The primary transportation method of the shipment. The default is air
.
The total weight (in pounds) of the shipment.
The destination zip code (US only) of the shipment. If you send this parameter, also send origin_address
.
The total distance (in miles) of the shipment. You can use this parameter in place of origin_address
and destination_address
.
The origin zip code (US only) of the shipment. If you send this parameter, also send destination_address
.
For Marketplace API donations only. The id of the managed account.
Request
curl https://api.getchange.io/api/v1/climate/shipping_offset \
-u YOUR_PUBLIC_KEY:YOUR_SECRET_KEY \
-d 'transportation_method=air&weight_lb=15&destination_address=94133&origin_address=60148' \
-G
Response
{
"amount": 18,
"live_mode": true,
"offset_id": "offset_WlTGrRgFep5x8pCgMzu4Wg0B"
}
Request
curl https://api.getchange.io/api/v1/climate/shipping_offset \
-u YOUR_PUBLIC_KEY:YOUR_SECRET_KEY \
-d 'transportation_method=air&weight_lb=15&destination_address=94133&origin_address=60148&account_id=a_RGpSIp1aZBGyDnCZWF4byxEG' \
-G
Response
{
"amount": 18,
"live_mode": true,
"offset_id": "offset_yk8t1EY29DseXpvQlzvUI5MH",
"account_id": "a_RGpSIp1aZBGyDnCZWF4byxEG"
}
Create a shipping carbon offset
post /api/v1/climate/shipping_offset
Makes a donation to verified carbon reduction projects to offset the carbon emissions of a physical shipment. The amount depends on the weight, primary transportation method, and distance of the shipment. Provide the distance of the shipment using the origin and destination address, or directly with the number of miles. If you already drafted a carbon offset, just pass the offset ID.
Parameters
Whether you are collecting payment for the carbon offset. This helps us issue the correct tax receipt at the end of the year.
The destination zip code (US only) of the shipment. If you send this parameter, also send origin_address
.
The total distance (in miles) of the shipment. You can use this parameter in place of origin_address
and destination_address
.
The ID for a drafted carbon offset. You can use this parameter in place of origin_address
, destination_address
, distance_mi
, transporation_method
and weight_lb
.
The origin zip code (US only) of the shipment. If you send this parameter, also send destination_address
.
A list of carbon offset objects to process a batch of carbon offsets at once.
An external ID associated with the donation, e.g. an order ID, SKU, or customer ID.
Cart or order volume (in cents) associated with the donation. CHANGE provides AOV metrics if order values are provided.
The primary transportation method of the shipment. The default is air
.
The total weight (in pounds) of the shipment.
The customer's zip code. Provide this to unlock geographic insights. This field is not used to calculate the shipping offset.
BETA: The ID for the project type you are looking to support.
For Marketplace API donations only. The id of the managed account.
Request
curl https://api.getchange.io/api/v1/climate/shipping_offset \
-u YOUR_PUBLIC_KEY:YOUR_SECRET_KEY \
-H "Content-Type: application/json" \
-d '{
"funds_collected": false,
"destination_address": 94133,
"origin_address": 60148,
"external_id": "customer_1234",
"order_value": 2599,
"transportation_method": "air",
"weight_lb": 15,
"zip_code": "94104"
}'
Response
{
"amount": 18,
"id": "c_XgeEhgolxylFGSM3KoFF6FZl",
"live_mode": true,
"nonprofit_id": "n_F6VhFP1nlN5V1Sr92CEQ3xom",
"order_value": 2599,
"zip_code": "94104",
"external_id": "customer_1234",
"metadata": {},
"currency": "USD"
}
Request
curl https://api.getchange.io/api/v1/climate/shipping_offset \
-u YOUR_PUBLIC_KEY:YOUR_SECRET_KEY \
-H "Content-Type: application/json" \
-d '{
"funds_collected": false,
"distance_mi": 2111,
"external_id": "customer_1234",
"order_value": 2599,
"weight_lb": 15,
"zip_code": "94104"
}'
Response
{
"amount": 18,
"id": "c_yhwFZz4nFqg1j4KHVxBpN3Ft",
"live_mode": true,
"nonprofit_id": "n_F6VhFP1nlN5V1Sr92CEQ3xom",
"order_value": 2599,
"zip_code": "94104",
"external_id": "customer_1234",
"metadata": {},
"currency": "USD"
}
Request
curl https://api.getchange.io/api/v1/climate/shipping_offset \
-u YOUR_PUBLIC_KEY:YOUR_SECRET_KEY \
-H "Content-Type: application/json" \
-d '{
"funds_collected": false,
"offset_id": "offset_7LlbnLJRbh0b3lDItbkx0Pcg",
"external_id": "customer_1234",
"order_value": 2599,
"zip_code": "94104"
}'
Response
{
"amount": 42,
"id": "c_LtYTZzlNVg8cPMtAyMKgqHXz",
"live_mode": true,
"nonprofit_id": "n_F6VhFP1nlN5V1Sr92CEQ3xom",
"order_value": 2599,
"zip_code": "94104",
"external_id": "customer_1234",
"metadata": {},
"currency": "USD"
}
Request
curl https://api.getchange.io/api/v1/climate/shipping_offset \
-u YOUR_PUBLIC_KEY:YOUR_SECRET_KEY \
-H "Content-Type: application/json" \
-d '{
"funds_collected": false,
"distance_mi": 2111,
"external_id": "customer_1234",
"order_value": 2599,
"weight_lb": 15,
"zip_code": "94104",
"project_id": "p_X63eU7aygWDEk530SAomKs9C"
}'
Response
{
"amount": 18,
"id": "c_6Ija3Q4B8AwHv3OpOQQSB8Zr",
"live_mode": true,
"nonprofit_id": "n_F6VhFP1nlN5V1Sr92CEQ3xom",
"order_value": 2599,
"zip_code": "94104",
"external_id": "customer_1234",
"metadata": {},
"currency": "USD"
}
Request
curl https://api.getchange.io/api/v1/climate/shipping_offset \
-u YOUR_PUBLIC_KEY:YOUR_SECRET_KEY \
-H "Content-Type: application/json" \
-d '{
"funds_collected": false,
"distance_mi": 2111,
"external_id": "customer_1234",
"order_value": 2599,
"weight_lb": 15,
"zip_code": "94104",
"account_id": "a_uVFTsx6EXPM6M4GLNSBfR7uQ"
}'
Response
{
"amount": 18,
"id": "c_DD0vFlfXgTEBJnujjVMcVybV",
"live_mode": true,
"nonprofit_id": "n_F6VhFP1nlN5V1Sr92CEQ3xom",
"order_value": 2599,
"zip_code": "94104",
"external_id": "customer_1234",
"metadata": {},
"currency": "USD",
"account_id": "a_uVFTsx6EXPM6M4GLNSBfR7uQ"
}
Draft a crypto carbon offset
get /api/v1/climate/crypto_offset
If you want to calculate and donate a carbon offset in one step, skip to Create a Crypto Offset. Drafts a carbon offset for the amount needed to offset a cryptocurrency transaction. This endpoint returns the id of the drafted carbon offset that remains valid for one week. You can capture a drafted carbon offset by providing the id when you create a crypto offset. See the Carbon offsets guide for more on using this endpoint.
Parameters
eth|btc|sol
The currency of the transaction.
The number of transactions to offset. Default is 1.
For Marketplace API donations only. The id of the managed account.
Request
curl https://api.getchange.io/api/v1/climate/crypto_offset \
-u YOUR_PUBLIC_KEY:YOUR_SECRET_KEY \
-d 'currency=eth&count=2' \
-G
Response
{
"amount": 124,
"live_mode": true,
"offset_id": "offset_u05xjOpXqadJDicOlNZIqv89"
}
Request
curl https://api.getchange.io/api/v1/climate/crypto_offset \
-u YOUR_PUBLIC_KEY:YOUR_SECRET_KEY \
-d 'currency=eth&count=2&account_id=a_cMZpQkopInUOKty0q0mgay05' \
-G
Response
{
"amount": 124,
"live_mode": true,
"offset_id": "offset_7U1ZYZ2WpmcCq12bot38Aq4l",
"account_id": "a_cMZpQkopInUOKty0q0mgay05"
}
Create a crypto carbon offset
post /api/v1/climate/crypto_offset
Makes a donation to verified carbon reduction projects to offset the carbon emissions due to a cryptocurrency transaction. The amount depends on the number of transactions and currency. If you already drafted a carbon offset, just pass the offset ID.
Parameters
Whether you are collecting payment for the carbon offset. This helps us issue the correct tax receipt at the end of the year.
The number of transactions to offset.
The currency of the transaction.
The ID for a drafted carbon offset. You can use this parameter in place of currency
and count
.
The customer's zip code. Provide this to unlock geographic insights.
Cart or order volume (in cents) associated with the donation. CHANGE provides AOV metrics if order values are provided.
An external ID associated with the donation, e.g. an order ID, SKU, or customer ID.
For Marketplace API donations only. The id of the managed account.
Request
curl https://api.getchange.io/api/v1/climate/crypto_offset \
-u YOUR_PUBLIC_KEY:YOUR_SECRET_KEY \
-H "Content-Type: application/json" \
-d '{
"funds_collected": false,
"count": 2,
"currency": "eth",
"zip_code": "94104",
"order_value": 2599,
"external_id": "customer_1234"
}'
Response
{
"amount": 62,
"id": "c_1ftLBu7J5ZHL4fgvqUjjltMy",
"live_mode": true,
"order_value": 2599,
"zip_code": "94104",
"external_id": "customer_1234",
"metadata": {},
"currency": "USD",
"count": 2,
"total_amount": 124
}
Request
curl https://api.getchange.io/api/v1/climate/crypto_offset \
-u YOUR_PUBLIC_KEY:YOUR_SECRET_KEY \
-H "Content-Type: application/json" \
-d '{
"funds_collected": false,
"offset_id": "offset_OtwOL02DAdy6jdu7QR5vc8sH",
"zip_code": "94104",
"order_value": 2599,
"external_id": "customer_1234"
}'
Response
{
"amount": 42,
"id": "c_XC8quvZahKAzO2ZNb0SG0Ish",
"live_mode": true,
"order_value": 2599,
"zip_code": "94104",
"external_id": "customer_1234",
"metadata": {},
"currency": "USD"
}
Request
curl https://api.getchange.io/api/v1/climate/crypto_offset \
-u YOUR_PUBLIC_KEY:YOUR_SECRET_KEY \
-H "Content-Type: application/json" \
-d '{
"funds_collected": false,
"count": 2,
"currency": "eth",
"zip_code": "94104",
"order_value": 2599,
"external_id": "customer_1234",
"account_id": "a_UJQD9lfRVUA3UlVcIPVVzo9v"
}'
Response
{
"amount": 62,
"id": "c_j2IyEPPPAEUPh13StsBQRZHw",
"live_mode": true,
"order_value": 2599,
"zip_code": "94104",
"external_id": "customer_1234",
"metadata": {},
"currency": "USD",
"account_id": "a_UJQD9lfRVUA3UlVcIPVVzo9v",
"count": 2,
"total_amount": 124
}
Retrieve carbon offset stats
get /api/v1/climate/stats
Measures your impact in relatable terms. Returns aggregate stats for all of your carbon offsets. To see stats about a specific carbon offset, see the donations/{id}/climate_stats endpoint.
Parameters
Request
curl https://api.getchange.io/api/v1/climate/stats \
-u YOUR_PUBLIC_KEY:YOUR_SECRET_KEY
Response
{
"amount": 1000000,
"trees": 16393.4,
"co2_tonnes_offset": 1000
}
Marketplace
BETA - Our Marketplace API allows you to power donations on your platform with managed accounts. A parent account can create donations and fetch analytics on behalf of its managed accounts. Managed accounts can directly connect their bank accounts to fund donations. From fundraising platforms to ridesharing apps, the Marketplace API makes it easy to manage donations across a network of users.
Create a managed account
post /api/v1/accounts
Creates a managed account. Managed accounts can be used in marketplace integrations.
Parameters
The email of the account holder.
The name of the account holder.
Request
curl https://api.getchange.io/api/v1/accounts \
-u YOUR_PUBLIC_KEY:YOUR_SECRET_KEY \
-H "Content-Type: application/json" \
-d '{
"email": "[email protected]",
"name": "Jane Doe"
}'
Response
{
"id": "a_pBazsp5GKyuJEroXZHy2yu69",
"name": "Jane Doe",
"active": false,
"email": "[email protected]",
"signed_agreement": false,
"sign_page_url": "",
"saved_payment_method": false
}
Create a link bank token
post /api/v1/accounts/{id}/link_bank_token
Creates a link token for the account. Link tokens are used on the client for connecting bank accounts via Plaid Link. See the Build a Marketplace recipe for usage instructions.
Parameters
The id of an account. Ids are returned when an account is created.
Request
curl https://api.getchange.io/api/v1/accounts/a_Q9k0OEJkJhqaeBjMMrZaP6FV/link_bank_token \
-u YOUR_PUBLIC_KEY:YOUR_SECRET_KEY \
-H "Content-Type: application/json" \
-X POST
Response
"link-sandbox-db9294a8-e0d6-408e-8d26-9471d7759165"
Attach a bank to a managed account
post /api/v1/accounts/attach_bank_account
Attaches a bank account to a managed account via bank link token. See the Build a Marketplace recipe for usage instructions. This endpoint is in beta, and may be priced differently.
Parameters
A link token from Change. Generate link tokens using the Create a link bank token endpoint.
A public token generated by Plaid. See the Build a Marketplace recipe to learn how to get this token.
A bank account id generated by Plaid. See the Build a Marketplace recipe to learn how to get this token.
Request
curl https://api.getchange.io/api/v1/accounts/attach_bank_account \
-H "Content-Type: application/json" \
-d '{
"link_token": "link-sandbox-000000000000000000000000000000000000",
"plaid_public_token": "public-sandbox-000000000000000000000000000000000000",
"bank_account_id": "1111111111111111111111111111111111111"
}'
Response
{
"id": "a_v6cjLD1pbs6cBJr16Gl3uwoz",
"name": "KuhicBeattyandSchoen",
"active": true,
"email": "[email protected]",
"signed_agreement": true,
"sign_page_url": "",
"saved_payment_method": true
}
Reports
See the impact you've made with the Reports API. Generate reports that summarize your giving in relatable terms.
Fetch impact report
get /api/v1/reports/impact
Fetches a report detailing the aggregated impact of your donations.
Parameters
An account id to filter donations that are included in the report. Leave this blank to include all donations made by you or your managed accounts.
An external id to filter donations that are included in the report.
Starting timestamp of data to be included in the report. Send as a unix timestamp.
Ending timestamp of data to be included in the report. Send as a unix timestamp.
Request
curl https://api.getchange.io/api/v1/reports/impact \
-u YOUR_PUBLIC_KEY:YOUR_SECRET_KEY
Response
{
"data": [
{
"icon_url": "https://d2m0e1zy3fwxmp.cloudfront.net/public-benefit.png",
"id": "n_MUjmT5yhdf4smx1ykRwO2ovt",
"name": "One Tree Planted Inc",
"ein": "464664562",
"socials": {
"facebook": "onetreeplanted",
"instagram": "onetreeplanted",
"twitter": "onetreeplanted",
"youtube": "channel/UCSyNWLnxtob29DOoPGpT1Ug"
},
"email": "[email protected]",
"display_impact": [
"$1 sponsors one tree planted"
],
"crypto": {
"solana_address": "0x44a22f5fda840455432179b77cb6d7ffa4986a72",
"ethereum_address": "0x886b6aa6fbd2f991fe4a26ac6aed220f864a6199"
},
"address_line": "145 PINE HAVEN SHORES RD",
"city": "SHELBURNE",
"classification": "T22",
"mission": "Planting trees in areas that need support.",
"state": "VT",
"website": "WWW.ONETREEPLANTED.ORG",
"zip_code": "05482-7703",
"category": "public benefit",
"cover_image_url": null,
"logo_url": null,
"display_aggregate_impact": [
"326.7 trees planted"
]
},
{
"icon_url": "https://d2m0e1zy3fwxmp.cloudfront.net/healthcare.png",
"id": "n_nIstMceV5IXNWwMOzomgHEEV",
"name": "Aim For Mental Health Inc",
"ein": "473992060",
"socials": {
"facebook": "AIMforMentalHealth",
"instagram": "aimmentalhealth",
"twitter": "AimMentalHealth",
"youtube": "channel/UCoBov-MpEPB14BrIWY96m5A"
},
"email": null,
"display_impact": [
"therapy sessions",
"$7 sponsors one book for a child",
"$0.10 sponsors one pencil for a test taker in need",
"trips to San Francisco"
],
"crypto": {
"solana_address": "0x9212f14c158f3d68e2ab720207a5b0896b96483c",
"ethereum_address": "0x30919ec44285bb22a208e7d96ad14ae5efc9b285"
},
"address_line": "PO BOX 4235",
"city": "CARMEL",
"classification": "F32",
"mission": "We find and fund the most promising youth mental health research in the world so we can find real solutions with immediate impacts. We raise awareness within our communities regarding the mental health crisis among our youth.",
"state": "CA",
"website": "WWW.AIMFORMENTALHEALTH.ORG",
"zip_code": "93921-4235",
"category": "healthcare",
"cover_image_url": null,
"logo_url": null,
"display_aggregate_impact": [
"therapy sessions",
"68.4 books for children",
"4,790 pencils for test takers in need",
"trips to San Francisco"
]
}
],
"filters": {
"end_timestamp": 1651534907
}
}
Request
curl https://api.getchange.io/api/v1/reports/impact \
-u YOUR_PUBLIC_KEY:YOUR_SECRET_KEY \
-d 'account_id=a_nMDCJPozxeENsuD0zM1sSWUx' \
-G
Response
{
"data": [
{
"icon_url": "https://d2m0e1zy3fwxmp.cloudfront.net/public-benefit.png",
"id": "n_MUjmT5yhdf4smx1ykRwO2ovt",
"name": "One Tree Planted Inc",
"ein": "464664562",
"socials": {
"facebook": "onetreeplanted",
"instagram": "onetreeplanted",
"twitter": "onetreeplanted",
"youtube": "channel/UCSyNWLnxtob29DOoPGpT1Ug"
},
"email": "[email protected]",
"display_impact": [
"$1 sponsors one tree planted"
],
"crypto": {
"solana_address": "0x051d758f016e9d914b3c51e0910d2b0e124b1bd6",
"ethereum_address": "0x7db0ca64c649d0ebd5b3ed1009fa3727b17b2a44"
},
"address_line": "145 PINE HAVEN SHORES RD",
"city": "SHELBURNE",
"classification": "T22",
"mission": "Planting trees in areas that need support.",
"state": "VT",
"website": "WWW.ONETREEPLANTED.ORG",
"zip_code": "05482-7703",
"category": "public benefit",
"cover_image_url": null,
"logo_url": null,
"display_aggregate_impact": [
"326.7 trees planted"
]
},
{
"icon_url": "https://d2m0e1zy3fwxmp.cloudfront.net/healthcare.png",
"id": "n_nIstMceV5IXNWwMOzomgHEEV",
"name": "Aim For Mental Health Inc",
"ein": "473992060",
"socials": {
"facebook": "AIMforMentalHealth",
"instagram": "aimmentalhealth",
"twitter": "AimMentalHealth",
"youtube": "channel/UCoBov-MpEPB14BrIWY96m5A"
},
"email": null,
"display_impact": [
"therapy sessions",
"$7 sponsors one book for a child",
"$0.10 sponsors one pencil for a test taker in need",
"trips to San Francisco"
],
"crypto": {
"solana_address": "0x50c7c570f685472ec4f2d4ea1bcbe577c270c250",
"ethereum_address": "0x07b431f7f7b11a27ff18efa52e2607c5cd7e5ec9"
},
"address_line": "PO BOX 4235",
"city": "CARMEL",
"classification": "F32",
"mission": "We find and fund the most promising youth mental health research in the world so we can find real solutions with immediate impacts. We raise awareness within our communities regarding the mental health crisis among our youth.",
"state": "CA",
"website": "WWW.AIMFORMENTALHEALTH.ORG",
"zip_code": "93921-4235",
"category": "healthcare",
"cover_image_url": null,
"logo_url": null,
"display_aggregate_impact": [
"therapy sessions",
"68.4 books for children",
"4,790 pencils for test takers in need",
"trips to San Francisco"
]
}
],
"filters": {
"account_id": "a_nMDCJPozxeENsuD0zM1sSWUx",
"end_timestamp": 1651534907
}
}
Request
curl https://api.getchange.io/api/v1/reports/impact \
-u YOUR_PUBLIC_KEY:YOUR_SECRET_KEY \
-d 'start_timestamp=1651448507&end_timestamp=1651621307' \
-G
Response
{
"data": [
{
"icon_url": "https://d2m0e1zy3fwxmp.cloudfront.net/public-benefit.png",
"id": "n_MUjmT5yhdf4smx1ykRwO2ovt",
"name": "One Tree Planted Inc",
"ein": "464664562",
"socials": {
"facebook": "onetreeplanted",
"instagram": "onetreeplanted",
"twitter": "onetreeplanted",
"youtube": "channel/UCSyNWLnxtob29DOoPGpT1Ug"
},
"email": "[email protected]",
"display_impact": [
"$1 sponsors one tree planted"
],
"crypto": {
"solana_address": "0xd1e8ebc9ca0b4c997c8074ed18ce3c088c701ec8",
"ethereum_address": "0xbe45f16bcd8be3f2b307dd634447d1e746d8bea7"
},
"address_line": "145 PINE HAVEN SHORES RD",
"city": "SHELBURNE",
"classification": "T22",
"mission": "Planting trees in areas that need support.",
"state": "VT",
"website": "WWW.ONETREEPLANTED.ORG",
"zip_code": "05482-7703",
"category": "public benefit",
"cover_image_url": null,
"logo_url": null,
"display_aggregate_impact": [
"326.7 trees planted"
]
},
{
"icon_url": "https://d2m0e1zy3fwxmp.cloudfront.net/healthcare.png",
"id": "n_nIstMceV5IXNWwMOzomgHEEV",
"name": "Aim For Mental Health Inc",
"ein": "473992060",
"socials": {
"facebook": "AIMforMentalHealth",
"instagram": "aimmentalhealth",
"twitter": "AimMentalHealth",
"youtube": "channel/UCoBov-MpEPB14BrIWY96m5A"
},
"email": null,
"display_impact": [
"therapy sessions",
"$7 sponsors one book for a child",
"$0.10 sponsors one pencil for a test taker in need",
"trips to San Francisco"
],
"crypto": {
"solana_address": "0x6aa57a522c88c25ac007ac13e9cad21ec7cc1887",
"ethereum_address": "0xf5968da41806640e6244670f1ea0a993913190df"
},
"address_line": "PO BOX 4235",
"city": "CARMEL",
"classification": "F32",
"mission": "We find and fund the most promising youth mental health research in the world so we can find real solutions with immediate impacts. We raise awareness within our communities regarding the mental health crisis among our youth.",
"state": "CA",
"website": "WWW.AIMFORMENTALHEALTH.ORG",
"zip_code": "93921-4235",
"category": "healthcare",
"cover_image_url": null,
"logo_url": null,
"display_aggregate_impact": [
"therapy sessions",
"68.4 books for children",
"4,790 pencils for test takers in need",
"trips to San Francisco"
]
}
],
"filters": {
"start_timestamp": 1651448507,
"end_timestamp": 1651621307
}
}
Prebuilt Pages
Our prebuilt pages allow you to easily accept donations without integrating a payment processor.
Create a checkout link
post /api/v1/payments/checkout_link
Creates a Stripe Checkout link to collect donations for a specific nonprofit. Donation processing fees are automatically deducted from the collected amount.
Parameters
The amount of the donation in cents.
The url the donor will be redirected to if they cancel checkout.
The id of a nonprofit from the Change network.
The url the donor will be redirected to upon a successful donation.
Request
curl https://api.getchange.io/api/v1/payments/checkout_link \
-u YOUR_PUBLIC_KEY:YOUR_SECRET_KEY \
-H "Content-Type: application/json" \
-d '{
"amount": 500,
"cancel_url": "your-domain.com/cancel",
"nonprofit_id": "n_IfEoPCaPqVsFAUI5xl0CBUOx",
"success_url": "your-domain.com/success"
}'
Response
{
"checkout_url": "https://checkout.stripe.com/pay/cs_123"
}
Request
curl https://api.getchange.io/api/v1/payments/checkout_link \
-u YOUR_PUBLIC_KEY:YOUR_SECRET_KEY \
-H "Content-Type: application/json" \
-d '{
"cancel_url": "your-domain.com/cancel",
"nonprofit_id": "n_IfEoPCaPqVsFAUI5xl0CBUOx",
"success_url": "your-domain.com/success"
}'
Response
{
"status": 400,
"code": "amount_required",
"title": "Param 'amount' can't be blank."
}
Create a crypto checkout link
post /api/v1/payments/crypto_checkout_link
BETA ACCESS ONLY. Creates a Coinbase Checkout link to collect donations for a specific nonprofit. Donation processing fees are automatically deducted from the collected amount. Accepted currencies include Bitcoin, Bitcoin Cash, Dai, Dogecoin, Ethereum, Litecoin, and USD Coin. If a nonprofit does not accept crypto, this endpoint with respond with an error. Check if a nonprofit accepts crypto using the /nonprofits/{id} endpoint.
Parameters
The amount of the donation in cents.
The id of a nonprofit from the Change network.
A set of key-value pairs that you can attach to a donation. This information will be returned in a webhook upon successful payment.
Request
curl https://api.getchange.io/api/v1/payments/crypto_checkout_link \
-u YOUR_PUBLIC_KEY:YOUR_SECRET_KEY \
-H "Content-Type: application/json" \
-d '{
"amount": 500,
"nonprofit_id": "n_IfEoPCaPqVsFAUI5xl0CBUOx",
"metadata": {
"id": "internal-user-id"
}
}'
Response
{
"checkout_url": "https://commerce.coinbase.com/checkout/dfedf1e3-6649-4a06-b81f-71b04e2aeb70"
}
Request
curl https://api.getchange.io/api/v1/payments/crypto_checkout_link \
-u YOUR_PUBLIC_KEY:YOUR_SECRET_KEY \
-H "Content-Type: application/json" \
-d '{
"amount": 500,
"nonprofit_id": "n_IfEoPCaPqVsFAUI5xl0CBUOx",
"metadata": {
"id": "internal-user-id"
}
}'
Response
{
"status": 400,
"code": "nonprofit_does_not_accept_crypto",
"title": "Nonprofit does not accept crypto."
}
Request
curl https://api.getchange.io/api/v1/payments/crypto_checkout_link \
-u YOUR_PUBLIC_KEY:YOUR_SECRET_KEY \
-H "Content-Type: application/json" \
-d '{
"nonprofit_id": "n_IfEoPCaPqVsFAUI5xl0CBUOx"
}'
Response
{
"status": 400,
"code": "amount_required",
"title": "Param 'amount' can't be blank."
}