Endpoints

Donations

The Donation API allows you to retreive, add, update donations and send donation receipts (cerfa) by email.

Object

Name Type Description
id Number myCerfa unique donation id 
entity_id Number your account unique donation id
creation_date Date creation date (ISO 8601 format:YYYY-MM-DDTHH:MM:SSZ)
settlement_date Date donation settlement date (format:YYYY-MM-DD)
is_cumul String yearly cumulated receipt. Value: 1, 0
signature_date Date donation signature date (format:YYYY-MM-DD)
amount Decimal donation amount in euros
amounts Array
Name Type Description
amount Decimal amount allocated to the campaign
campaign_id Number campaign id. Can be any of /campaigns
campaign_label String campaign label. Can be any of /campaigns
payment_type String payment type label. Can be any of /paymenttypes
payment_reference String reference number of the payment
payment_bank String bank linked to reference number (if relevant)
form String form of the donation. Values: Acte authentique, Acte sous seing privé, Déclaration de don manuel or Autres
nature String nature of the donation. Values: Numéraire, Titres de société cotés, Autres
reference String donation reference
comment String donation comment
active Number 1: active / 0: inactive
cancelation_reason String reason of the cancelation
count_download Number number of times the donation receipt (cerfa) has been downloaded
count_email Number number of times the donation receipt (cerfa) has been sent by email
count_posting Number number of times the donation receipt (cerfa) has been sent by mail (though myCerfa)
origin Number from where the donation has been created.
Values1: myCerfa web interface / 2: donor web interface (myCerfa online donation) / 3: api (partner or else)
donor_id Number myCerfa unique donor id
first String first name
name String last name
reference String internal reference (helpful to store external donor reference in order to link myCerfa to your own system donor).
Can be used as a Query Parameter using /donors?reference=:reference
address_id Number the myCerfa unique address id
address String mail address 
adress_comp String mail address next 
zip String zip code
town String town
country String country. Can be any of /countries

Get a single Donation

GET
/donors/:donorid/donations/:donationid
or
donations/:donationid

Path Parameters

Name Type
donorid Number (required)
donationid Number (required)

Query Parameters

Name Type Description
reference String get donation by its reference field (helpful to store external donation reference in order to link myCerfa to your own system).
In this case only, donationrid is not required

Example

https://mycerfa.com/api/v1/donors/123/donations/345
https://mycerfa.com/api/v1/donors/123/donations?reference=:your_donation_reference

Response

[
 {
  "id": "196",
  "entity_id": "2013000016",
  "creation_date": "2013-09-04T02:00:00Z",
  "settlement_date": "2013-09-03",
  "signature_date": "2013-09-03",
  "amount": "300.00",
  "amounts": 
  [
   {
    "amount": "80.00",
    "campaign_id": "",
    "campaign_label": "-"
   },
   {
    "amount": "200.00",
    "campaign_id": "6",
    "campaign_label": "-"
   }
  ],
  "payment_type": "Virement",
  "payment_reference": "",
  "payment_bank": "",
  "reference": "",
  "comment": "",
  "form": "Déclaration de don manuel",
  "nature": "Numéraire",
  "active": "1",
  "cancelation_reason": "",
  "count_download": "160",
  "count_email": "3",
  "count_posting": "3",
  "origin": "1",
  "donor_id": "6",
  "donor_first": "",
  "donor_name": "D & LOGISTICS",
  "donor_reference": "",
  "address_id": "7",
  "donor_address": "12 rue Pascal",
  "donor_address_comp": "Allée A - Bat B",
  "donor_address_zip": "92160",
  "donor_address_town": "ANTONY",
  "donor_address_country": "FRANCE"
 }
]

Get Donations List

GET
/donors/:donorid/donations
or
/donations

Example

https://mycerfa.com/api/v1/donors/:donorid/donations

Create a Donation

POST
/donors/:donorid/donations

Post Parameters

Name Type   Description
donor_address_id Number (optional) myCerfa unique donor address id. Default: donor default address
amount Decimal (required) donation amount (currency symbol not allowed)
payment_type String (optional) payment type label. Default: default payment type defined in general settings (your account).
Can be any of /paymenttypes
payment_reference String (optional) reference number of the payment
payment_bank String (optional) bank linked to reference number (if relevant)
settlement_date Date (optional) donation settlement date (format:YYYY-MM-DD). Default: current date
is_cumul String (optional) yearly cumulated receipt. Value: 1, 0
signature_date Date (optional) donation signature date (format:YYYY-MM-DD). Default: current date
article String (optional) article of the donation.
Multiple values accepted separated by a comma ",": 200: 200 du CGI, 238: 238 bis du CGI, 885 : 885-0 V bis du CGI
Note : if left empty, values will automatically be taken from those defined in the general settings.
form String (optional) form of the donation.
Values: (Can be any of) Acte authentique, Acte sous seing privé, Déclaration de don manuel or Autres. Default: as defined in general settings (your account).
nature String (optional) nature of the donation.
Values: (Can be any of) Numéraire, Titres de société cotés or Autres. Default: as defined in general settings (your account).
reference String (optional) donation reference
comment String (optional) donation comment
campaign String (optional) label of the campaign to assign the donation on

