Public
Create a campaign cart before an optional sponsorship offer
Requires a campaign with checkout_offer_enabled. Validates 1–100 distinct visible recipient IDs belonging to that campaign, creates a new cart and saves each selection through normal amount policy checks. If multiple designations are disabled, exactly one selection is allowed. Returns the new session ID; does not charge a payment or add the sponsorship offer itself.
POST
/
frontend
/
checkout
/
campaign-offer
/
{client_id}
/
{program_id}
Create a campaign cart before an optional sponsorship offer
curl --request POST \
--url https://api.gratona.com/v1/frontend/checkout/campaign-offer/{client_id}/{program_id} \
--header 'Content-Type: application/json' \
--data '
{
"designations": [
{
"entity_id": 123,
"donation_amount": 1,
"is_custom_amount": true
}
]
}
'import requests
url = "https://api.gratona.com/v1/frontend/checkout/campaign-offer/{client_id}/{program_id}"
payload = { "designations": [
{
"entity_id": 123,
"donation_amount": 1,
"is_custom_amount": True
}
] }
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({designations: [{entity_id: 123, donation_amount: 1, is_custom_amount: true}]})
};
fetch('https://api.gratona.com/v1/frontend/checkout/campaign-offer/{client_id}/{program_id}', 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/frontend/checkout/campaign-offer/{client_id}/{program_id}",
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([
'designations' => [
[
'entity_id' => 123,
'donation_amount' => 1,
'is_custom_amount' => true
]
]
]),
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.gratona.com/v1/frontend/checkout/campaign-offer/{client_id}/{program_id}"
payload := strings.NewReader("{\n \"designations\": [\n {\n \"entity_id\": 123,\n \"donation_amount\": 1,\n \"is_custom_amount\": true\n }\n ]\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.gratona.com/v1/frontend/checkout/campaign-offer/{client_id}/{program_id}")
.header("Content-Type", "application/json")
.body("{\n \"designations\": [\n {\n \"entity_id\": 123,\n \"donation_amount\": 1,\n \"is_custom_amount\": true\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gratona.com/v1/frontend/checkout/campaign-offer/{client_id}/{program_id}")
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 \"designations\": [\n {\n \"entity_id\": 123,\n \"donation_amount\": 1,\n \"is_custom_amount\": true\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"session_id": "<string>"
}{
"errors": {},
"status": "error",
"message": "The given data was invalid."
}{
"errors": {},
"status": "error",
"message": "The given data was invalid."
}Path Parameters
Client id.
Required range:
x >= 1Example:
207
Program id. Program route; order/cart methods may accept hyphen-separated program IDs.
Example:
"11"
Body
application/json
Request fields accepted by this operation. Omitted optional properties retain the behavior described above.
Required array length:
1 - 100 elementsShow child attributes
Show child attributes
Response
Create a campaign cart before an optional sponsorship offer response.
⌘I
Create a campaign cart before an optional sponsorship offer
curl --request POST \
--url https://api.gratona.com/v1/frontend/checkout/campaign-offer/{client_id}/{program_id} \
--header 'Content-Type: application/json' \
--data '
{
"designations": [
{
"entity_id": 123,
"donation_amount": 1,
"is_custom_amount": true
}
]
}
'import requests
url = "https://api.gratona.com/v1/frontend/checkout/campaign-offer/{client_id}/{program_id}"
payload = { "designations": [
{
"entity_id": 123,
"donation_amount": 1,
"is_custom_amount": True
}
] }
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({designations: [{entity_id: 123, donation_amount: 1, is_custom_amount: true}]})
};
fetch('https://api.gratona.com/v1/frontend/checkout/campaign-offer/{client_id}/{program_id}', 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/frontend/checkout/campaign-offer/{client_id}/{program_id}",
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([
'designations' => [
[
'entity_id' => 123,
'donation_amount' => 1,
'is_custom_amount' => true
]
]
]),
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.gratona.com/v1/frontend/checkout/campaign-offer/{client_id}/{program_id}"
payload := strings.NewReader("{\n \"designations\": [\n {\n \"entity_id\": 123,\n \"donation_amount\": 1,\n \"is_custom_amount\": true\n }\n ]\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.gratona.com/v1/frontend/checkout/campaign-offer/{client_id}/{program_id}")
.header("Content-Type", "application/json")
.body("{\n \"designations\": [\n {\n \"entity_id\": 123,\n \"donation_amount\": 1,\n \"is_custom_amount\": true\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gratona.com/v1/frontend/checkout/campaign-offer/{client_id}/{program_id}")
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 \"designations\": [\n {\n \"entity_id\": 123,\n \"donation_amount\": 1,\n \"is_custom_amount\": true\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"session_id": "<string>"
}{
"errors": {},
"status": "error",
"message": "The given data was invalid."
}{
"errors": {},
"status": "error",
"message": "The given data was invalid."
}