Skip to content
campaiDeveloper
campai.com

Donation · Donations

POST/{organizationId}/{mandateId}/donation/donations/candidatesReads only

List donation candidates

Lists incoming cash transactions in the inclusive fromDate–toDate range for the specified organization and mandate that can be recorded as donations. Candidates include open transactions and transactions with a qualifying uncommitted posting. Returns up to 200 candidates, newest first, and hasMore indicates whether more were found.

Permissions

Send an API key of the organization in the path, using the X-API-Key header.

Who may call it

  • The caller must have organization access.
  • The caller needs mandate.read.
  • The caller needs donation.insert.
  • The caller needs cashTransaction.read.

Request

Path parameters

  • organizationIdidrequired
  • mandateIdidrequired

Body

Content-Type: application/json

  • fromDatestringrequired
  • toDatestringrequired
Request
curl --fail-with-body --silent --show-error --max-time 30 --globoff \
  --request POST 'https://cloud.campai.com/api/YOUR_ORGANIZATION_ID/YOUR_MANDATE_ID/donation/donations/candidates' \
  --header 'X-API-Key: YOUR_API_KEY'

No request that worked has been recorded yet, so the body is not shown.

Response

200 Successful response

Content-Type: application/json

  • candidatesobject[]
    9 properties
    • cashTransactionIdid
    • cashAccountIdid
    • datestring
    • amountnumber
    • partialboolean
    • counterpartNamestring
    • purposestring
    • postingobjectnullable

      candidates[].posting is null for unassigned and partially assigned transactions.

      3 properties
      • postingIdid
      • accountinteger

        1–999999999

      • receiptNumberstring
    • debtorobjectnullable

      candidates[].debtor is null when no debtor matches the transaction's counterpart account.

      2 properties
      • accountinteger

        1–999999999

      • namestring
  • hasMoreboolean
Response200
{
  "candidates": [
    {
      "cashTransactionId": "000000000000000000000001",
      "cashAccountId": "000000000000000000000001",
      "date": "string",
      "amount": 1,
      "partial": true,
      "counterpartName": "string",
      "purpose": "string",
      "posting": {
        "postingId": "000000000000000000000001",
        "account": 1,
        "receiptNumber": "string"
      },
      "debtor": {
        "account": 1,
        "name": "string"
      }
    }
  ],
  "hasMore": true
}

Errors

Other errors

StatusErrorWhen
404A mandate needs to be providedIf mandateId is a null object ID, the endpoint returns HTTP 404 with key organization.getMandate.nullMandateId.
404Mandate mandate ID not foundIf the mandate is not found in the organization, the endpoint returns HTTP 404 with key organization.getMandate.notFound.

Marked words such as mandate ID are filled in with the actual value when the error happens.

Errors nearly every request can meet are listed under Errors.