curl --request POST \
--url https://prod-api.raisedonors.com/api/MotivationCode \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"code": "<string>",
"siteUrl": "<string>",
"description": "<string>",
"zipCodes": "<string>",
"price": 123,
"cost": 123,
"sortOrder": 123,
"pin": true,
"groups": [
{
"id": 123
}
]
}
'const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
code: '<string>',
siteUrl: '<string>',
description: '<string>',
zipCodes: '<string>',
price: 123,
cost: 123,
sortOrder: 123,
pin: true,
groups: [{id: 123}]
})
};
fetch('https://prod-api.raisedonors.com/api/MotivationCode', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://prod-api.raisedonors.com/api/MotivationCode"
payload = {
"name": "<string>",
"code": "<string>",
"siteUrl": "<string>",
"description": "<string>",
"zipCodes": "<string>",
"price": 123,
"cost": 123,
"sortOrder": 123,
"pin": True,
"groups": [{ "id": 123 }]
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)using RestSharp;
var options = new RestClientOptions("https://prod-api.raisedonors.com/api/MotivationCode");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "<api-key>");
request.AddJsonBody("{\n \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"siteUrl\": \"<string>\",\n \"description\": \"<string>\",\n \"zipCodes\": \"<string>\",\n \"price\": 123,\n \"cost\": 123,\n \"sortOrder\": 123,\n \"pin\": true,\n \"groups\": [\n {\n \"id\": 123\n }\n ]\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://prod-api.raisedonors.com/api/MotivationCode",
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([
'name' => '<string>',
'code' => '<string>',
'siteUrl' => '<string>',
'description' => '<string>',
'zipCodes' => '<string>',
'price' => 123,
'cost' => 123,
'sortOrder' => 123,
'pin' => true,
'groups' => [
[
'id' => 123
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://prod-api.raisedonors.com/api/MotivationCode")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"siteUrl\": \"<string>\",\n \"description\": \"<string>\",\n \"zipCodes\": \"<string>\",\n \"price\": 123,\n \"cost\": 123,\n \"sortOrder\": 123,\n \"pin\": true,\n \"groups\": [\n {\n \"id\": 123\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://prod-api.raisedonors.com/api/MotivationCode")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"siteUrl\": \"<string>\",\n \"description\": \"<string>\",\n \"zipCodes\": \"<string>\",\n \"price\": 123,\n \"cost\": 123,\n \"sortOrder\": 123,\n \"pin\": true,\n \"groups\": [\n {\n \"id\": 123\n }\n ]\n}"
response = http.request(request)
puts response.read_bodyconst url = 'https://prod-api.raisedonors.com/api/MotivationCode';
const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
code: '<string>',
siteUrl: '<string>',
description: '<string>',
zipCodes: '<string>',
price: 123,
cost: 123,
sortOrder: 123,
pin: true,
groups: [{id: 123}]
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));{
"id": 6120,
"name": "Year-End Email Appeal",
"code": "YE25-EMAIL",
"siteUrl": "https://riversidehope.example.org/give/year-end-appeal",
"description": "Email appeal for the 2025 year-end campaign.",
"zipCodes": null,
"price": 0,
"cost": 480,
"sortOrder": 1,
"pin": true,
"groups": [
{
"id": 720,
"name": "Year-End 2025 Appeals"
}
]
}{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"errors": {
"code": [
"The code field is required."
]
},
"instance": "/api/MotivationCode"
}{
"type": "https://tools.ietf.org/html/rfc7235#section-3.1",
"title": "Unauthorized",
"status": 401,
"detail": "The Authorization header is missing, malformed, or carries a token that is expired or revoked.",
"instance": "/api/MotivationCode"
}Create a Motivation Code
Creates a motivation code you can attribute gifts to.
curl --request POST \
--url https://prod-api.raisedonors.com/api/MotivationCode \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"code": "<string>",
"siteUrl": "<string>",
"description": "<string>",
"zipCodes": "<string>",
"price": 123,
"cost": 123,
"sortOrder": 123,
"pin": true,
"groups": [
{
"id": 123
}
]
}
'const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
code: '<string>',
siteUrl: '<string>',
description: '<string>',
zipCodes: '<string>',
price: 123,
cost: 123,
sortOrder: 123,
pin: true,
groups: [{id: 123}]
})
};
fetch('https://prod-api.raisedonors.com/api/MotivationCode', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://prod-api.raisedonors.com/api/MotivationCode"
payload = {
"name": "<string>",
"code": "<string>",
"siteUrl": "<string>",
"description": "<string>",
"zipCodes": "<string>",
"price": 123,
"cost": 123,
"sortOrder": 123,
"pin": True,
"groups": [{ "id": 123 }]
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)using RestSharp;
var options = new RestClientOptions("https://prod-api.raisedonors.com/api/MotivationCode");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "<api-key>");
request.AddJsonBody("{\n \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"siteUrl\": \"<string>\",\n \"description\": \"<string>\",\n \"zipCodes\": \"<string>\",\n \"price\": 123,\n \"cost\": 123,\n \"sortOrder\": 123,\n \"pin\": true,\n \"groups\": [\n {\n \"id\": 123\n }\n ]\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://prod-api.raisedonors.com/api/MotivationCode",
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([
'name' => '<string>',
'code' => '<string>',
'siteUrl' => '<string>',
'description' => '<string>',
'zipCodes' => '<string>',
'price' => 123,
'cost' => 123,
'sortOrder' => 123,
'pin' => true,
'groups' => [
[
'id' => 123
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://prod-api.raisedonors.com/api/MotivationCode")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"siteUrl\": \"<string>\",\n \"description\": \"<string>\",\n \"zipCodes\": \"<string>\",\n \"price\": 123,\n \"cost\": 123,\n \"sortOrder\": 123,\n \"pin\": true,\n \"groups\": [\n {\n \"id\": 123\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://prod-api.raisedonors.com/api/MotivationCode")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"siteUrl\": \"<string>\",\n \"description\": \"<string>\",\n \"zipCodes\": \"<string>\",\n \"price\": 123,\n \"cost\": 123,\n \"sortOrder\": 123,\n \"pin\": true,\n \"groups\": [\n {\n \"id\": 123\n }\n ]\n}"
response = http.request(request)
puts response.read_bodyconst url = 'https://prod-api.raisedonors.com/api/MotivationCode';
const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
code: '<string>',
siteUrl: '<string>',
description: '<string>',
zipCodes: '<string>',
price: 123,
cost: 123,
sortOrder: 123,
pin: true,
groups: [{id: 123}]
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));{
"id": 6120,
"name": "Year-End Email Appeal",
"code": "YE25-EMAIL",
"siteUrl": "https://riversidehope.example.org/give/year-end-appeal",
"description": "Email appeal for the 2025 year-end campaign.",
"zipCodes": null,
"price": 0,
"cost": 480,
"sortOrder": 1,
"pin": true,
"groups": [
{
"id": 720,
"name": "Year-End 2025 Appeals"
}
]
}{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"errors": {
"code": [
"The code field is required."
]
},
"instance": "/api/MotivationCode"
}{
"type": "https://tools.ietf.org/html/rfc7235#section-3.1",
"title": "Unauthorized",
"status": 401,
"detail": "The Authorization header is missing, malformed, or carries a token that is expired or revoked.",
"instance": "/api/MotivationCode"
}name and code, the mediaType describing where it is used, and optionally the groups it belongs to. Returns the created code with its new id, which you can pass as motivationCodeId when processing a donation.Authorizations
JWT Authorization header using the Bearer scheme. Example: "Authorization: Bearer {token}"
Body
The motivation code details to create.
The name of the motivation code.
1 - 100The code itself, as it appears on gifts.
1 - 100The kind of media the code is used for, such as Email or Direct Mail.
0, 1, 2, 3, 4, 5, 6, 7 The URL of the site or ad the code is used on.
100The description of the motivation code.
1000The postal codes the code was used in, separated by commas.
100The revenue attributed to the code, used for reporting on its return.
What running the code cost, used for reporting on its return.
The position of the code in the order it is displayed in.
Whether the code is pinned to the top of the list.
The groups the code belongs to.
Show child attributes
Show child attributes
Response
OK
The unique identifier of the motivation code.
The name of the motivation code.
The code itself, as it appears on gifts.
The kind of media the code is used for, such as Email or Direct Mail.
0, 1, 2, 3, 4, 5, 6, 7 The URL of the site or ad the code is used on.
The description of the motivation code.
The postal codes the code was used in, separated by commas.
The revenue attributed to the code, used for reporting on its return.
What running the code cost, used for reporting on its return.
The position of the code in the order it is displayed in.
Whether the code is pinned to the top of the list.
The groups the code belongs to.
Show child attributes
Show child attributes
Was this page helpful?