Commitments
Reverse a recipient funding allocation
Requires bearer or API-key authentication, current organization scope and access to every selected recipient program. Gift/funding administration also follows the donations/reports permission policy. Marks the row reversed and retains its history. Repeating reversal is safe. Removes its effective coverage/allocation so retained gift money is available again; does not reverse or refund the underlying donation.
POST
/
admin
/
recipient-funding
/
{funding_id}
/
reverse
Reverse a recipient funding allocation
curl --request POST \
--url https://api.gratona.com/v1/admin/recipient-funding/{funding_id}/reverse \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.gratona.com/v1/admin/recipient-funding/{funding_id}/reverse"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.gratona.com/v1/admin/recipient-funding/{funding_id}/reverse', 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/recipient-funding/{funding_id}/reverse",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.gratona.com/v1/admin/recipient-funding/{funding_id}/reverse"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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/recipient-funding/{funding_id}/reverse")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gratona.com/v1/admin/recipient-funding/{funding_id}/reverse")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"message": "<string>",
"row": {
"id": 123,
"entity_id": 123,
"recipient_name": "<string>",
"program_id": 123,
"funder_donor_id": 123,
"funder_name": "<string>",
"donation_id": 123,
"source_type": "gift",
"currency_code": "<string>",
"covered_from": "2023-12-25",
"covered_through": "2023-12-25",
"status": "pledged",
"display_funder": "inherit",
"active": true,
"created_at": "2023-11-07T05:31:56Z",
"reversed_at": "2023-11-07T05:31:56Z",
"ended_reason": "<string>",
"amount": "35.00",
"original_amount": "35.00",
"recorded_amount": "35.00"
}
}{
"message": "Unauthorized",
"status": "error"
}{
"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."
}{
"errors": {},
"status": "error",
"message": "The given data was invalid."
}Authorizations
bearerAuthapiKeyAuth
Passport bearer token authentication for legacy admin sessions.
Path Parameters
Funding id.
Required range:
x >= 1Example:
123
⌘I
Reverse a recipient funding allocation
curl --request POST \
--url https://api.gratona.com/v1/admin/recipient-funding/{funding_id}/reverse \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.gratona.com/v1/admin/recipient-funding/{funding_id}/reverse"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.gratona.com/v1/admin/recipient-funding/{funding_id}/reverse', 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/recipient-funding/{funding_id}/reverse",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.gratona.com/v1/admin/recipient-funding/{funding_id}/reverse"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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/recipient-funding/{funding_id}/reverse")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gratona.com/v1/admin/recipient-funding/{funding_id}/reverse")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"message": "<string>",
"row": {
"id": 123,
"entity_id": 123,
"recipient_name": "<string>",
"program_id": 123,
"funder_donor_id": 123,
"funder_name": "<string>",
"donation_id": 123,
"source_type": "gift",
"currency_code": "<string>",
"covered_from": "2023-12-25",
"covered_through": "2023-12-25",
"status": "pledged",
"display_funder": "inherit",
"active": true,
"created_at": "2023-11-07T05:31:56Z",
"reversed_at": "2023-11-07T05:31:56Z",
"ended_reason": "<string>",
"amount": "35.00",
"original_amount": "35.00",
"recorded_amount": "35.00"
}
}{
"message": "Unauthorized",
"status": "error"
}{
"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."
}{
"errors": {},
"status": "error",
"message": "The given data was invalid."
}