Get or create a campaign deposit address
curl --request POST \
--url https://api.donate.gg/api/v2/campaigns/{campaignId}/deposit-addresses \
--header 'Content-Type: application/json' \
--data '
{
"chainId": 8453
}
'import requests
url = "https://api.donate.gg/api/v2/campaigns/{campaignId}/deposit-addresses"
payload = { "chainId": 8453 }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({chainId: 8453})
};
fetch('https://api.donate.gg/api/v2/campaigns/{campaignId}/deposit-addresses', 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/v2/campaigns/{campaignId}/deposit-addresses",
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([
'chainId' => 8453
]),
CURLOPT_HTTPHEADER => [
"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.donate.gg/api/v2/campaigns/{campaignId}/deposit-addresses"
payload := strings.NewReader("{\n \"chainId\": 8453\n}")
req, _ := http.NewRequest("POST", url, payload)
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/v2/campaigns/{campaignId}/deposit-addresses")
.header("Content-Type", "application/json")
.body("{\n \"chainId\": 8453\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.donate.gg/api/v2/campaigns/{campaignId}/deposit-addresses")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"chainId\": 8453\n}"
response = http.request(request)
puts response.read_body{
"chainId": 8453,
"status": "ready",
"address": "0x1111111111111111111111111111111111111111",
"retryAfterSeconds": null
}{
"chainId": 8453,
"status": "provisioning",
"address": null,
"retryAfterSeconds": 3
}{
"code": "VALIDATION_ERROR",
"message": "<string>",
"issues": [
{
"path": "<string>",
"code": "required",
"message": "<string>"
}
]
}{
"code": "UNAUTHENTICATED",
"message": "This API key is not valid."
}{
"code": "NOT_FOUND",
"message": "<string>"
}{
"code": "DEPOSITS_CLOSED",
"message": "<string>"
}{
"code": "PAYLOAD_TOO_LARGE",
"message": "<string>"
}{
"code": "RATE_LIMIT_EXCEEDED",
"message": "<string>"
}{
"code": "PROVIDER_UNAVAILABLE",
"message": "<string>"
}Deposit addresses
Get or create a campaign deposit address
The address a donor sends funds to in order to donate to this campaign on one chain. Answers 200 with the address when it exists. The first request for a chain creates it and may answer 202 with status: "provisioning": ask again after retryAfterSeconds, which is also the Retry-After header. Repeating the request never creates a second address. A chain that is not in GET /v2/campaigns/{campaignId}/deposit-chains is a 400. This route has its own, lower rate limit. Public: no API key is needed. Send one to use your organization’s rate limit.
POST
/
v2
/
campaigns
/
{campaignId}
/
deposit-addresses
Get or create a campaign deposit address
curl --request POST \
--url https://api.donate.gg/api/v2/campaigns/{campaignId}/deposit-addresses \
--header 'Content-Type: application/json' \
--data '
{
"chainId": 8453
}
'import requests
url = "https://api.donate.gg/api/v2/campaigns/{campaignId}/deposit-addresses"
payload = { "chainId": 8453 }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({chainId: 8453})
};
fetch('https://api.donate.gg/api/v2/campaigns/{campaignId}/deposit-addresses', 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/v2/campaigns/{campaignId}/deposit-addresses",
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([
'chainId' => 8453
]),
CURLOPT_HTTPHEADER => [
"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.donate.gg/api/v2/campaigns/{campaignId}/deposit-addresses"
payload := strings.NewReader("{\n \"chainId\": 8453\n}")
req, _ := http.NewRequest("POST", url, payload)
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/v2/campaigns/{campaignId}/deposit-addresses")
.header("Content-Type", "application/json")
.body("{\n \"chainId\": 8453\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.donate.gg/api/v2/campaigns/{campaignId}/deposit-addresses")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"chainId\": 8453\n}"
response = http.request(request)
puts response.read_body{
"chainId": 8453,
"status": "ready",
"address": "0x1111111111111111111111111111111111111111",
"retryAfterSeconds": null
}{
"chainId": 8453,
"status": "provisioning",
"address": null,
"retryAfterSeconds": 3
}{
"code": "VALIDATION_ERROR",
"message": "<string>",
"issues": [
{
"path": "<string>",
"code": "required",
"message": "<string>"
}
]
}{
"code": "UNAUTHENTICATED",
"message": "This API key is not valid."
}{
"code": "NOT_FOUND",
"message": "<string>"
}{
"code": "DEPOSITS_CLOSED",
"message": "<string>"
}{
"code": "PAYLOAD_TOO_LARGE",
"message": "<string>"
}{
"code": "RATE_LIMIT_EXCEEDED",
"message": "<string>"
}{
"code": "PROVIDER_UNAVAILABLE",
"message": "<string>"
}Headers
Was this page helpful?