Skip to main content

Save Donor

The Save Donor API is used to create or update donor records in the Donary system. It requires information about the donor, including personal details, contact information, and addresses.


Endpoint

/V1/External/SaveDonor

Http Request Method

PUT

Request Header

APIKey - The API key for authorization.

Request Body

note

* Indicates required field.
* Provide if updating a specific donor.
* Either firstName and lastName or firstNameHebrew and lastNameHebrew are required.

NameTypeDescriptionChild Attributes
orgGuid *stringOrganization's unique identifier.Placeholder
donorID *stringAccount number - if provided, the existing donor record will be updated. Click here for more information on this field.Placeholder
title stringEnglish title.Placeholder
firstName *stringEnglish first name.Placeholder
lastName *stringEnglish last name.Placeholder
titleHebrew stringHebrew title.Placeholder
firstNameHebrew *stringHebrew first name.Placeholder
lastNameHebrew *stringHebrew last name.Placeholder
suffixHebrew stringHebrew last title.Placeholder

Response

See list of possible errors.


Create Donor Example:

This example will create a new donor and return the generated donorId, DNR1009.

note

Please note - 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":"Mr","firstName":"Mark","lastName":"Charity","titleHebrew":"הרב","firstNameHebrew":"מרק","lastNameHebrew":"צדקה","suffixHebrew":"שליטא","donorPhones":[{"phoneLabel":"Home","phoneNumber":"1234567891","countryCode":"USA"}],"donorEmails":[{"emailLabel":"Personal","emailAddress":"mark@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"}]}'

Payload:

{
"orgGuid": "115e9d3d-baf2-4089-b896-9b2621ffcf1b",
"donorId": "",
"title": "Mr",
"firstName": "Mark",
"lastName": "Charity",
"titleHebrew": "הרב",
"firstNameHebrew": "מרק",
"lastNameHebrew": "צדקה",
"suffixHebrew": "שליטא",
"donorPhones": [
{
"phoneLabel": "Home",
"phoneNumber": "1234567891",
"countryCode": "USA"
}
],
"donorEmails": [
{
"emailLabel": "Personal",
"emailAddress": "mark@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"
}
]
}

Response:

{
"orgGuid": "115e9d3d-baf2-4089-b896-9b2621ffcf1b",
"donorId": "DNR1009",
"title": "Mr",
"firstName": "Mark",
"lastName": "Charity",
"titleHebrew": "הרב",
"firstNameHebrew": "מרק",
"lastNameHebrew": "צדקה",
"suffixHebrew": "שליטא",
"donorPhones": [
{
"phoneLabel": "Home",
"phoneNumber": "1234567891",
"countryCode": "USA"
}
],
"donorEmails": [
{
"emailLabel": "Personal",
"emailAddress": "mark@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"
}
]
}

Update Donor Example:

This example will update Donor DNR1009's firstName, phoneNumber, and emailAddress.

note

Please note: 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": "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": [

]
}

Response:

{
"orgGuid": "115e9d3d-baf2-4089-b896-9b2621ffcf1b",
"donorId": "DNR1009",
"title": "Mr",
"firstName": "Sam",
"lastName": "Charity",
"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"
}
]
}