Skip to content
campaiDeveloper
campai.com

Donation ยท Donations

POST/{organizationId}/{mandateId}/donation/donations/importDonations

Import donations

Imports received donations without booking them, i.e. from an export of another system. Each donation is matched to the debtor with the given account, or to the only debtor with the same name and the same IBAN, email or zip. Otherwise the given donator data is used. Donations confirmed in the other system keep their status without creating a confirmation, rows matching an earlier donation by date, amount and donator are skipped. Equal rows of the same import are separate donations. Campaigns are matched by name, also unavailable ones, and created when missing

Permissions

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

Permission checks in detail
Required permissions
  • mandate.read
  • donation.insert

Request

Path parameters

  • organizationIdidrequired
  • mandateIdidrequired

Body

Content-Type: application/json

  • donationsobject[]required

    1โ€“1000 items

    15 properties
    • confirmationStatusstringrequired
      pending notRequired created thanked
    • typestringrequired
      cash membershipFee assetStock refund
    • valueintegerrequired

      at most 9999999999

    • datestringrequired
    • descriptionstringrequired

      at most 400 characters

    • donatorAccountintegerrequirednullable

      1โ€“999999999

    • donatorNamestringrequired

      1โ€“81 characters

    • donatorTypestringrequired
      business person
    • donatorEmailstringrequired
    • addressLinestringrequired

      at most 45 characters

    • addressDetailsstringrequired

      at most 45 characters

    • zipstringrequired

      at most 10 characters

    • citystringrequired

      at most 45 characters

    • ibanstringrequired

      at most 34 characters

    • campaignNamestringrequired
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/importDonations' \
  --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

  • insertedinteger

    at least 0

  • duplicatesinteger

    at least 0

  • failedinteger

    at least 0

  • failuresobject[]
    2 properties
    • rowinteger
    • messagestring
Response200
{
  "inserted": 0,
  "duplicates": 0,
  "failed": 0,
  "failures": [
    {
      "row": 1,
      "message": "string"
    }
  ]
}

Errors

No errors of its own are known for this endpoint.

Errors nearly every request can meet are listed under Errors.