Commitments
Preview available fixed sponsorship levels
Uses supplied configuration only; no program or recipient is changed. Filters configured positive amounts by current funded percentage and remaining capacity. An amount remains available only below its configured threshold (default100); exceeding remaining target requires allow_sponsorship_over_target. funded_percent is rounded to two decimals and can exceed100.
POST
/
admin
/
sponsorship-amount-preview
Preview available fixed sponsorship levels
curl --request POST \
--url https://api.gratona.com/v1/admin/sponsorship-amount-preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"target": 100,
"funded": 25,
"settings": {
"sponsorship_amount": "25,50",
"sponsorship_amount_mode": "fixed_levels",
"sponsorship_level_thresholds": "{}",
"allow_sponsorship_over_target": "0",
"allow_custom_sponsorship_amounts": "0",
"labels": "Education,Full support"
}
}
'import requests
url = "https://api.gratona.com/v1/admin/sponsorship-amount-preview"
payload = {
"target": 100,
"funded": 25,
"settings": {
"sponsorship_amount": "25,50",
"sponsorship_amount_mode": "fixed_levels",
"sponsorship_level_thresholds": "{}",
"allow_sponsorship_over_target": "0",
"allow_custom_sponsorship_amounts": "0",
"labels": "Education,Full support"
}
}
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({
target: 100,
funded: 25,
settings: {
sponsorship_amount: '25,50',
sponsorship_amount_mode: 'fixed_levels',
sponsorship_level_thresholds: '{}',
allow_sponsorship_over_target: '0',
allow_custom_sponsorship_amounts: '0',
labels: 'Education,Full support'
}
})
};
fetch('https://api.gratona.com/v1/admin/sponsorship-amount-preview', 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.gratona.com/v1/admin/sponsorship-amount-preview",
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([
'target' => 100,
'funded' => 25,
'settings' => [
'sponsorship_amount' => '25,50',
'sponsorship_amount_mode' => 'fixed_levels',
'sponsorship_level_thresholds' => '{}',
'allow_sponsorship_over_target' => '0',
'allow_custom_sponsorship_amounts' => '0',
'labels' => 'Education,Full support'
]
]),
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.gratona.com/v1/admin/sponsorship-amount-preview"
payload := strings.NewReader("{\n \"target\": 100,\n \"funded\": 25,\n \"settings\": {\n \"sponsorship_amount\": \"25,50\",\n \"sponsorship_amount_mode\": \"fixed_levels\",\n \"sponsorship_level_thresholds\": \"{}\",\n \"allow_sponsorship_over_target\": \"0\",\n \"allow_custom_sponsorship_amounts\": \"0\",\n \"labels\": \"Education,Full support\"\n }\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.gratona.com/v1/admin/sponsorship-amount-preview")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"target\": 100,\n \"funded\": 25,\n \"settings\": {\n \"sponsorship_amount\": \"25,50\",\n \"sponsorship_amount_mode\": \"fixed_levels\",\n \"sponsorship_level_thresholds\": \"{}\",\n \"allow_sponsorship_over_target\": \"0\",\n \"allow_custom_sponsorship_amounts\": \"0\",\n \"labels\": \"Education,Full support\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gratona.com/v1/admin/sponsorship-amount-preview")
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 \"target\": 100,\n \"funded\": 25,\n \"settings\": {\n \"sponsorship_amount\": \"25,50\",\n \"sponsorship_amount_mode\": \"fixed_levels\",\n \"sponsorship_level_thresholds\": \"{}\",\n \"allow_sponsorship_over_target\": \"0\",\n \"allow_custom_sponsorship_amounts\": \"0\",\n \"labels\": \"Education,Full support\"\n }\n}"
response = http.request(request)
puts response.read_body{
"amount_options": [
"25 Education"
],
"allows_custom_amounts": false,
"funded_percent": 25
}{
"message": "Something went wrong. Please try again.",
"status": "error",
"error": "invalid_request",
"code": "DONOR_NOT_FOUND"
}{
"message": "Something went wrong. Please try again.",
"status": "error",
"error": "invalid_request",
"code": "DONOR_NOT_FOUND"
}{
"errors": {},
"status": "error",
"message": "The given data was invalid."
}Authorizations
bearerAuthapiKeyAuth
Passport bearer token authentication for legacy admin sessions.
Body
application/json
⌘I
Preview available fixed sponsorship levels
curl --request POST \
--url https://api.gratona.com/v1/admin/sponsorship-amount-preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"target": 100,
"funded": 25,
"settings": {
"sponsorship_amount": "25,50",
"sponsorship_amount_mode": "fixed_levels",
"sponsorship_level_thresholds": "{}",
"allow_sponsorship_over_target": "0",
"allow_custom_sponsorship_amounts": "0",
"labels": "Education,Full support"
}
}
'import requests
url = "https://api.gratona.com/v1/admin/sponsorship-amount-preview"
payload = {
"target": 100,
"funded": 25,
"settings": {
"sponsorship_amount": "25,50",
"sponsorship_amount_mode": "fixed_levels",
"sponsorship_level_thresholds": "{}",
"allow_sponsorship_over_target": "0",
"allow_custom_sponsorship_amounts": "0",
"labels": "Education,Full support"
}
}
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({
target: 100,
funded: 25,
settings: {
sponsorship_amount: '25,50',
sponsorship_amount_mode: 'fixed_levels',
sponsorship_level_thresholds: '{}',
allow_sponsorship_over_target: '0',
allow_custom_sponsorship_amounts: '0',
labels: 'Education,Full support'
}
})
};
fetch('https://api.gratona.com/v1/admin/sponsorship-amount-preview', 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.gratona.com/v1/admin/sponsorship-amount-preview",
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([
'target' => 100,
'funded' => 25,
'settings' => [
'sponsorship_amount' => '25,50',
'sponsorship_amount_mode' => 'fixed_levels',
'sponsorship_level_thresholds' => '{}',
'allow_sponsorship_over_target' => '0',
'allow_custom_sponsorship_amounts' => '0',
'labels' => 'Education,Full support'
]
]),
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.gratona.com/v1/admin/sponsorship-amount-preview"
payload := strings.NewReader("{\n \"target\": 100,\n \"funded\": 25,\n \"settings\": {\n \"sponsorship_amount\": \"25,50\",\n \"sponsorship_amount_mode\": \"fixed_levels\",\n \"sponsorship_level_thresholds\": \"{}\",\n \"allow_sponsorship_over_target\": \"0\",\n \"allow_custom_sponsorship_amounts\": \"0\",\n \"labels\": \"Education,Full support\"\n }\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.gratona.com/v1/admin/sponsorship-amount-preview")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"target\": 100,\n \"funded\": 25,\n \"settings\": {\n \"sponsorship_amount\": \"25,50\",\n \"sponsorship_amount_mode\": \"fixed_levels\",\n \"sponsorship_level_thresholds\": \"{}\",\n \"allow_sponsorship_over_target\": \"0\",\n \"allow_custom_sponsorship_amounts\": \"0\",\n \"labels\": \"Education,Full support\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gratona.com/v1/admin/sponsorship-amount-preview")
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 \"target\": 100,\n \"funded\": 25,\n \"settings\": {\n \"sponsorship_amount\": \"25,50\",\n \"sponsorship_amount_mode\": \"fixed_levels\",\n \"sponsorship_level_thresholds\": \"{}\",\n \"allow_sponsorship_over_target\": \"0\",\n \"allow_custom_sponsorship_amounts\": \"0\",\n \"labels\": \"Education,Full support\"\n }\n}"
response = http.request(request)
puts response.read_body{
"amount_options": [
"25 Education"
],
"allows_custom_amounts": false,
"funded_percent": 25
}{
"message": "Something went wrong. Please try again.",
"status": "error",
"error": "invalid_request",
"code": "DONOR_NOT_FOUND"
}{
"message": "Something went wrong. Please try again.",
"status": "error",
"error": "invalid_request",
"code": "DONOR_NOT_FOUND"
}{
"errors": {},
"status": "error",
"message": "The given data was invalid."
}