Generate An Access Token

First, you’ll need to create an access token that lets you access the APIs. Fill in the provided client_id and client_secret to in the preferred code snippet and get an access token.

1curl --request POST \
2 --url 'https://chariot-sandbox.us.auth0.com/oauth/token' \
3 --header 'content-type: application/x-www-form-urlencoded' \
4 --data 'audience=https://api.givechariot.com&grant_type=client_credentials&client_id=YOUR_CLIENT_ID&client_secret=YOUR_CLIENT_SECRET'

Now that you have an access token, you’re set to initiate an API request. We’re going to utilize Chariot’s APIs to generate a CID (Connect Identifier) for a nonprofit organization. This CID is a crucial element needed to activate the DAFpay button.

To create a CID to a nonprofit, we first establish the nonprofit’s ID by utilizing their EIN (Employer Identification Number). Following that, we proceed to create a Connect with the nonprofit’s ID.

Create Nonprofit

Nonprofit EIN & Email Address Requirements

This route requires the organization’s EIN and a unique email address. Ensure the email address provided is unique to the nonprofit and not a generic support email (e.g., support@platform.com). This email will be used for important messaging related to the nonprofit’s Chariot account and can be updated later.

The Create Nonprofit endpoint registers a new nonprofit or confirms its existence within the Chariot system. For registration, it’s necessary to supply the nonprofit’s EIN and details for a contact person at the nonprofit.

Below are a few examples of different implementations. Modify the user object, ein field, and access token from step 1 before making the request.

1curl --request POST \
2 --url https://sandboxapi.givechariot.com/v1/nonprofits \
3 --header 'accept: application/json' \
4 --header 'authorization: Bearer ACCESS_TOKEN' \
5 --header 'content-type: application/json' \
6 --data '
7{
8 "user": {
9 "email": "hansolo@savethestars.com",
10 "phone": "3051234321",
11 "firstName": "Han",
12 "lastName": "Solo"
13 },
14 "ein": "123456789"
15}
16'

Bravo! You have just created a nonprofit in the Chariot system. Save down the nonprofit’s id and now let’s create a Connect for this nonprofit.

Create Connect

The Create Connect endpoint creates a Connect record or retrieves it if a Connect already exists for this nonprofit in Chariot’s system.

To create a Connect, the nonprofit’s id must be provided, which you should have from the previous step!

Below are a few examples of different implementations. Modify the NONPROFIT_ID query parameter with the nonprofit’s id. Don’t forget to add the access_token!

1curl --request POST \
2 --url 'https://sandboxapi.givechariot.com/v1/connects?nonprofit=NONPROFIT_ID' \
3 --header 'accept: application/json' \
4 --header 'authorization: Bearer ACCESS_TOKEN' \
5 --header 'content-type: application/json'

Amazing! You can now start integrating DAFpay to build a front end and start receiving grants for this nonprofit.

Built with