Submit a Donation
NOTE: You must enter sign the terms of service agreement with GlobalGiving to use this API feature. Please download, sign and email a copy of the terms of service agreement here, and return to api@globalgiving.org to enable this feature. You must certify that you will handle donor input and data in compliance with PCI-DSS standards when handling sensitive information. Mainly this means ensuring your connections are HTTPS, your servers are secure, and you never store a users creditcard information. This operation allows a user to submit a donation request. This is a secure request as indicated by the '/secure/' element in the URL path, therefore, an access token (authentication) is required. Donations can be made by:
Since a donation can be made with either a credit card or a gift certificate, the <payment_detail> and <giftCertificate_detail> elements are both optional, however, at least one must be provided in a single donation request. Also, if there is not enough value remaining on the gift certificate to meet the donation amount, both elements are required to complete the donation successfully. HTTP Method:POST Content Type:xml, json Accept Type:xml, json Path:https://api.globalgiving.org/api/secure/givingservice/donations Query String Parameters:&api_key described in the API Key section, required &api_token described in the Access Token section, required &is_test when set to true credit card information (<creditCardNumber>, <expiryDateYear>, <expiryDateMonth>, <securityCode>) may be omitted as test data will be used and the transaction will not be processed, optional Query String Example:/api/secure/givingservice/donations?api_key=YOUR_API_KEY&api_token= SOME_API_TOKEN Data Parameters:refcode - your external identifier for this request which is returned in the response, required (maximum 100 characters) transactionId - your unique transaction identifier for this transaction stored in our records for future reference and possible reporting, optional (maximum 100 characters) email - required (maximum 50 characters) twitter_username - optional (maximum 15 characters) amount - a numeric value greater than $10 USD or £5 when donating using a GlobalGiving UK api key, required NOTE: the minimum amount for gift certificate redemptions is $1 currencyCode - optional; defaults to "USD" (for US Dollars) addon; - optional amount - a numeric value greater than zero, required if addon element is provided project; id - the numeric identifier for an '<status>active</status>' project (projects with a '<status>retired</status>', or '<status>funded</status>' status will not accept further donations), required noteToOrganization - optional * signupForGGNewsletter - optional; defaults to false signupForCharityNewsletter - optional; defaults to false payment_detail; - optional if giftCertificate_detail is provided firstname - required (maximum 100 characters) lastname - required (maximum 100 characters) address - required (maximum 50 characters) address2 - optional (maximum 50 characters) city - required (maximum 25 characters) state - required (maximum 25 characters) iso3166CountryCode - the ISO 3166 country code identifier for a specific country, required zip - required (maximum 10 characters) phone - optional (maximum 20 characters) creditCardNumber - required (maximum 20 characters); optional if query parameter &is_test=true is provided securityCode - required (maximum 10 characters); optional if query parameter &is_test=true is provided expiryDateMonth - required (maximum 10 characters); optional if query parameter &is_test=true is provided expiryDateYear - required (maximum 10 characters); optional if query parameter &is_test=true is provided giftCertificate_detail; - optional if payment_detail is provided giftCertificateNumber - required (maximum 20 characters) HTTP POST Request paying with credit card, using cURL:
curl -H "Accept: application/xml" -H "Content-Type: application/xml" -d "<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<donation>
<refcode>123456789</refcode>
<transactionId>abc123</transactionId>
<email>john.doe@hotmail.com</email>
<amount>25</amount>
<project>
<id>1883</id>
</project>
<signupForGGNewsletter>true</signupForGGNewsletter>
<signupForCharityNewsletter>true</signupForCharityNewsletter>
<payment_detail>
<firstname>John</firstname>
<lastname>Doe</lastname>
<address>3380 Pearlman Avenue</address>
<address2>Suite 200</address2>
<city>Washington</city>
<state>DC</state>
<iso3166CountryCode>US</iso3166CountryCode>
<zip>20001</zip>
<creditCardNumber>4111111111111111</creditCardNumber>
<securityCode>123</securityCode>
<expiryDateMonth>12</expiryDateMonth>
<expiryDateYear>2013</expiryDateYear>
</payment_detail>
</donation>" -X POST "https://api.globalgiving.org/api/secure/givingservice/donations?api_key=YOUR_API_KEY&api_token=SOME_API_TOKEN"
NOTE: Above request has carriage returns for readability. XML Response:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<donation>
<amount>25.00</amount>
<chargedAmount>25.00</chargedAmount>
<currencyCode>USD</currencyCode>
<datetime>2008-08-21T18:26:22.717-07:00</datetime>
<email>john.doe@hotmail.com</email>
<project>
<funding>5897.47</funding>
<goal>62500</goal>
<id>1883</id>
<numberOfDonations>75</numberOfDonations>
<progressReportLink>http://www.globalgiving.org/pr/1900/proj1883a.html#progressReports</progressReportLink>
<projectLink>http://www.globalgiving.org/pr/1900/proj1883a.html</progressReportLink>
<remaining>56602.53</remaining>
</project>
<signupForCharityNewsletter>true</signupForCharityNewsletter>
<signupForGGNewsletter>true</signupForGGNewsletter>
<refcode>123456789</refcode>
<transactionId>abc123</transactionId>
<checkedOut>true</checkedOut>
<payment_detail>
<firstname>John</firstname>
<lastname>Doe</lastname>
<address>3380 Pearlman Avenue</address>
<address2>Suite 200</address2>
<city>Washington</city>
<state>DC</state>
<iso3166CountryCode>US</iso3166CountryCode>
<zip>20001</zip>
<creditCardNumber>4111-XXXX-XXXX-1111</creditCardNumber>
<securityCode>123</securityCode>
<expiryDateMonth>12</expiryDateMonth>
<expiryDateYear>2013</expiryDateYear>
</payment_detail>
<receipt>
<currencyCode>USD</currencyCode>
<receiptNumber>R39339-GC138918-CBcb01</receiptNumber>
<taxDeductibleContributionAmount>25.00</taxDeductibleContributionAmount>
<totalAmountBilled>25.00</totalAmountBilled>
</receipt>
</donation>
NOTE: If successful, response contains <receipt><receiptNumber>, <checkedOut>, and <datetime> elements. HTTP POST Request paying with a gift certificate, using cURL:
curl -H "Accept: application/xml" -H "Content-Type: application/xml" -d "<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<donation>
<refcode>123456789</refcode>
<transactionId>abc123</transactionId>
<email>john.doe@hotmail.com</email>
<amount>25</amount>
<currencyCode>USD</currencyCode>
<project>
<id>1883</id>
</project>
<signupForGGNewsletter>true</signupForGGNewsletter>
<signupForCharityNewsletter>true</signupForCharityNewsletter>
<giftCertificate_detail>
<giftCertificateNumber>GL9JU52QT759</giftCertificateNumber>
</giftCertificate_detail>
</donation>" -X POST "https://api.globalgiving.org/api/secure/givingservice/donations?api_key=YOUR_API_KEY&api_token=SOME_API_TOKEN"
NOTE: Above request has carriage returns for readability. XML Response:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<donation>
<amount>25.00</amount>
<chargedAmount>0.00</chargedAmount>
<currencyCode>USD</currencyCode>
<datetime>2008-08-21T18:26:22.717-07:00</datetime>
<email>john.doe@hotmail.com</email>
<project>
<funding>5897.47</funding>
<goal>62500</goal>
<id>1883</id>
<numberOfDonations>75</numberOfDonations>
<progressReportLink>http://www.globalgiving.org/pr/1900/proj1883a.html#progressReports</progressReportLink>
<projectLink>http://www.globalgiving.org/pr/1900/proj1883a.html</progressReportLink>
<remaining>56602.53</remaining>
</project>
<signupForCharityNewsletter>true</signupForCharityNewsletter>
<signupForGGNewsletter>true</signupForGGNewsletter>
<refcode>123456789</refcode>
<transactionId>abc123</transactionId>
<checkedOut>true</checkedOut>
<giftCertificate_detail>
<currencyCode>USD</currencyCode>
<giftCertificateNumber>GL9JU52QT759</giftCertificateNumber>
<redeemedAmount>25.00</redeemedAmount>
<remainingAmount>20.00</remainingAmount>
</giftCertificate_detail>
<receipt>
<receiptNumber>R39339-GC138918-CBcb01</receiptNumber>
<taxDeductibleContributionAmount>0.00</taxDeductibleContributionAmount>
<totalAmountBilled>0.00</totalAmountBilled>
</receipt>
</donation>
NOTE: If successful, response contains <receipt><receiptNumber>, <checkedOut>, and <datetime> elements. Submit a Donation Request Structure
Element Definitions for Submit a Donation Request
* - Field is only recognized if api key has special permission to post notes to the organization. Please contact us with questions. Submitting this field is optional, and values will be ignored if your key does not have the permission to use. Donation Response Structure
Element Definitions for Donation Response
* - This field will only be returned if it was submitted and accepted. See above fields for submitting donations for more. |

