Create a handwritten-card draft and quote
Requires message_template or message. Resolves optional donor/mailing/Work sources, eligible country, sender defaults, card/font, merge fields, suppression, budget and current customer price. A created blocked draft returns 201 with blocking reasons; it has not been approved or sent. Source recipients must agree and active duplicates are refused. Requires the configured Handwrytten feature (normally handwrytten_mailings). Requires permission: one of mailings_generate, mailings_manage, manage_email.
curl --request POST \
--url https://api.gratona.com/v1/admin/handwrytten/drafts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"generated_mailing_id": 1,
"donor_id": 1,
"fundraising_work_item_id": 1,
"rule_id": 1,
"program_id": 1,
"campaign_key": "Campaign Key",
"account_mode": "hys_managed",
"card_vendor_id": "Card Vendor Id",
"card_name": "Card Name",
"font_label": "Font Label",
"insert_vendor_id": "Insert Vendor Id",
"message_template": "Message Template",
"message": "Message",
"merge_data": {},
"recipient_address": {
"first_name": "Example",
"last_name": "Example",
"name": "Example",
"address1": "Example",
"address2": "Example",
"street": "Example",
"address_line2": "Example",
"city": "Example",
"state": "Example",
"province": "Example",
"zip": "Example",
"postal_code": "Example",
"country": "Example",
"country_code": "Example",
"country_id": 1
},
"sender_address": {
"first_name": "Example",
"last_name": "Example",
"name": "Example",
"address1": "Example",
"address2": "Example",
"street": "Example",
"address_line2": "Example",
"city": "Example",
"state": "Example",
"province": "Example",
"zip": "Example",
"postal_code": "Example",
"country": "Example",
"country_code": "Example",
"country_id": 1
},
"requested_send_date": "2026-10-20T12:00:00Z"
}
'import requests
url = "https://api.gratona.com/v1/admin/handwrytten/drafts"
payload = {
"generated_mailing_id": 1,
"donor_id": 1,
"fundraising_work_item_id": 1,
"rule_id": 1,
"program_id": 1,
"campaign_key": "Campaign Key",
"account_mode": "hys_managed",
"card_vendor_id": "Card Vendor Id",
"card_name": "Card Name",
"font_label": "Font Label",
"insert_vendor_id": "Insert Vendor Id",
"message_template": "Message Template",
"message": "Message",
"merge_data": {},
"recipient_address": {
"first_name": "Example",
"last_name": "Example",
"name": "Example",
"address1": "Example",
"address2": "Example",
"street": "Example",
"address_line2": "Example",
"city": "Example",
"state": "Example",
"province": "Example",
"zip": "Example",
"postal_code": "Example",
"country": "Example",
"country_code": "Example",
"country_id": 1
},
"sender_address": {
"first_name": "Example",
"last_name": "Example",
"name": "Example",
"address1": "Example",
"address2": "Example",
"street": "Example",
"address_line2": "Example",
"city": "Example",
"state": "Example",
"province": "Example",
"zip": "Example",
"postal_code": "Example",
"country": "Example",
"country_code": "Example",
"country_id": 1
},
"requested_send_date": "2026-10-20T12:00:00Z"
}
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({
generated_mailing_id: 1,
donor_id: 1,
fundraising_work_item_id: 1,
rule_id: 1,
program_id: 1,
campaign_key: 'Campaign Key',
account_mode: 'hys_managed',
card_vendor_id: 'Card Vendor Id',
card_name: 'Card Name',
font_label: 'Font Label',
insert_vendor_id: 'Insert Vendor Id',
message_template: 'Message Template',
message: 'Message',
merge_data: {},
recipient_address: {
first_name: 'Example',
last_name: 'Example',
name: 'Example',
address1: 'Example',
address2: 'Example',
street: 'Example',
address_line2: 'Example',
city: 'Example',
state: 'Example',
province: 'Example',
zip: 'Example',
postal_code: 'Example',
country: 'Example',
country_code: 'Example',
country_id: 1
},
sender_address: {
first_name: 'Example',
last_name: 'Example',
name: 'Example',
address1: 'Example',
address2: 'Example',
street: 'Example',
address_line2: 'Example',
city: 'Example',
state: 'Example',
province: 'Example',
zip: 'Example',
postal_code: 'Example',
country: 'Example',
country_code: 'Example',
country_id: 1
},
requested_send_date: '2026-10-20T12:00:00Z'
})
};
fetch('https://api.gratona.com/v1/admin/handwrytten/drafts', 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/handwrytten/drafts",
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([
'generated_mailing_id' => 1,
'donor_id' => 1,
'fundraising_work_item_id' => 1,
'rule_id' => 1,
'program_id' => 1,
'campaign_key' => 'Campaign Key',
'account_mode' => 'hys_managed',
'card_vendor_id' => 'Card Vendor Id',
'card_name' => 'Card Name',
'font_label' => 'Font Label',
'insert_vendor_id' => 'Insert Vendor Id',
'message_template' => 'Message Template',
'message' => 'Message',
'merge_data' => [
],
'recipient_address' => [
'first_name' => 'Example',
'last_name' => 'Example',
'name' => 'Example',
'address1' => 'Example',
'address2' => 'Example',
'street' => 'Example',
'address_line2' => 'Example',
'city' => 'Example',
'state' => 'Example',
'province' => 'Example',
'zip' => 'Example',
'postal_code' => 'Example',
'country' => 'Example',
'country_code' => 'Example',
'country_id' => 1
],
'sender_address' => [
'first_name' => 'Example',
'last_name' => 'Example',
'name' => 'Example',
'address1' => 'Example',
'address2' => 'Example',
'street' => 'Example',
'address_line2' => 'Example',
'city' => 'Example',
'state' => 'Example',
'province' => 'Example',
'zip' => 'Example',
'postal_code' => 'Example',
'country' => 'Example',
'country_code' => 'Example',
'country_id' => 1
],
'requested_send_date' => '2026-10-20T12:00:00Z'
]),
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/handwrytten/drafts"
payload := strings.NewReader("{\n \"generated_mailing_id\": 1,\n \"donor_id\": 1,\n \"fundraising_work_item_id\": 1,\n \"rule_id\": 1,\n \"program_id\": 1,\n \"campaign_key\": \"Campaign Key\",\n \"account_mode\": \"hys_managed\",\n \"card_vendor_id\": \"Card Vendor Id\",\n \"card_name\": \"Card Name\",\n \"font_label\": \"Font Label\",\n \"insert_vendor_id\": \"Insert Vendor Id\",\n \"message_template\": \"Message Template\",\n \"message\": \"Message\",\n \"merge_data\": {},\n \"recipient_address\": {\n \"first_name\": \"Example\",\n \"last_name\": \"Example\",\n \"name\": \"Example\",\n \"address1\": \"Example\",\n \"address2\": \"Example\",\n \"street\": \"Example\",\n \"address_line2\": \"Example\",\n \"city\": \"Example\",\n \"state\": \"Example\",\n \"province\": \"Example\",\n \"zip\": \"Example\",\n \"postal_code\": \"Example\",\n \"country\": \"Example\",\n \"country_code\": \"Example\",\n \"country_id\": 1\n },\n \"sender_address\": {\n \"first_name\": \"Example\",\n \"last_name\": \"Example\",\n \"name\": \"Example\",\n \"address1\": \"Example\",\n \"address2\": \"Example\",\n \"street\": \"Example\",\n \"address_line2\": \"Example\",\n \"city\": \"Example\",\n \"state\": \"Example\",\n \"province\": \"Example\",\n \"zip\": \"Example\",\n \"postal_code\": \"Example\",\n \"country\": \"Example\",\n \"country_code\": \"Example\",\n \"country_id\": 1\n },\n \"requested_send_date\": \"2026-10-20T12:00:00Z\"\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/handwrytten/drafts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"generated_mailing_id\": 1,\n \"donor_id\": 1,\n \"fundraising_work_item_id\": 1,\n \"rule_id\": 1,\n \"program_id\": 1,\n \"campaign_key\": \"Campaign Key\",\n \"account_mode\": \"hys_managed\",\n \"card_vendor_id\": \"Card Vendor Id\",\n \"card_name\": \"Card Name\",\n \"font_label\": \"Font Label\",\n \"insert_vendor_id\": \"Insert Vendor Id\",\n \"message_template\": \"Message Template\",\n \"message\": \"Message\",\n \"merge_data\": {},\n \"recipient_address\": {\n \"first_name\": \"Example\",\n \"last_name\": \"Example\",\n \"name\": \"Example\",\n \"address1\": \"Example\",\n \"address2\": \"Example\",\n \"street\": \"Example\",\n \"address_line2\": \"Example\",\n \"city\": \"Example\",\n \"state\": \"Example\",\n \"province\": \"Example\",\n \"zip\": \"Example\",\n \"postal_code\": \"Example\",\n \"country\": \"Example\",\n \"country_code\": \"Example\",\n \"country_id\": 1\n },\n \"sender_address\": {\n \"first_name\": \"Example\",\n \"last_name\": \"Example\",\n \"name\": \"Example\",\n \"address1\": \"Example\",\n \"address2\": \"Example\",\n \"street\": \"Example\",\n \"address_line2\": \"Example\",\n \"city\": \"Example\",\n \"state\": \"Example\",\n \"province\": \"Example\",\n \"zip\": \"Example\",\n \"postal_code\": \"Example\",\n \"country\": \"Example\",\n \"country_code\": \"Example\",\n \"country_id\": 1\n },\n \"requested_send_date\": \"2026-10-20T12:00:00Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gratona.com/v1/admin/handwrytten/drafts")
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 \"generated_mailing_id\": 1,\n \"donor_id\": 1,\n \"fundraising_work_item_id\": 1,\n \"rule_id\": 1,\n \"program_id\": 1,\n \"campaign_key\": \"Campaign Key\",\n \"account_mode\": \"hys_managed\",\n \"card_vendor_id\": \"Card Vendor Id\",\n \"card_name\": \"Card Name\",\n \"font_label\": \"Font Label\",\n \"insert_vendor_id\": \"Insert Vendor Id\",\n \"message_template\": \"Message Template\",\n \"message\": \"Message\",\n \"merge_data\": {},\n \"recipient_address\": {\n \"first_name\": \"Example\",\n \"last_name\": \"Example\",\n \"name\": \"Example\",\n \"address1\": \"Example\",\n \"address2\": \"Example\",\n \"street\": \"Example\",\n \"address_line2\": \"Example\",\n \"city\": \"Example\",\n \"state\": \"Example\",\n \"province\": \"Example\",\n \"zip\": \"Example\",\n \"postal_code\": \"Example\",\n \"country\": \"Example\",\n \"country_code\": \"Example\",\n \"country_id\": 1\n },\n \"sender_address\": {\n \"first_name\": \"Example\",\n \"last_name\": \"Example\",\n \"name\": \"Example\",\n \"address1\": \"Example\",\n \"address2\": \"Example\",\n \"street\": \"Example\",\n \"address_line2\": \"Example\",\n \"city\": \"Example\",\n \"state\": \"Example\",\n \"province\": \"Example\",\n \"zip\": \"Example\",\n \"postal_code\": \"Example\",\n \"country\": \"Example\",\n \"country_code\": \"Example\",\n \"country_id\": 1\n },\n \"requested_send_date\": \"2026-10-20T12:00:00Z\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": 42,
"donor_id": 42,
"generated_mailing_id": 42,
"mailing_run_id": 42,
"fundraising_work_item_id": 42,
"status": "Example",
"approval_status": "Example",
"vendor_order_id": "Example",
"vendor_status": "Example",
"card_name": "Example",
"card_vendor_id": "Example",
"font_label": "Example",
"insert_vendor_id": "Example",
"message_resolved": "Example",
"created_by_user_name": "Example",
"submitted_at": "2026-10-20T12:00:00Z",
"requested_send_date": "2026-10-20",
"recipient_address_snapshot_json": {
"first_name": "Example",
"last_name": "Example",
"name": "Example",
"address1": "Example",
"address2": "Example",
"street": "Example",
"address_line2": "Example",
"city": "Example",
"state": "Example",
"province": "Example",
"zip": "Example",
"postal_code": "Example",
"country": "Example",
"country_code": "Example",
"country_id": 1
},
"price": {
"billing_mode": "managed_wallet",
"pricing_version": "Example",
"rate_label": "Example",
"currency": "usd",
"components": [
{
"key": "Example",
"label": "Example",
"amount_cents": 100
}
],
"total_cents": 100
},
"governance_flags_json": {
"blocking_reasons": [
"Missing recipient country."
]
}
}
}{
"message": "Unauthorized",
"status": "error"
}{
"message": "Not Found",
"status": "error"
}{
"errors": {},
"status": "error",
"message": "The given data was invalid."
}Authorizations
Passport bearer token authentication for legacy admin sessions.
Body
Validated request fields for this operation.
Generated mailing id. Validation: nullable, integer.
1
Donor id. Validation: nullable, integer.
1
Fundraising work item id. Validation: nullable, integer.
1
Rule id. Validation: nullable, integer.
1
Program id. Validation: nullable, integer.
1
Campaign key. Validation: nullable, string, max:128.
128"Campaign Key"
Account mode. Validation: nullable, string; allowed values: hys_managed, partner_owned.
hys_managed, partner_owned, null "hys_managed"
Card vendor id. Validation: nullable, string, max:64.
64"Card Vendor Id"
Card name. Validation: nullable, string, max:191.
191"Card Name"
Font label. Validation: nullable, string, max:191.
191"Font Label"
Insert vendor id. Validation: nullable, string, max:128.
128"Insert Vendor Id"
Message template. Validation: required_without:message, string.
"Message Template"
Message. Validation: required_without:message_template, string.
"Message"
Merge data. Validation: nullable, array.
Show child attributes
Show child attributes
Postal address snapshot. Country representations must agree with the active catalog; state/province is required for supported countries that require it.
Show child attributes
Show child attributes
Postal address snapshot. Country representations must agree with the active catalog; state/province is required for supported countries that require it.
Show child attributes
Show child attributes
Requested send date. Validation: nullable, date.
"2026-10-20T12:00:00Z"
Response
Operation result.
Customer order projection. Practice test_submitted status is presented as verification_complete; provider state, request payloads, credentials and margin are omitted.
Show child attributes
Show child attributes
curl --request POST \
--url https://api.gratona.com/v1/admin/handwrytten/drafts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"generated_mailing_id": 1,
"donor_id": 1,
"fundraising_work_item_id": 1,
"rule_id": 1,
"program_id": 1,
"campaign_key": "Campaign Key",
"account_mode": "hys_managed",
"card_vendor_id": "Card Vendor Id",
"card_name": "Card Name",
"font_label": "Font Label",
"insert_vendor_id": "Insert Vendor Id",
"message_template": "Message Template",
"message": "Message",
"merge_data": {},
"recipient_address": {
"first_name": "Example",
"last_name": "Example",
"name": "Example",
"address1": "Example",
"address2": "Example",
"street": "Example",
"address_line2": "Example",
"city": "Example",
"state": "Example",
"province": "Example",
"zip": "Example",
"postal_code": "Example",
"country": "Example",
"country_code": "Example",
"country_id": 1
},
"sender_address": {
"first_name": "Example",
"last_name": "Example",
"name": "Example",
"address1": "Example",
"address2": "Example",
"street": "Example",
"address_line2": "Example",
"city": "Example",
"state": "Example",
"province": "Example",
"zip": "Example",
"postal_code": "Example",
"country": "Example",
"country_code": "Example",
"country_id": 1
},
"requested_send_date": "2026-10-20T12:00:00Z"
}
'import requests
url = "https://api.gratona.com/v1/admin/handwrytten/drafts"
payload = {
"generated_mailing_id": 1,
"donor_id": 1,
"fundraising_work_item_id": 1,
"rule_id": 1,
"program_id": 1,
"campaign_key": "Campaign Key",
"account_mode": "hys_managed",
"card_vendor_id": "Card Vendor Id",
"card_name": "Card Name",
"font_label": "Font Label",
"insert_vendor_id": "Insert Vendor Id",
"message_template": "Message Template",
"message": "Message",
"merge_data": {},
"recipient_address": {
"first_name": "Example",
"last_name": "Example",
"name": "Example",
"address1": "Example",
"address2": "Example",
"street": "Example",
"address_line2": "Example",
"city": "Example",
"state": "Example",
"province": "Example",
"zip": "Example",
"postal_code": "Example",
"country": "Example",
"country_code": "Example",
"country_id": 1
},
"sender_address": {
"first_name": "Example",
"last_name": "Example",
"name": "Example",
"address1": "Example",
"address2": "Example",
"street": "Example",
"address_line2": "Example",
"city": "Example",
"state": "Example",
"province": "Example",
"zip": "Example",
"postal_code": "Example",
"country": "Example",
"country_code": "Example",
"country_id": 1
},
"requested_send_date": "2026-10-20T12:00:00Z"
}
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({
generated_mailing_id: 1,
donor_id: 1,
fundraising_work_item_id: 1,
rule_id: 1,
program_id: 1,
campaign_key: 'Campaign Key',
account_mode: 'hys_managed',
card_vendor_id: 'Card Vendor Id',
card_name: 'Card Name',
font_label: 'Font Label',
insert_vendor_id: 'Insert Vendor Id',
message_template: 'Message Template',
message: 'Message',
merge_data: {},
recipient_address: {
first_name: 'Example',
last_name: 'Example',
name: 'Example',
address1: 'Example',
address2: 'Example',
street: 'Example',
address_line2: 'Example',
city: 'Example',
state: 'Example',
province: 'Example',
zip: 'Example',
postal_code: 'Example',
country: 'Example',
country_code: 'Example',
country_id: 1
},
sender_address: {
first_name: 'Example',
last_name: 'Example',
name: 'Example',
address1: 'Example',
address2: 'Example',
street: 'Example',
address_line2: 'Example',
city: 'Example',
state: 'Example',
province: 'Example',
zip: 'Example',
postal_code: 'Example',
country: 'Example',
country_code: 'Example',
country_id: 1
},
requested_send_date: '2026-10-20T12:00:00Z'
})
};
fetch('https://api.gratona.com/v1/admin/handwrytten/drafts', 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/handwrytten/drafts",
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([
'generated_mailing_id' => 1,
'donor_id' => 1,
'fundraising_work_item_id' => 1,
'rule_id' => 1,
'program_id' => 1,
'campaign_key' => 'Campaign Key',
'account_mode' => 'hys_managed',
'card_vendor_id' => 'Card Vendor Id',
'card_name' => 'Card Name',
'font_label' => 'Font Label',
'insert_vendor_id' => 'Insert Vendor Id',
'message_template' => 'Message Template',
'message' => 'Message',
'merge_data' => [
],
'recipient_address' => [
'first_name' => 'Example',
'last_name' => 'Example',
'name' => 'Example',
'address1' => 'Example',
'address2' => 'Example',
'street' => 'Example',
'address_line2' => 'Example',
'city' => 'Example',
'state' => 'Example',
'province' => 'Example',
'zip' => 'Example',
'postal_code' => 'Example',
'country' => 'Example',
'country_code' => 'Example',
'country_id' => 1
],
'sender_address' => [
'first_name' => 'Example',
'last_name' => 'Example',
'name' => 'Example',
'address1' => 'Example',
'address2' => 'Example',
'street' => 'Example',
'address_line2' => 'Example',
'city' => 'Example',
'state' => 'Example',
'province' => 'Example',
'zip' => 'Example',
'postal_code' => 'Example',
'country' => 'Example',
'country_code' => 'Example',
'country_id' => 1
],
'requested_send_date' => '2026-10-20T12:00:00Z'
]),
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/handwrytten/drafts"
payload := strings.NewReader("{\n \"generated_mailing_id\": 1,\n \"donor_id\": 1,\n \"fundraising_work_item_id\": 1,\n \"rule_id\": 1,\n \"program_id\": 1,\n \"campaign_key\": \"Campaign Key\",\n \"account_mode\": \"hys_managed\",\n \"card_vendor_id\": \"Card Vendor Id\",\n \"card_name\": \"Card Name\",\n \"font_label\": \"Font Label\",\n \"insert_vendor_id\": \"Insert Vendor Id\",\n \"message_template\": \"Message Template\",\n \"message\": \"Message\",\n \"merge_data\": {},\n \"recipient_address\": {\n \"first_name\": \"Example\",\n \"last_name\": \"Example\",\n \"name\": \"Example\",\n \"address1\": \"Example\",\n \"address2\": \"Example\",\n \"street\": \"Example\",\n \"address_line2\": \"Example\",\n \"city\": \"Example\",\n \"state\": \"Example\",\n \"province\": \"Example\",\n \"zip\": \"Example\",\n \"postal_code\": \"Example\",\n \"country\": \"Example\",\n \"country_code\": \"Example\",\n \"country_id\": 1\n },\n \"sender_address\": {\n \"first_name\": \"Example\",\n \"last_name\": \"Example\",\n \"name\": \"Example\",\n \"address1\": \"Example\",\n \"address2\": \"Example\",\n \"street\": \"Example\",\n \"address_line2\": \"Example\",\n \"city\": \"Example\",\n \"state\": \"Example\",\n \"province\": \"Example\",\n \"zip\": \"Example\",\n \"postal_code\": \"Example\",\n \"country\": \"Example\",\n \"country_code\": \"Example\",\n \"country_id\": 1\n },\n \"requested_send_date\": \"2026-10-20T12:00:00Z\"\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/handwrytten/drafts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"generated_mailing_id\": 1,\n \"donor_id\": 1,\n \"fundraising_work_item_id\": 1,\n \"rule_id\": 1,\n \"program_id\": 1,\n \"campaign_key\": \"Campaign Key\",\n \"account_mode\": \"hys_managed\",\n \"card_vendor_id\": \"Card Vendor Id\",\n \"card_name\": \"Card Name\",\n \"font_label\": \"Font Label\",\n \"insert_vendor_id\": \"Insert Vendor Id\",\n \"message_template\": \"Message Template\",\n \"message\": \"Message\",\n \"merge_data\": {},\n \"recipient_address\": {\n \"first_name\": \"Example\",\n \"last_name\": \"Example\",\n \"name\": \"Example\",\n \"address1\": \"Example\",\n \"address2\": \"Example\",\n \"street\": \"Example\",\n \"address_line2\": \"Example\",\n \"city\": \"Example\",\n \"state\": \"Example\",\n \"province\": \"Example\",\n \"zip\": \"Example\",\n \"postal_code\": \"Example\",\n \"country\": \"Example\",\n \"country_code\": \"Example\",\n \"country_id\": 1\n },\n \"sender_address\": {\n \"first_name\": \"Example\",\n \"last_name\": \"Example\",\n \"name\": \"Example\",\n \"address1\": \"Example\",\n \"address2\": \"Example\",\n \"street\": \"Example\",\n \"address_line2\": \"Example\",\n \"city\": \"Example\",\n \"state\": \"Example\",\n \"province\": \"Example\",\n \"zip\": \"Example\",\n \"postal_code\": \"Example\",\n \"country\": \"Example\",\n \"country_code\": \"Example\",\n \"country_id\": 1\n },\n \"requested_send_date\": \"2026-10-20T12:00:00Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gratona.com/v1/admin/handwrytten/drafts")
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 \"generated_mailing_id\": 1,\n \"donor_id\": 1,\n \"fundraising_work_item_id\": 1,\n \"rule_id\": 1,\n \"program_id\": 1,\n \"campaign_key\": \"Campaign Key\",\n \"account_mode\": \"hys_managed\",\n \"card_vendor_id\": \"Card Vendor Id\",\n \"card_name\": \"Card Name\",\n \"font_label\": \"Font Label\",\n \"insert_vendor_id\": \"Insert Vendor Id\",\n \"message_template\": \"Message Template\",\n \"message\": \"Message\",\n \"merge_data\": {},\n \"recipient_address\": {\n \"first_name\": \"Example\",\n \"last_name\": \"Example\",\n \"name\": \"Example\",\n \"address1\": \"Example\",\n \"address2\": \"Example\",\n \"street\": \"Example\",\n \"address_line2\": \"Example\",\n \"city\": \"Example\",\n \"state\": \"Example\",\n \"province\": \"Example\",\n \"zip\": \"Example\",\n \"postal_code\": \"Example\",\n \"country\": \"Example\",\n \"country_code\": \"Example\",\n \"country_id\": 1\n },\n \"sender_address\": {\n \"first_name\": \"Example\",\n \"last_name\": \"Example\",\n \"name\": \"Example\",\n \"address1\": \"Example\",\n \"address2\": \"Example\",\n \"street\": \"Example\",\n \"address_line2\": \"Example\",\n \"city\": \"Example\",\n \"state\": \"Example\",\n \"province\": \"Example\",\n \"zip\": \"Example\",\n \"postal_code\": \"Example\",\n \"country\": \"Example\",\n \"country_code\": \"Example\",\n \"country_id\": 1\n },\n \"requested_send_date\": \"2026-10-20T12:00:00Z\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": 42,
"donor_id": 42,
"generated_mailing_id": 42,
"mailing_run_id": 42,
"fundraising_work_item_id": 42,
"status": "Example",
"approval_status": "Example",
"vendor_order_id": "Example",
"vendor_status": "Example",
"card_name": "Example",
"card_vendor_id": "Example",
"font_label": "Example",
"insert_vendor_id": "Example",
"message_resolved": "Example",
"created_by_user_name": "Example",
"submitted_at": "2026-10-20T12:00:00Z",
"requested_send_date": "2026-10-20",
"recipient_address_snapshot_json": {
"first_name": "Example",
"last_name": "Example",
"name": "Example",
"address1": "Example",
"address2": "Example",
"street": "Example",
"address_line2": "Example",
"city": "Example",
"state": "Example",
"province": "Example",
"zip": "Example",
"postal_code": "Example",
"country": "Example",
"country_code": "Example",
"country_id": 1
},
"price": {
"billing_mode": "managed_wallet",
"pricing_version": "Example",
"rate_label": "Example",
"currency": "usd",
"components": [
{
"key": "Example",
"label": "Example",
"amount_cents": 100
}
],
"total_cents": 100
},
"governance_flags_json": {
"blocking_reasons": [
"Missing recipient country."
]
}
}
}{
"message": "Unauthorized",
"status": "error"
}{
"message": "Not Found",
"status": "error"
}{
"errors": {},
"status": "error",
"message": "The given data was invalid."
}