REST API

Donors API

Generated from the Celerp 2.10.0 OpenAPI schema, .

GET /donors

List every donor with gifts in a period, largest total first.

Every donor with gifts in the period (all time without one), largest total first.

Parameters

NameInRequiredTypeDescription
fromquery--string, optionalFirst day of the period, as YYYY-MM-DD.
toquery--string, optionalLast day of the period, as YYYY-MM-DD.

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X GET http://localhost:8000/donors \
  -H "Authorization: Bearer $TOKEN"

GET /donors/statements/preview

Show who a donor statement send for a period would reach, with each donor's total.

Who a send for the period reaches, each with their total and gifts and the number the next Send again of their statement under the current wording names (0 while it was never sent) and how the email of its last send reads now (``state``: sending, sent, failed or unconfirmed); a donor with no email address is marked and would be skipped. An open end runs from the first entry or to today, and ``period`` names the dates the send and each statement then cover.

Parameters

NameInRequiredTypeDescription
fromquery--string, optionalFirst day of the period, as YYYY-MM-DD.
toquery--string, optionalLast day of the period, as YYYY-MM-DD.

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X GET http://localhost:8000/donors/statements/preview \
  -H "Authorization: Bearer $TOKEN"

POST /donors/statements/send

Email donor statements for a period to every donor with gifts in it.

Email the period's statements; refused without explicit confirmation. A sent email cannot be recalled from the donor's mailbox, so the send is recorded and a corrected statement goes out under new wording or by an explicit resend.

Request body

FieldTypeRequiredDescription
fromstringyesFrom
tostringyesTo
confirmbooleanyesConfirm
resendobject--Resend

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X POST http://localhost:8000/donors/statements/send \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

GET /donors/statements/wording

Read the wording printed on donor statements.

Responses

StatusDescriptionBody
200Successful Responseobject

Example

curl -X GET http://localhost:8000/donors/statements/wording \
  -H "Authorization: Bearer $TOKEN"

PUT /donors/statements/wording

Change the wording printed on donor statements.

Set the statement wording ("{name}" is the donor's name); each change is a new version, so statements already sent under the old wording can be sent again corrected.

Request body

FieldTypeRequiredDescription
textstringyesText

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X PUT http://localhost:8000/donors/statements/wording \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

GET /donors/{contact_id}/history

Show one donor's gifts in a period and their total.

One donor's gifts in the period and their total.

Parameters

NameInRequiredTypeDescription
contact_idpathyesstringIdentifier of the customer, supplier, or other CRM contact.
fromquery--string, optionalFirst day of the period, as YYYY-MM-DD.
toquery--string, optionalLast day of the period, as YYYY-MM-DD.

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

Example

curl -X GET http://localhost:8000/donors/:contact_id/history \
  -H "Authorization: Bearer $TOKEN"

GET /donors/{contact_id}/statement.pdf

Download one donor's statement for a period as a PDF file.

One donor's statement for the period as a PDF, through the document PDF renderer; an open end runs from the first entry or to today, as on the preview.

Parameters

NameInRequiredTypeDescription
contact_idpathyesstringIdentifier of the customer, supplier, or other CRM contact.
fromquery--string, optionalFirst day of the period, as YYYY-MM-DD.
toquery--string, optionalLast day of the period, as YYYY-MM-DD.

Responses

StatusDescriptionBody
200Successful Response--
422Validation ErrorHTTPValidationError

Example

curl -X GET http://localhost:8000/donors/:contact_id/statement.pdf \
  -H "Authorization: Bearer $TOKEN"