Example

https://mycerfa.com/api/v1/donors/:donorid/donations

Response

{
 "data": 1234567,
 "error": false,
 "status": 200
}

Note: data represents the Donation mycerfa unique id

Update a Donation details

POST
donors/:donorid/donations/:donationid

Post Parameters

Please refer to Create a Donation Post Parameters section

Example

https://mycerfa.com/api/v1/donors/123/donations/1234567

Response

{
 "data": 1234567,
 "error": false,
 "status": 200
}

Sending an Object

POST
donors/:donorid/donations/:donationid?action=:actionname

Path Parameters

Name Type
donorid Number (required)
donationid Number (required)

Query Parameters

Parameters
[:actionname]
Name Type Value Description
sendByEmail
email_to String (optional) [email_address] recipient's email (if left blank, default email address is used)
email_cc String (optional) [email_address] multiple recipients emails (use , to separate emails)
receipt String (optional) Values: original or duplicate attach either the original or duplicate donation receipt (if left blanck, no cerfa receipt is sent)
subject String (optional) message subject  
body String (optional) message body  
letter_name String (optional) [letter_name] attach a letter. Can be any of /letters

Example

https://mycerfa.com/api/v1/donors/123/donations/345?action=sendByEmail&email_to=Cette adresse e-mail est protégée contre les robots spammeurs. Vous devez activer le JavaScript pour la visualiser.&receipt=original&letter_name=thanks_letter

Response

{
 "data": 1234567879,
 "error": false,
 "status": 200
}

Note: data represents the sent email mycerfa unique id


Download the receipt

GET
donors/:donorid/donations/:donationid?action=:actionname&receipt=:version

Path Parameters

Name Type
donorid Number (required)
donationid Number (required)

Query Parameters

Parameters
[:actionname]
Type Value Description
action String Value: download action
receipt String Values: original or duplicate witch version to dowload original or duplicate

Example

https://mycerfa.com/api/v1/donors/123/donations/345?action=download&receipt=original

Payment Types

The Payment Types API allows you to retrieve, add and update the payment types.

Object

Name Type Description
id Number myCerfa unique payment type id 
label String payment type label
deletable Number 0: no / 1: yes

Get a single Payment Type

GET
/paymenttypes/:paymenttypeid

Path Parameters

Name Type
paymenttypeid Number (required)

Example

https://mycerfa.com/api/v1/paymenttypes/278

Response

[
 {
  "id": "278",
  "label": "Chèque"
 }
]

Get Payment Types List

GET
/paymenttypes

Example

https://mycerfa.com/api/v1/paymenttypes

Create a Payment Type

POST
/paymenttypes

Post Parameters

Name Type   Description
label String (required) Payment Type label

Example

https://mycerfa.com/api/v1/paymenttypes

Response

{
 "data": 278,
 "error": false,
 "status": 200
}

Note: data represents mycerfa payment type unique id

Update a Payment Type

POST
/paymenttypes/:paymenttypeid

Post Parameters

Please refer to Create a Payment Type Post Parameters section

Example

https://mycerfa.com/api/v1/paymenttypes/278

Response

{
 "data": 278,
 "error": false,
 "status": 200
}

Campaigns

The Campaigns API allows you to retrieve, add and update the donation campaigns.

Object

Name Type Description
id Number myCerfa unique Campaign id 
label String Campaign label
active Number 0: activated / 1: disabled
deletable Number 0: no / 1: yes

Get a single Campaign

GET
/campaigns/:campaignid

Path Parameters

Name Type
campaignid Number (required)

Example

https://mycerfa.com/api/v1/campaigns/1234

Response

[
 {
   "id": "1234",
   "label": "Collecte annuelle",
   "active": "1",
   "deletable": "1"
 }
]

Get Campaigns List

GET
/campaigns

Example

https://mycerfa.com/api/v1/campaigns

Create a Campaign

POST
/campaigns

Post Parameters

Name Type   Description
label String (required) Campaign label

Example

https://mycerfa.com/api/v1/campaigns

Response

{
 "data": 1234,
 "error": false,
 "status": 200
}

Note: data represents mycerfa Campaign unique id

Update a Campaign

POST
/campaigns/:campaignid

Post Parameters

Please refer to Create a Campaign Post Parameters section

Example

https://mycerfa.com/api/v1/campaigns/1234

Response

{
 "data": 1234,
 "error": false,
 "status": 200
}
Vous êtes un Donateur ? Cliquez-ici