Donate money
As the name suggests, this endpoint allows you to donate money. The very reason our API exists is so you can make a positive impact. With this API, you can contribute money for any impact, even if it is not directly supported by us. On this page, we'll dive into how you can donate money to any cause programmatically.
You can donate money by yourself or on behalf of your customers. If you wish to donate money on behalf of your customers, you need to provide the customer_email
. We use the provided email to give your customers the ability to track the impact they made.
To set up a cause for donations, please contact us directly. Each cause must be vetted before it can be linked to your account to ensure alignment with our standards.
Donate money
This endpoint enables you to donate money for any cause. You need to contact us directly to set up a cause where the donated money will go. If no cause is associated with your account, the donated money will be directed to plant trees by default. To donate money on behalf of your customers, you must provide the customer_email
.
customer_name
is optional. However, if you plan to make an impact on behalf of your customers or give them the ability to track their impact, you need to provide the customer_email
.
Required request body attributes
- Name
amount
- Type
- integer
- Description
The amount (in smallest USD units) you wish to donate in a single request. The value must be between 1 and 1,000,000,000 smallest units. For example, to donate $0.10,
amount
should be 10 and to donate $1,amount
should be 100.
Optional request body attributes
- Name
customer_email
- Type
- string
- Description
The email of the customer if you are sending a request to donate money on their behalf. Must be a valid email address.
- Name
customer_name
- Type
- string
- Description
The name of the customer if you are sending a request to donate money on their behalf.
customer_email
must be present.
Request
curl --location https://api.1clickimpact.com/v1/donate_money \
--header 'Content-Type: application/json' \
--header 'x-api-key: {PRODUCTION API KEY}' \
---data-raw '{
"amount": 500
}'
Response
{
"user_id": "U123",
"money_donated": 500,
"time_utc": "2024-09-16T20:34:04.429Z"
}
Request (for Customer)
curl --location https://api.1clickimpact.com/v1/donate_money \
--header 'Content-Type: application/json' \
--header 'x-api-key: {PRODUCTION API KEY}' \
---data-raw '{
"amount": 500,
"customer_email": "sample-customer@email.com",
"customer_name": "Sample Customer"
}'
Response (for Customer)
{
"user_id": "U123",
"money_donated": 500,
"customer": {
"customer_id": "U12345",
"customer_email": "sample-customer@email.com",
"customer_name": "Sample Customer"
},
"time_utc": "2024-09-16T20:34:04.429Z"
}
Retrieve your money donated records
This endpoint allows you to query your money donated records. Refer to customer records at the bottom to see how to query customer money donated records.
Optional query params
- Name
filter_by
- Type
- string
- Description
The impact type of the records you want to query. To retrieve the money donated records
filter_by
should be "money_donated".
- Name
start_date
- Type
- string
- Description
The start date after which you want to query the records. The
start_date
should be in the format yyyy-mm-dd.
- Name
end_date
- Type
- string
- Description
The end date up to which you want to query the records. The
end_date
should be in the format yyyy-mm-dd.
- Name
limit
- Type
- integer
- Description
Limit the number of records returned. The default value is 10. The value must be between 0 and 1000.
- Name
cursor
- Type
- string
- Description
The cursor from the response can be used as query parameter in the next request to fetch the subsequent list of records. Refer to Pagination section for more details.
Request
curl --location 'https://api.1clickimpact.com/v1/records?filter_by=money_donated' \
--header 'x-api-key: {PRODUCTION API KEY}'
Response
{
"user_records":
[
{
"user_id": "U123",
"time_utc": "2024-09-16T20:30:13.391Z",
"money_donated": 500
},
{
"user_id": "U123",
"time_utc": "2024-09-17T13:24:04.429Z",
"money_donated": 1500
},
{
"user_id": "U123",
"time_utc": "2024-09-17T14:32:01.638Z",
"money_donated": 1000
},
{...},
{...}
],
"cursor": "fNJjcmV32dGVkTiOiIyMDI0LTA3LTidXNlcklE3UiVTk2OTQ0MDcwIpT"
}
Retrieve customer money donated records
This endpoint allows you to query customer money donated records for all or a specific customer.
Optional query params
- Name
customer_email
- Type
- string
- Description
The email of the customer whose records you want to retrieve.
- Name
filter_by
- Type
- string
- Description
The impact type of the records you want to query. To retrieve the money donated records
filter_by
should be "money_donated".
- Name
start_date
- Type
- string
- Description
The start date after which you want to query the records. The
start_date
should be in the format yyyy-mm-dd.
- Name
end_date
- Type
- string
- Description
The end date up to which you want to query the records. The
end_date
should be in the format yyyy-mm-dd.
- Name
limit
- Type
- integer
- Description
Limit the number of records returned. The default value is 10. The value must be between 0 and 1000.
- Name
cursor
- Type
- string
- Description
The cursor from the response can be used as query parameter in the next request to fetch the subsequent list of records. Refer to Pagination section for more details.
Request
curl --location 'https://api.1clickimpact.com/v1/customer_records?filter_by=money_donated' \
--header 'x-api-key: {PRODUCTION API KEY}'
Response
{
"customer_records":
[
{
"user_id": "U123",
"customer": {
"customer_id": "U1234",
"customer_email": "sample-customer-1@email.com",
"customer_name": "Sample Customer 1"
},
"time_utc": "2024-06-12T15:22:14.753Z",
"money_donated": 4000
},
{
"user_id": "U123",
"customer": {
"customer_id": "U789",
"customer_email": "sample-customer-2@email.com",
"customer_name": "Sample Customer 2"
},
"time_utc": "2024-06-15T16:41:58.323Z",
"money_donated": 5000
},
{
"user_id": "U123",
"customer": {
"customer_id": "U5678",
"customer_email": "sample-customer-3@email.com",
"customer_name": "Sample Customer 3"
},
"time_utc": "2024-06-21T18:16:02.083Z",
"money_donated": 1000
},
{
"user_id": "U123",
"customer": {
"customer_id": "U3456",
"customer_email": "sample-customer-4@email.com",
"customer_name": "Sample Customer 4"
},
"time_utc": "2024-06-21T20:34:35.913Z",
"money_donated": 15000
},
{...},
{...}
],
"cursor": "eyJjcmVhdGVkT24iOiIyMDI0LTA3LTidXNlcklEIjoiVTk2OTQ0MDcwIn0="
}