Create crypto donation pledge
curl --request POST \
--url https://api.endaoment.org/v1/donation-pledges/crypto \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"cryptoGiven": {
"inputAmount": "1000000000000000000",
"tokenId": 1
},
"receivingEntityType": "fund",
"receivingEntityId": "123e4567-e89b-12d3-a456-426614174000",
"otcDonationTransactionHash": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
"recommendationId": "123e4567-e89b-12d3-a456-426614174000",
"isRebalanceRequested": false,
"donorName": "<string>",
"updateIdentity": false,
"shareMyEmail": false
}
'import requests
url = "https://api.endaoment.org/v1/donation-pledges/crypto"
payload = {
"cryptoGiven": {
"inputAmount": "1000000000000000000",
"tokenId": 1
},
"receivingEntityType": "fund",
"receivingEntityId": "123e4567-e89b-12d3-a456-426614174000",
"otcDonationTransactionHash": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
"recommendationId": "123e4567-e89b-12d3-a456-426614174000",
"isRebalanceRequested": False,
"donorName": "<string>",
"updateIdentity": False,
"shareMyEmail": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
cryptoGiven: {inputAmount: '1000000000000000000', tokenId: 1},
receivingEntityType: 'fund',
receivingEntityId: '123e4567-e89b-12d3-a456-426614174000',
otcDonationTransactionHash: '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef',
recommendationId: '123e4567-e89b-12d3-a456-426614174000',
isRebalanceRequested: false,
donorName: '<string>',
updateIdentity: false,
shareMyEmail: false
})
};
fetch('https://api.endaoment.org/v1/donation-pledges/crypto', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.endaoment.org/v1/donation-pledges/crypto",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'cryptoGiven' => [
'inputAmount' => '1000000000000000000',
'tokenId' => 1
],
'receivingEntityType' => 'fund',
'receivingEntityId' => '123e4567-e89b-12d3-a456-426614174000',
'otcDonationTransactionHash' => '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef',
'recommendationId' => '123e4567-e89b-12d3-a456-426614174000',
'isRebalanceRequested' => false,
'donorName' => '<string>',
'updateIdentity' => false,
'shareMyEmail' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.endaoment.org/v1/donation-pledges/crypto"
payload := strings.NewReader("{\n \"cryptoGiven\": {\n \"inputAmount\": \"1000000000000000000\",\n \"tokenId\": 1\n },\n \"receivingEntityType\": \"fund\",\n \"receivingEntityId\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"otcDonationTransactionHash\": \"0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef\",\n \"recommendationId\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"isRebalanceRequested\": false,\n \"donorName\": \"<string>\",\n \"updateIdentity\": false,\n \"shareMyEmail\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.endaoment.org/v1/donation-pledges/crypto")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"cryptoGiven\": {\n \"inputAmount\": \"1000000000000000000\",\n \"tokenId\": 1\n },\n \"receivingEntityType\": \"fund\",\n \"receivingEntityId\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"otcDonationTransactionHash\": \"0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef\",\n \"recommendationId\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"isRebalanceRequested\": false,\n \"donorName\": \"<string>\",\n \"updateIdentity\": false,\n \"shareMyEmail\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.endaoment.org/v1/donation-pledges/crypto")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"cryptoGiven\": {\n \"inputAmount\": \"1000000000000000000\",\n \"tokenId\": 1\n },\n \"receivingEntityType\": \"fund\",\n \"receivingEntityId\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"otcDonationTransactionHash\": \"0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef\",\n \"recommendationId\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"isRebalanceRequested\": false,\n \"donorName\": \"<string>\",\n \"updateIdentity\": false,\n \"shareMyEmail\": false\n}"
response = http.request(request)
puts response.read_body{
"id": "123e4567-e89b-12d3-a456-426614174000"
}Donations
Create crypto donation pledge
Creates a new donation pledge for a cryptocurrency donation to Endaoment.
Minimum Donation Requirements: Please note we enforce a minimum on all donations of assets in this manner as they require manual processing. All sub-$250 donations are re-routed to Endaoment’s operating fund.
By proceeding, you accept our disclaimer for over-the-counter donations.
Authentication is optional:
- Authenticated users will have the pledge associated with their account
- Unauthenticated users can still create pledges but won’t have them linked to any account
This endpoint allows users to:
- Register their crypto donation with Endaoment, alongside the transaction hash proving the donation happened on-chain
- Specify the amount and receiving fund
- Optionally provide donor identity information for the donation receipt
If you are donating crypto via the Endaoment smart contract functions, please use the ‘donations’ endpoint instead to register your donation.
POST
/
v1
/
donation-pledges
/
crypto
Create crypto donation pledge
curl --request POST \
--url https://api.endaoment.org/v1/donation-pledges/crypto \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"cryptoGiven": {
"inputAmount": "1000000000000000000",
"tokenId": 1
},
"receivingEntityType": "fund",
"receivingEntityId": "123e4567-e89b-12d3-a456-426614174000",
"otcDonationTransactionHash": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
"recommendationId": "123e4567-e89b-12d3-a456-426614174000",
"isRebalanceRequested": false,
"donorName": "<string>",
"updateIdentity": false,
"shareMyEmail": false
}
'import requests
url = "https://api.endaoment.org/v1/donation-pledges/crypto"
payload = {
"cryptoGiven": {
"inputAmount": "1000000000000000000",
"tokenId": 1
},
"receivingEntityType": "fund",
"receivingEntityId": "123e4567-e89b-12d3-a456-426614174000",
"otcDonationTransactionHash": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
"recommendationId": "123e4567-e89b-12d3-a456-426614174000",
"isRebalanceRequested": False,
"donorName": "<string>",
"updateIdentity": False,
"shareMyEmail": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
cryptoGiven: {inputAmount: '1000000000000000000', tokenId: 1},
receivingEntityType: 'fund',
receivingEntityId: '123e4567-e89b-12d3-a456-426614174000',
otcDonationTransactionHash: '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef',
recommendationId: '123e4567-e89b-12d3-a456-426614174000',
isRebalanceRequested: false,
donorName: '<string>',
updateIdentity: false,
shareMyEmail: false
})
};
fetch('https://api.endaoment.org/v1/donation-pledges/crypto', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.endaoment.org/v1/donation-pledges/crypto",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'cryptoGiven' => [
'inputAmount' => '1000000000000000000',
'tokenId' => 1
],
'receivingEntityType' => 'fund',
'receivingEntityId' => '123e4567-e89b-12d3-a456-426614174000',
'otcDonationTransactionHash' => '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef',
'recommendationId' => '123e4567-e89b-12d3-a456-426614174000',
'isRebalanceRequested' => false,
'donorName' => '<string>',
'updateIdentity' => false,
'shareMyEmail' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.endaoment.org/v1/donation-pledges/crypto"
payload := strings.NewReader("{\n \"cryptoGiven\": {\n \"inputAmount\": \"1000000000000000000\",\n \"tokenId\": 1\n },\n \"receivingEntityType\": \"fund\",\n \"receivingEntityId\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"otcDonationTransactionHash\": \"0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef\",\n \"recommendationId\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"isRebalanceRequested\": false,\n \"donorName\": \"<string>\",\n \"updateIdentity\": false,\n \"shareMyEmail\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.endaoment.org/v1/donation-pledges/crypto")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"cryptoGiven\": {\n \"inputAmount\": \"1000000000000000000\",\n \"tokenId\": 1\n },\n \"receivingEntityType\": \"fund\",\n \"receivingEntityId\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"otcDonationTransactionHash\": \"0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef\",\n \"recommendationId\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"isRebalanceRequested\": false,\n \"donorName\": \"<string>\",\n \"updateIdentity\": false,\n \"shareMyEmail\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.endaoment.org/v1/donation-pledges/crypto")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"cryptoGiven\": {\n \"inputAmount\": \"1000000000000000000\",\n \"tokenId\": 1\n },\n \"receivingEntityType\": \"fund\",\n \"receivingEntityId\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"otcDonationTransactionHash\": \"0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef\",\n \"recommendationId\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"isRebalanceRequested\": false,\n \"donorName\": \"<string>\",\n \"updateIdentity\": false,\n \"shareMyEmail\": false\n}"
response = http.request(request)
puts response.read_body{
"id": "123e4567-e89b-12d3-a456-426614174000"
}Authorizations
Body
application/json
Was this page helpful?