curl --request POST \
--url https://api.donate.gg/api/v1/configs \
--header 'Content-Type: application/json' \
--header 'donate-api-key: <api-key>' \
--data '
{
"charityBeneficiaries": [
{
"charityId": "9b4dae4e-d8c1-4322-a594-35a4858296b2",
"weight": 1
}
]
}
'import requests
url = "https://api.donate.gg/api/v1/configs"
payload = { "charityBeneficiaries": [
{
"charityId": "9b4dae4e-d8c1-4322-a594-35a4858296b2",
"weight": 1
}
] }
headers = {
"donate-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'donate-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
charityBeneficiaries: [{charityId: '9b4dae4e-d8c1-4322-a594-35a4858296b2', weight: 1}]
})
};
fetch('https://api.donate.gg/api/v1/configs', 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.donate.gg/api/v1/configs",
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([
'charityBeneficiaries' => [
[
'charityId' => '9b4dae4e-d8c1-4322-a594-35a4858296b2',
'weight' => 1
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"donate-api-key: <api-key>"
],
]);
$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.donate.gg/api/v1/configs"
payload := strings.NewReader("{\n \"charityBeneficiaries\": [\n {\n \"charityId\": \"9b4dae4e-d8c1-4322-a594-35a4858296b2\",\n \"weight\": 1\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("donate-api-key", "<api-key>")
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.donate.gg/api/v1/configs")
.header("donate-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"charityBeneficiaries\": [\n {\n \"charityId\": \"9b4dae4e-d8c1-4322-a594-35a4858296b2\",\n \"weight\": 1\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.donate.gg/api/v1/configs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["donate-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"charityBeneficiaries\": [\n {\n \"charityId\": \"9b4dae4e-d8c1-4322-a594-35a4858296b2\",\n \"weight\": 1\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": {
"hex": "<string>",
"base58": "<string>"
},
"feeBps": "<string>",
"users": [
{
"id": "<string>",
"weight": "<string>"
}
],
"charities": [
{
"id": "<string>",
"slug": "<string>",
"name": "<string>",
"logo": "<string>",
"website": "<string>",
"mission": "<string>",
"address": "<string>",
"city": "<string>",
"state": "<string>",
"country": "US",
"zipCode": "<string>",
"taxId": "<string>",
"status": "ACTIVE_ONBOARDED",
"configId": "<string>",
"socials": {
"blog": "<string>",
"twitter": "<string>",
"facebook": "<string>",
"instagram": "<string>",
"linkedin": "<string>",
"youtube": "<string>",
"blogUrl": "<string>",
"twitterUrl": "<string>",
"twitterHandle": "<string>",
"facebookUrl": "<string>",
"facebookHandle": "<string>",
"instagramUrl": "<string>",
"instagramHandle": "<string>",
"linkedinUrl": "<string>",
"linkedinHandle": "<string>",
"youtubeUrl": "<string>",
"youtubeHandle": "<string>",
"youtubeChannelId": "<string>"
},
"isEnabled": true,
"weight": "<string>",
"stats": {
"pendingUsdE6": "<string>",
"finalizedUsdE6": "<string>",
"displayedUsdE6": "<string>",
"pendingCount": 123,
"finalizedCount": 123,
"donationCount": 123,
"firstDonationAt": "<string>",
"lastDonationAt": "<string>"
}
}
]
}{
"error": "<string>",
"code": "VALIDATION_ERROR",
"issues": [
null
]
}{
"error": "<string>",
"code": "PAYLOAD_TOO_LARGE"
}Create a config
Create a config with active charity beneficiaries. New configs reject hidden, disabled, or opted-out beneficiaries with CHARITY_NOT_ACTIVE. Identical existing configs remain retrievable through an idempotent retry, regardless of current beneficiary status. Requires 1-5 beneficiaries. The standard API fee is 20% (2,000 basis points), set by the server. The stored config fee is retained for historical replay and ID compatibility. After Solana fee-policy activation, current pricing uses the developer project and original attribution address. Use GET /configs//fee for an estimate. Native Solana donations use their donation event slot; bridged EVM donations use their finalized Solana USDC delivery slot, not the source block or later admission slot. Requires your API key. New integrations use POST /v2/configs.
curl --request POST \
--url https://api.donate.gg/api/v1/configs \
--header 'Content-Type: application/json' \
--header 'donate-api-key: <api-key>' \
--data '
{
"charityBeneficiaries": [
{
"charityId": "9b4dae4e-d8c1-4322-a594-35a4858296b2",
"weight": 1
}
]
}
'import requests
url = "https://api.donate.gg/api/v1/configs"
payload = { "charityBeneficiaries": [
{
"charityId": "9b4dae4e-d8c1-4322-a594-35a4858296b2",
"weight": 1
}
] }
headers = {
"donate-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'donate-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
charityBeneficiaries: [{charityId: '9b4dae4e-d8c1-4322-a594-35a4858296b2', weight: 1}]
})
};
fetch('https://api.donate.gg/api/v1/configs', 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.donate.gg/api/v1/configs",
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([
'charityBeneficiaries' => [
[
'charityId' => '9b4dae4e-d8c1-4322-a594-35a4858296b2',
'weight' => 1
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"donate-api-key: <api-key>"
],
]);
$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.donate.gg/api/v1/configs"
payload := strings.NewReader("{\n \"charityBeneficiaries\": [\n {\n \"charityId\": \"9b4dae4e-d8c1-4322-a594-35a4858296b2\",\n \"weight\": 1\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("donate-api-key", "<api-key>")
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.donate.gg/api/v1/configs")
.header("donate-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"charityBeneficiaries\": [\n {\n \"charityId\": \"9b4dae4e-d8c1-4322-a594-35a4858296b2\",\n \"weight\": 1\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.donate.gg/api/v1/configs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["donate-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"charityBeneficiaries\": [\n {\n \"charityId\": \"9b4dae4e-d8c1-4322-a594-35a4858296b2\",\n \"weight\": 1\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": {
"hex": "<string>",
"base58": "<string>"
},
"feeBps": "<string>",
"users": [
{
"id": "<string>",
"weight": "<string>"
}
],
"charities": [
{
"id": "<string>",
"slug": "<string>",
"name": "<string>",
"logo": "<string>",
"website": "<string>",
"mission": "<string>",
"address": "<string>",
"city": "<string>",
"state": "<string>",
"country": "US",
"zipCode": "<string>",
"taxId": "<string>",
"status": "ACTIVE_ONBOARDED",
"configId": "<string>",
"socials": {
"blog": "<string>",
"twitter": "<string>",
"facebook": "<string>",
"instagram": "<string>",
"linkedin": "<string>",
"youtube": "<string>",
"blogUrl": "<string>",
"twitterUrl": "<string>",
"twitterHandle": "<string>",
"facebookUrl": "<string>",
"facebookHandle": "<string>",
"instagramUrl": "<string>",
"instagramHandle": "<string>",
"linkedinUrl": "<string>",
"linkedinHandle": "<string>",
"youtubeUrl": "<string>",
"youtubeHandle": "<string>",
"youtubeChannelId": "<string>"
},
"isEnabled": true,
"weight": "<string>",
"stats": {
"pendingUsdE6": "<string>",
"finalizedUsdE6": "<string>",
"displayedUsdE6": "<string>",
"pendingCount": 123,
"finalizedCount": 123,
"donationCount": 123,
"firstDonationAt": "<string>",
"lastDonationAt": "<string>"
}
}
]
}{
"error": "<string>",
"code": "VALIDATION_ERROR",
"issues": [
null
]
}{
"error": "<string>",
"code": "PAYLOAD_TOO_LARGE"
}Authorizations
Was this page helpful?