The provided API's are based on simple HTTP GET and POST operations. All requests must be made over HTTPS using TLS 1.2 (SSLv2, SSLv3, TLSv1, and TLSv1.1 not supported). Any request that does not meet these requirements will be rejected. You can choose whether you want to receive a response in XML or JSON. This version of the API contains the following operations:
Donation Feed
List Campaigns
Get Campaign Info
Submit Donation
Account Totals
Campaign Totals
Account History
Campaign History
Donation Feed
You can query Transaxt to get a feed of the last 25 donations that were submitted to your account. This can be used for presenting a scrolling list or marquee on a web-page (see sample page code below). You can control the information that is provided in the feed by changing your account settings. The feed is "off" be default, so you must first change the setting on your account page for it to work. Next, you need to get your account code, which can be located on your account home page when you login. Finally, execute an HTTP GET to a URL specified in one of these formats (replace [account code] with your actual code):
https:/transaxt.com/api/1/feed/[account code] (returns XML)
https:/transaxt.com/api/1/feed/[account code]/json (returns JSON)
https:/transaxt.com/api/1/feed/[account code]/jsonp (executes JSONP request for JavaScript inside web-pages -- see below for example.)
Optional URL parameters:
?last=n — Tells the api to return the last n donations. If omitted or greater than 25, then the last 25 donations will be returned.
?callback=function — Required for JSONP
Data Returned
NOTE: In order to safeguard performance under heavy load, the results of these requests are cached on the server for up to 1 minutes. Therefore, multiple calls within a 1 minute span will likely return the same results, even if new donations where created.
This operation returns the following information, either in XML, JSON, or JSONP formats:
Example XML Response
<DonationFeedResult xmlns="http://transaxt.com/api/1" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<ResultCode>0</ResultCode>
<Message>OK</Message>
<QueryTimeUTC>2012-02-14T20:27:19.432762Z</QueryTimeUTC>
<Donations>
<Donation>
<Amount>10.00</Amount>
<AmountString>$10.00</AmountString>
<DonatedAtUTC>2012-01-24T18:17:03.52Z</DonatedAtUTC>
<DonationID>99a2c096-2b3e-441c-9780-d05f1f4ccf3b</DonationID>
<DonorLocation>Rockford, MI</DonorLocation>
<DonorName>John D</DonorName>
</Donation>
<Donation>
<Amount>100.00</Amount>
<AmountString>$100.00</AmountString>
<DonatedAtUTC>2012-01-24T18:10:29.137Z</DonatedAtUTC>
<DonationID>3de91742-66ec-4268-bf17-2a04aee064bf</DonationID>
<DonorLocation>Gaylord, MI</DonorLocation>
<DonorName>Carrie T</DonorName>
</Donation>
...
</Donations>
</DonationFeedResult>
Example JSON Response
{
"Donations":[
{
"Amount":10.00,
"AmountString":"$10.00",
"DonatedAtUTC":"\/Date(1327429023520)\/",
"DonationID":"99a2c096-2b3e-441c-9780-d05f1f4ccf3b",
"DonorLocation":"Rockford, MI",
"DonorName":"John D"
},
{
"Amount":100.00,
"AmountString":"$100.00",
"DonatedAtUTC":"\/Date(1327428629137)\/",
"DonationID":"3de91742-66ec-4268-bf17-2a04aee064bf",
"DonorLocation":"Gaylord, MI",
"DonorName":"Carrie T"
},
...
],
"Message":"OK",
"QueryTimeUTC":"\/Date(1329251506212)\/",
"ResultCode":0
}
HTML Example: Using jQuery and JSONP to display a donation feed marquee on a web page
The HTML below represents an example of using jQuery to access a JSONP feed and display an animated marquee of recent donors.
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Donation Feed (v1) Sample</title>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" ></script>
<style type="text/css">
body {font-family:Trebuchet MS;}
#feed-ticker {font-size:12px;}
.d-hdg {font-size:12px;color:Blue;}
.d-donor{font-weight:bold;padding-right:20px;}
.d-location{padding-right:20px;color:#777;}
.d-amount{font-weight:bold;color:Green;}
</style>
</head>
<body>
<div class="d-hdg">Thank you for your donations:</div>
<div id="feed-ticker">Loading...</div>
<script type="text/javascript">
(function() {
var donations = [];
var displayIndex = 0;
var isFirstUpdate = true;
function encodeHtml(value) {
return $('<div />').text(value).html()
}
function refreshFeed() {
$.ajax({
dataType: 'jsonp',
url: "https://transaxt.com/api/1/feed/ph935k/jsonp", // replace 'ph935k' with your account code
success: function (data) {
if ( data.ResultCode == 0 ) {
donations = data.Donations;
if (isFirstUpdate) {
isFirstUpdate = false;
updateDisplay();
}
}
else {
$("#feed-ticker").text(data.Message);
}
},
complete: function() { setTimeout( refreshFeed, 330000 ); } // Refreshes feed every 5.5 minutes
});
}
function updateDisplay() {
if (donations.length > 0) {
if (displayIndex >= donations.length) {
displayIndex = 0;
}
try {
var donation = donations[displayIndex];
var html = [];
html.push('<span class="d-donor">' + encodeHtml(donation.DonorName) + '</span>');
html.push('<span class="d-location">' + encodeHtml(donation.DonorLocation) + '</span>');
html.push('<span class="d-amount">' + encodeHtml(donation.AmountString) + '</span>');
$("#feed-ticker").fadeOut(500, function() {
$("#feed-ticker").html(html.join(""));
$("#feed-ticker").fadeIn(500);
});
}
catch (e) {}
displayIndex++;
}
setTimeout(updateDisplay, 8000); // Update display every 8 seconds
}
$(document).ready(refreshFeed);
})();
</script>
</body>
</html>
List Campaigns
This method will return a list of campaigns and their campaign codes for the provided account code. First, you need to get your account code, which can be located on your account home page when you login. Next, execute an HTTP GET to a URL specified in one of these formats (replace [account code] with your actual code):
https:/transaxt.com/api/1/campaignlist/[account code] (returns XML)
https:/transaxt.com/api/1/campaignlist/[account code]/json (returns JSON)
https:/transaxt.com/api/1/campaignlist/[account code]/jsonp (executes JSONP request for JavaScript inside web-pages)
Data Returned
This operation returns the following information, either in XML, JSON, or JSONP formats:
Example XML Response
<CampaignListResult xmlns="http://transaxt.com/api/1" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<Campaigns>
<CampaignItem>
<CampaignCode>78FLY3</CampaignCode>
<Description>First major radio campaign of the season.</Description>
<Name>Radio campaign</Name>
</CampaignItem>
<CampaignItem>
<CampaignCode>Y76P48</CampaignCode>
<Description/>
<Name>Chicago Event</Name>
</CampaignItem>
...
</Campaigns>
<Message>OK</Message>
<ResultCode>0</ResultCode>
</CampaignListResult>
Example JSON Response
{
"Campaigns":[
{
"CampaignCode":"78FLY3",
"Description":"First radio campaign of the season",
"Name":"Radio Campaign"
},
{
"CampaignCode":"Y76P48",
"Description":"",
"Name":"Chicago Event"
}
],
"Message":"OK",
"ResultCode":0
}
Get Campaign Info
You can query Transaxt to get setup information for a particular campaign. First, you need to get the campaign code, which can be located on the campaign setup page when you login to your account. Next, execute an HTTP GET to a URL specified in one of these formats (replace [campaign code] with your actual code):
https:/transaxt.com/api/1/campaigninfo/[campaign code] (returns XML)
https:/transaxt.com/api/1/campaigninfo/[campaign code]/json (returns JSON)
Data Returned
This operation returns the following information, either in XML or JSON format:
Example XML Response
<?xml version="1.0" encoding="utf-8"?>
<CampaignInfoResult xmlns="http://transaxt.com/api/1" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<CampaignCode>Y76P48</CampaignCode>
<CampaignMessage>Thank you very much for your contribution.</CampaignMessage>
<Committee>Pike for President</Committee>
<ComplianceText>I affirm that I am making this contribution via my personal credit or debit card for which I have a legal obligation to pay, and not through a corporate or business entity card or the card of another person.</ComplianceText>
<CustomDataHeading1>Ref ID</CustomDataHeading1>
<CustomDataHeading2>Notes</CustomDataHeading2>
<EmployerExtra1Heading>Employer Address</EmployerExtra1Heading>
<EmployerExtra2Heading></EmployerExtra2Heading>
<EmployerExtra3Heading></EmployerExtra3Heading>
<CustomDropDownOptions>
<Option>
<Value>News</Value>
</Option>
<Option>
<Value>Internet</Value>
</Option>
<Option>
<Value>Advertisements</Value>
</Option>
</CustomDropDownOptions>
<CustomDropDownQuestion>How did you hear about us?</CustomDropDownQuestion>
<DisclaimerText>Paid for by Pike for Congress</DisclaimerText>
<DonationLevels>
<DonationLevel>
<Amount>10.0000</Amount>
<Description>Basic</Description>
</DonationLevel>
<DonationLevel>
<Amount>20.0000</Amount>
<Description>Advanced</Description>
</DonationLevel>
<DonationLevel>
<Amount>30.0000</Amount>
<Description>Super</Description>
</DonationLevel>
</DonationLevels>
<IsCVVRequired>false</IsCVVRequired>
<IsCustomData1Required>true</IsCustomData1Required>
<IsCustomData2Required>false</IsCustomData2Required>
<IsCustomDropDownAnswerRequired>true</IsCustomDropDownAnswerRequired>
<IsEmployerExtra1Required>true</IsEmployerExtra1Required>
<IsEmployerExtra2Required>false</IsEmployerExtra2Required>
<IsEmployerExtra3Required>false</IsEmployerExtra3Required>
<Message>OK</Message>
<ResultCode>0</ResultCode>
<ThankYouText>Thank you for your donation!!!</ThankYouText>
<Title>Donate to Pike for Congress!</Title>
<VariableAmountsAllowed>true</VariableAmountsAllowed>
</CampaignInfoResult>
Example JSON Response
{
"CampaignCode":"Y76P48",
"CampaignMessage":"Thank you very much for your contribution.",
"Committee":"Pike for President",
"ComplianceText":"I affirm that I am making this contribution via my personal credit or debit card for which I have a legal obligation to pay, and not through a corporate or business entity card or the card of another person.\u000a",
"CustomDataHeading1":"Ref ID",
"CustomDataHeading2":"Notes",
"EmployerExtra1Heading":"Employer Address",
"EmployerExtra2Heading":"",
"EmployerExtra3Heading":"",
"CustomDropDownOptions":[{"Value":"News"},{"Value":"Internet"},{"Value":"Advertisements"}],
"CustomDropDownQuestion":"How did you hear about us?",
"DisclaimerText":"Paid for by Pike for Congress",
"DonationLevels":[
{"Amount":10.0000,"Description":"Basic"},
{"Amount":20.0000,"Description":"Advanced"},
{"Amount":30.0000,"Description":"Super"}
],
"IsCVVRequired":false,
"IsCustomData1Required":true,
"IsCustomData2Required":false,
"IsCustomDropDownAnswerRequired":true,
"IsEmployerExtra1Required":true,
"IsEmployerExtra2Required":false,
"IsEmployerExtra3Required":false,
"Message":"OK",
"ResultCode":0,
"ThankYouText":"Thank you for your donation!!!",
"Title":"Donate to Pike for Congress!",
"VariableAmountsAllowed":true
}
Submit Donation
You can submit donations to campaigns via HTTP forms POST. First, you need to get the campaign code, which can be located on the campaign setup page when you login to your account. Next, execute an HTTP POST to a URL specified in one of these formats (replace [campaign code] with your actual code):
https:/transaxt.com/api/1/donate/[campaign code] (returns XML)
https:/transaxt.com/api/1/donate/[campaign code]/json (returns JSON)
https:/transaxt.com/api/1/donate/[campaign code]/redirect (redirects browser to URL's specified in the post data -- see below)
Data Returned
This operation returns the following information, either in XML, JSON, or as query parameters appended to a redirected URL supplied by the caller:
Submission Fields
Data is submitted to the operation via a standard HTTP forms POST (content type = application/x-www-form-urlencoded.) This could be done programmatically or via a standard HTML page (with the FORM action set to the API URL.) The following fields are supported:
Example XML Response
<?xml version="1.0" encoding="utf-8"?>
<DonateResult xmlns="http://transaxt.com/api/1" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<ResultCode>0</ResultCode>
<Message>Thank you for your contribution!</Message>
<TransactionID>B575392A-2212-4099-91E3-56B5B2676994</TransactionID>
</DonateResult>
Example JSON Response
{
"ResultCode":0,
"Message":"Thank you for your contribution!",
"TransactionID":"B575392A-2212-4099-91E3-56B5B2676994"
}
Example of Redirection
The HTML below represents a simplistic example of a page that posts a donation to the API and has it redirect to another page. Obviously, a real page would need validation, etc.
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Donate API v1 Test Page</title>
</head>
<body>
<form action="https://transaxt.com/api/1/donate/Y76P48/redirect" method="post">
<ul>
<li>First Name:</li>
<li><input type="text" name="FirstName" /></li>
<li>Last Name:</li>
<li><input type="text" name="LastName" /></li>
<li>Phone #:</li>
<li><input type="text" name="Phone" /></li>
<li>Email Address:</li>
<li><input type="text" name="Email" /></li>
<li>Address 1:</li>
<li><input type="text" name="Address1" /></li>
<li>Address 2:</li>
<li><input type="text" name="Address2" /></li>
<li>City:</li>
<li><input type="text" name="City" /></li>
<li>State:</li>
<li><input type="text" name="State" /></li>
<li>Zip-code:</li>
<li><input type="text" name="Zip" /></li>
<li>Employer:</li>
<li><input type="text" name="Custom1" /></li>
<li>Occupation:</li>
<li><input type="text" name="Custom2" /></li>
<li>Employer Address:</li>
<li><input type="text" name="EmployerExtra1" /></li>
<li>Custom Drop-Down Question:</li>
<li>
<select name="Custom3">
<option>Option 1</option>
<option>Option 2</option>
<option>Option 3</option>
</select>
</li>
<li>Credit-card #:</li>
<li><input type="text" name="CreditCard" /></li>
<li>CVV (Security Code):</li>
<li><input type="text" name="CVV" /></li>
<li>Name on Card:</li>
<li><input type="text" name="NameOnCard" /></li>
<li>Expires Month:</li>
<li>
<select name="ExpiryMonth">
<option>01</option>
<option>02</option>
<option>03</option>
<option>04</option>
<option>05</option>
<option>06</option>
<option>07</option>
<option>08</option>
<option>09</option>
<option>10</option>
<option>11</option>
<option>12</option>
</select>
</li>
<li>Expires Year:</li>
<li>
<select name="ExpiryYear">
<option>2011</option>
<option>2012</option>
<option>2013</option>
<option>2014</option>
<option>2015</option>
<option>2016</option>
</select>
</li>
<li>Donation Amount:</li>
<li><input type="text" name="DonationAmount" /></li>
<li>
<input type="checkbox" name="BillingSameAsPersonal" /> Billing Address is Same as Personal Address
</li>
<li>Billing Address 1:</li>
<li><input type="text" name="BillAddress1" /></li>
<li>Billing Address 2:</li>
<li><input type="text" name="BillAddress2" /></li>
<li>Billing City:</li>
<li><input type="text" name="BillCity" /></li>
<li>Billing State:</li>
<li><input type="text" name="BillState" /></li>
<li>Billing Zip:</li>
<li><input type="text" name="BillZip" /></li>
</ul>
<input type="hidden" name="Source" value="API test page" />
<input type="hidden" name="RedirectOnSuccessURL" value="http://yourwebsite.com/DonateResponse.htm" />
<input type="hidden" name="RedirectOnFailureURL" value="http://yourwebsite.com/DonateResponse.htm" />
<button type="submit">Submit Donation</button>
</form>
</body>
</html>
The HTML below represents a simplistic example of a page that the above page might redirect to in order to display the result of the submission.
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Donate API v1 Response Page</title>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" ></script>
</head>
<body>
<h1 id="success"></h1>
<p id="message"></p>
<script type="text/javascript">
function getParameterByName(name) {
var match = RegExp('[?&]'+name+'=([^&]*)').exec(window.location.search);
return match && decodeURIComponent(match[1].replace(/\+/g, ' '));
}
$(document).ready( function() {
var wasSuccessful = getParameterByName("ResultCode") == "0";
$("#success").text( (wasSuccessful) ? "Donation Successful" : "There was a problem with your donation." );
$("#message").text(getParameterByName("Message"));
});
</script>
</body>
</html>
Account Totals
You can query Transaxt to get donation totals for an entire account. This is a private API and requires you to pass along your secret API key. To locate your API key, login to your Account Page and click on the "view API settings" link. You will also need your Account Code, which can also be located on your Account Page. Finally, execute an HTTP GET to a URL specified in one of these formats (replace [account code] and [api key] with your actual code and API key, respectively):
https:/transaxt.com/api/1/accounttotals/[account code]?apikey=[api key] (returns XML)
https:/transaxt.com/api/1/accounttotals/[account code]/json?apikey=[api key] (returns JSON)
Optional URL parameters:
?start=YYYY-MM-DD — Specify an inclusive start-date in YYYY-MM-DD format for the calculation.
?end=YYYY-MM-DD — Specify an inclusive end-date in YYYY-MM-DD format for the calculation.
If no additional parameters are passed, then the totals represent all time.
Data Returned
NOTE: In order to safeguard performance under heavy load, the results of these requests are cached on the server for up to 1 minutes. Therefore, multiple calls within a 1 minute span will likely return the same results, even if new donations where created.
This operation returns the following information, either in XML or JSON formats:
Example XML Response
<TotalsResult xmlns="http://transaxt.com/api/1" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<GrossTotal>20523.00</GrossTotal>
<Message>OK</Message>
<NetTotal>19558.42</NetTotal>
<ResultCode>0</ResultCode>
</TotalsResult>
Example JSON Response
{
"GrossTotal":20523.00,
"Message":"OK",
"NetTotal":19558.42,
"ResultCode":0
}
Campaign Totals
You can query Transaxt to get donation totals for a particular campaign. This is a private API and requires you to pass along your secret API key. To locate your API key, login to your Account Page and click on the "view API settings" link. You will also need your Campaign Code, which can be located on the particular Campaign Page. Finally, execute an HTTP GET to a URL specified in one of these formats (replace [campaign code] and [api key] with your actual code and API key, respectively):
https:/transaxt.com/api/1/campaigntotals/[campaign code]?apikey=[api key] (returns XML)
https:/transaxt.com/api/1/campaigntotals/[campaign code]/json?apikey=[api key] (returns JSON)
Optional URL parameters:
?start=YYYY-MM-DD — Specify an inclusive start-date in YYYY-MM-DD format for the calculation.
?end=YYYY-MM-DD — Specify an inclusive end-date in YYYY-MM-DD format for the calculation.
If no additional parameters are passed, then the totals represent all time.
Data Returned
NOTE: In order to safeguard performance under heavy load, the results of these requests are cached on the server for up to 1 minutes. Therefore, multiple calls within a 1 minute span will likely return the same results, even if new donations where created.
This operation returns the following information, either in XML or JSON formats:
Example XML Response
<TotalsResult xmlns="http://transaxt.com/api/1" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<GrossTotal>20523.00</GrossTotal>
<Message>OK</Message>
<NetTotal>19558.42</NetTotal>
<ResultCode>0</ResultCode>
</TotalsResult>
Example JSON Response
{
"GrossTotal":20523.00,
"Message":"OK",
"NetTotal":19558.42,
"ResultCode":0
}
Account History
You can download a CSV export of donation history for an entire account. This is a private API and requires you to pass along your secret API key. To locate your API key, login to your Account Page and click on the "view API settings" link. You will also need your Account Code, which can be located your main Account Page. Finally, execute an HTTP GET to the following URL (replace [account code] and [api key] with your actual code and API key, respectively):
https:/transaxt.com/api/1/accounthistory/[account code]?apikey=[api key] (returns CSV)
Optional URL parameters:
?start=YYYY-MM-DD — Specify an inclusive start-date in YYYY-MM-DD format for the export.
?end=YYYY-MM-DD — Specify an inclusive end-date in YYYY-MM-DD format for the export.
If no additional parameters are passed, then the totals represent all time.
HTTP Status Codes
The success or failure of the operation is returned as HTTP status codes:
Data Returned
This operation returns a list of donation details in CSV format:
Campaign History
You can download a CSV export of donation history for an particular campaign. This is a private API and requires you to pass along your secret API key. To locate your API key, login to your Account Page and click on the "view API settings" link. You will also need a Campaign Code, which can be located on your particular campaign's page. Finally, execute an HTTP GET to the following URL (replace [campaign code] and [api key] with your actual code and API key, respectively):
https:/transaxt.com/api/1/campaignhistory/[campaign code]?apikey=[api key] (returns CSV)
Optional URL parameters:
?start=YYYY-MM-DD — Specify an inclusive start-date in YYYY-MM-DD format for the export.
?end=YYYY-MM-DD — Specify an inclusive end-date in YYYY-MM-DD format for the export.
If no additional parameters are passed, then the totals represent all time.
HTTP Status Codes
The success or failure of the operation is returned as HTTP status codes:
Data Returned
This operation returns a list of donation details in CSV format: