Save Donor
The Save Donor API is used to create or update donor records in the Donary system.
Endpoint
/V1/External/SaveDonor
Http Request Method
PUT
Request Header
APIKey
- The API key for authorization.
Request Body
* Indicates required field.
* Provide if updating a specific donor.
* Either firstName
and lastName
or firstNameHebrew
and lastNameHebrew
are required.
Name | Type | Description | Child Attributes | |
---|---|---|---|---|
orgGuid * | string | Organization's unique identifier. | ||
donorID * | string | Account number. If a valid ID is provided, the existing donor record will be updated. Learn more about the behavior of identifiers. | ||
title | string | English title. | ||
firstName * | string | English first name. | ||
lastName * | string | English last name. | ||
titleHebrew | string | Hebrew title. | ||
firstNameHebrew * | string | Hebrew first name. | ||
lastNameHebrew * | string | Hebrew last name. | ||
suffixHebrew | string | Hebrew last title. | ||
donorPhones * | array of objects | Array of phone details. | ||
donorEmails * | array of objects | Array of email details. | ||
donorAddresses * | array of objects | Array of address details. |
Response
See list of possible errors.
Create Donor Example:
This example will create a new donor and return the generated donorId
, DNR1009
.
A new donor will be created because the donorId
is empty in the payload.
cURL:
curl --location --request PUT 'https://webapi.donary.com/v1/External/SaveDonor' \
--header 'APIKey: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{"orgGuid":"115e9d3d-baf2-4089-b896-9b2621ffcf1b","donorId":"","title":"Rabbi","firstName":"Yaakov","lastName":"Freedman","titleHebrew":"הרב","firstNameHebrew":"יעקב","lastNameHebrew":"פּרידמן","suffixHebrew":"שליטא","donorPhones":[{"phoneLabel":"Home","phoneNumber":"1234567891","countryCode":"USA"}],"donorEmails":[{"emailLabel":"Personal","emailAddress":"yaakov@charity.com"}],"donorAddresses":[{"addressLabel":"Home","careOf":"","houseNum":"123","streetName":"123 Main Street","unit":"#1","city":"Anytown","state":"US","zip":"11111","country":"United States"},{"addressLabel":"Office","careOf":"","houseNum":"456","streetName":"Office Ave","unit":"#2","city":"Anytown","state":"US","zip":"11111","country":"United States"}]}'
Payload:
{
"orgGuid": "115e9d3d-baf2-4089-b896-9b2621ffcf1b",
"donorId": "",
"title": "Rabbi",
"firstName": "Yaakov",
"lastName": "Freedman",
"titleHebrew": "הרב",
"firstNameHebrew": "יעקב",
"lastNameHebrew": "פּרידמן",
"suffixHebrew": "שליטא",
"donorPhones": [
{
"phoneLabel": "Home",
"phoneNumber": "1234567891",
"countryCode": "USA"
}
],
"donorEmails": [
{
"emailLabel": "Personal",
"emailAddress": "yaakov@charity.com"
}
],
"donorAddresses": [
{
"addressLabel": "Home",
"careOf": "",
"houseNum": "123",
"streetName": "123 Main Street",
"unit": "#1",
"city": "Anytown",
"state": "US",
"zip": "11111",
"country": "United States"
},
{
"addressLabel": "Office",
"careOf": "",
"houseNum": "456",
"streetName": "Office Ave",
"unit": "#2",
"city": "Anytown",
"state": "US",
"zip": "11111",
"country": "United States"
}
]
}
Response:
{
"orgGuid": "115e9d3d-baf2-4089-b896-9b2621ffcf1b",
"donorId": "DNR1009",
"title": "Rabbi",
"firstName": "Yaakov",
"lastName": "Freedman",
"titleHebrew": "הרב",
"firstNameHebrew": "יעקב",
"lastNameHebrew": "פּרידמן",
"suffixHebrew": "שליטא",
"donorPhones": [
{
"phoneLabel": "Home",
"phoneNumber": "1234567891",
"countryCode": "USA"
}
],
"donorEmails": [
{
"emailLabel": "Personal",
"emailAddress": "yaakov@charity.com"
}
],
"donorAddresses": [
{
"addressLabel": "Home",
"careOf": "",
"houseNum": "123",
"streetName": "123 Main Street",
"unit": "#1",
"city": "Anytown",
"state": "US",
"zip": "11111",
"country": "United States"
},
{
"addressLabel": "Office",
"careOf": "",
"houseNum": "456",
"streetName": "Office Ave",
"unit": "#2",
"city": "Anytown",
"state": "US",
"zip": "11111",
"country": "United States"
}
]
}
Update Donor Example:
This example will update Donor DNR1009's firstName
, phoneNumber
, and emailAddress
.
A valid donorId
must be included in the payload to update the specified donor. If there is no record with the provided donorId
, a new donor will be created with the given id. Any fields with null values in the payload will be ignored, and the original data for those fields will be retained. Fields with empty strings or empty arrays will trigger the deletion of the corresponding data. Learn more about how to update a record here.
cURL:
curl --location --request PUT 'https://webapi.donary.com/v1/External/SaveDonor' \
--header 'APIKey: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{"orgGuid":"115e9d3d-baf2-4089-b896-9b2621ffcf1b","donorId":"DNR555563","firstName":"Sam","lastName":"Charity","titleHebrew":null,"firstNameHebrew":null,"lastNameHebrew":null,"suffixHebrew":null,"donorPhones":[{"phoneLabel":"Home","phoneNumber":"2223334444","countryCode":"USA"}],"donorEmails":[{"emailLabel":"Personal","emailAddress":"charity@gmail.com"}],"donorAddresses":[]}'
Payload:
{
"orgGuid": "115e9d3d-baf2-4089-b896-9b2621ffcf1b",
"donorId": "DNR555563",
"firstName": "Moshe",
"lastName": "Freedman",
"titleHebrew": null,
"firstNameHebrew": "משה",
"lastNameHebrew": null,
"suffixHebrew": null,
"donorPhones": [
{
"phoneLabel": "Home",
"phoneNumber": "2223334444",
"countryCode": "USA"
}
],
"donorEmails": [
{
"emailLabel": "Personal",
"emailAddress": "charity@gmail.com"
}
],
"donorAddresses": [
]
}
Response:
{
"orgGuid": "115e9d3d-baf2-4089-b896-9b2621ffcf1b",
"donorId": "DNR1009",
"title": "Mr",
"firstName": "Moshe",
"lastName": "Freedman",
"titleHebrew": "הרב",
"firstNameHebrew": "משה",
"lastNameHebrew": "פּרידמן",
"suffixHebrew": "שליטא",
"donorPhones": [
{
"phoneLabel": "Home",
"phoneNumber": "2223334444",
"countryCode": "USA"
}
],
"donorEmails": [
{
"emailLabel": "Personal",
"emailAddress": "charity@test.com"
}
],
"donorAddresses": [
{
"addressLabel": "Home",
"careOf": "",
"houseNum": "123",
"streetName": "123 Main Street",
"unit": "#1",
"city": "Anytown",
"state": "US",
"zip": "11111",
"country": "United States"
},
{
"addressLabel": "Office",
"careOf": "",
"houseNum": "456",
"streetName": "Office Ave",
"unit": "#2",
"city": "Anytown",
"state": "US",
"zip": "11111",
"country": "United States"
}
]
}