Donations
POST donations/donate.{format}
| Authentication | |
| Yes | SESSION API Token (obtained from login_with_auth_token using a PRIVATE API Token) |
| URI Parameters | |
| shortcode_string | Shortcode to target, required unless event_id/event_type is passed instead |
| keyword_string | Keyword under the shortcode to target, required unless event_id/event_type is passed instead |
| event_id | Alternate ID for the keyword, can be used in place of shortcode_string/keyword_string |
| event_type | Alternate ID type, required when event_id is passed |
| form_id | Specific donation form to use, defaults to the keyword’s default form if not passed |
| amount | Donation amount, required, must be greater than 0 |
| fee_rate | Processing fee rate to add on top of amount (optional) |
| recurring_frequency | Recurring donation frequency, e.g. monthly (optional) |
| memo | Note attached to the donation (optional) |
| anonymous | Hides the donor’s name from public displays when true (optional) |
| sms_opt_in_accepted | Whether the donor accepted SMS opt-in, defaults to false (optional) |
| pledge_wall | When “true”, posts the donation to the campaign’s pledge wall (optional) |
| source | Appended to the transaction source for attribution, e.g. “api_via_[source]” (optional) |
| peer_fundraiser_id | Attributes the donation to a specific peer fundraiser. Must belong to the resolved keyword or the request is rejected. Get IDs from GET /api/v2/fundraisers (optional) |
| peer_fundraiser_team_id | Attributes the donation to a specific peer fundraiser team. Must belong to the resolved keyword or the request is rejected. Get IDs from GET /api/v2/teams (optional) |
| full_name | Donor’s full name, split into first/last (optional, overrides first_name/last_name if both are sent) |
| first_name / last_name | Donor’s name |
| Donor’s email address | |
| phone | Donor’s phone number |
| street_address / city / state / zip | Donor’s address |
| country | Donor’s country name or ISO code |
| postal_code | Alternate name for zip when country is non-US |
| card_number / cvv / expiration_date | Card details, or… |
| credit_card_token | A tokenized card obtained from POST /api/v2/donations/create_payment_token, used in place of card_number/cvv/expiration_date |
| Response Parameters | |
| donation | |
| status | “Success”, “Error”, or “Fatal” |
| message | Human-readable result message, or the authorization code on success |
| transaction_id | ID of the resulting transaction, present on success |
Peer fundraiser and team attribution
To credit a donation to a specific peer fundraiser or team on a peer-fundraising keyword, pass peer_fundraiser_id and/or peer_fundraiser_team_id:
- Passing neither leaves the donation credited to the keyword’s root (“NPO Page”) fundraiser — this is the existing default behavior.
- Passing
peer_fundraiser_idalone attributes to that fundraiser; if the fundraiser belongs to a team, the team is credited automatically. - Passing
peer_fundraiser_team_idalone attributes to that team’s captain. If the team has no captain yet, a hidden captain record is created so the team can accrue a total — this mirrors how team-only offline donations are handled. - If both are passed and they disagree (e.g. the fundraiser has since moved to a different team),
peer_fundraiser_idwins and the team is re-derived from it, rather than rejecting the request. This keeps a stale cached ID from turning a legitimate recurring charge into a failure. - An ID that does not exist, or that belongs to a different keyword or a different account, is rejected with a 400 and the card is not charged.
- Attribution parameters are silently ignored (not rejected) when sent for a keyword that is not a peer-fundraising keyword.
Request Example
WINDOWS USERS – Please see note at the end
curl -v -D - -H 'Authorization: Token token="[session_token_here]", type="session"' -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"shortcode_string":"71777","keyword_string":"walkathon","amount":"50.00","peer_fundraiser_id":"4321","first_name":"Jane","last_name":"Donor","email":"[email protected]","phone":"5551234567","street_address":"100 Main St","city":"Boulder","state":"CO","zip":"80302","country":"US","card_number":"4111111111111111","cvv":"123","expiration_date":"12/2030"}' "https://fundraise.givesmart.com/api/v2/donations/donate"
By default these commands will not work on the Windows command prompt as it does not escape double quotes properly. Windows users can use Cygwin to have a Unix-like command prompt, or they can structure the calls to escape the quotes like so:
curl -H "Authorization: Token token=\"[session_token_here]\", type=\"session\"" -H "Accept: application/json" -H "Content-type: application/json" -X POST -d "{\"shortcode_string\":\"71777\",\"keyword_string\":\"walkathon\",\"amount\":\"50.00\",\"peer_fundraiser_id\":\"4321\"}" https://fundraise.givesmart.com/api/v2/donations/donate?