API reference · Campaigns
Create a campaign
POST/v1/campaigns
This newly created campaign will have to be activated before registering donations.
Requires a Bearer access token.
Body
CreateCampaignDtoname#stringrequired2 to 100 charactersName of your campaign. Only use for display in your dashboard.
slug#string2 to 100 charactersSlug of your campaign. Will be use in your generated page url.
audienceType#stringWhether the campaign participants have to be authenticated or not.
PRIVATEPUBLICtype#stringWhether the campaign should be a permanent or time limited one.
TIME_BASEDPERMANENTcharitiesSelectionId#stringUUIDId of the selection of charities to be used.
amountType#stringWhether the campaign has a fixed or free budget. For a FREE_AMOUNT campaign, the amount will be billed based on usage i.e total amount of created donations.
FIXED_AMOUNTFREE_AMOUNTdonationType#stringWhether the donations will have a face value or if the budget will be distributed across the charities based on the number & weights of casted votes.
FACE_VALUEDISTRIBUTIONstartDate#string (date)Defaults to today
endDate#string (date)Required for time limited campaigns.
donationValidityPeriod#stringA valid time interval matching the format 'X days' | 'X weeks' | 'X months' | 'X years'. Maximum 1 year. Define the validity period for donations. Upon creation, a donation's expiry date will be computed by adding this duration to the latest date between startDate and now. If endDate is set, the expiry date will be the earliest between the computed date and endDate.
budget#integer (int64)Required for FIXED_AMOUNT campaigns. It represents the total amount that will be donated to charities.
sendingMode#stringSet to EMAIL or SLACK to let Charitips send the donations, or to POSTAL to have the cards printed and posted.
MANUALEMAILPHYSICALSLACKPOSTALmomentSlug#stringCard design among the ones Charitips validated, listed by list-card-designs. The cards (printed for POSTAL campaigns), the donation page and the emails take its colours. Defaults to the Charitips card.
title#string2 to 100 charactersWill be displayed in the campaign page
description#string2 to 1000 charactersWill be displayed in the campaign page.
titleColor#stringhex colorCustomize the color of titles in the campaign page
accentColor#stringhex colorCustomize the color of buttons in the campaign page
frequency#stringISO 8601 recurring time interval. Define the frequency for recurring donations. Only recurring donations can be created for this campaign.
budgetFrequency#stringISO 8601 recurring time interval. Assign a frequency to the budget which is reset at each occurrence of this time interval.
logoUrl#stringURLLogo that will be displayed in the campaign page's header
faviconUrl#stringURLImage that will be used as favicon for the campaign page
message#string1 to 600 charactersSlack campaigns only. Message posted to each participant with their donation. Supports the {{firstName}}, {{lastName}}, {{company}} and {{amount}} variables.
reminderMessage#string1 to 600 charactersSlack campaigns only. Message posted to remind the participants who have not chosen a charity yet. Supports the {{firstName}}, {{lastName}}, {{company}} and {{amount}} variables.
accountId#stringUUIDOnly required to link the created entity to a child account instead of the current one.
language#stringDefault locale to be used for this campaign to communicate with the donor. This can also be overriden on a donation/vote basis.
frenemailSenderName#string1 to 100 charactersEmail campaigns only. Name of the sender of the donation emails.
emailSenderPictureUrl#stringURLEmail campaigns only. Picture of the sender displayed in the donation emails.
emailSubject#string1 to 100 charactersEmail campaigns only. Subject of the donation emails.
emailTemplate#string1 to 1000 charactersEmail campaigns only. HTML body of the donation emails. Supports the {{firstName}}, {{lastName}}, {{company}} and {{amount}} variables.
emailReplyTo#stringemail addressEmail campaigns only. Address the participants reply to.
emailDisplayCard#booleanEmail campaigns only. Whether the donation emails show the donation card. Defaults to true.
donationsBilledOn#stringBy default donations are billed upon creation. Set to CLAIM to bill them only once they have been claimed i.e a charity has been selected.
CREATIONCLAIMwithDonationsValidation#booleanIf enabled, donations or votes will have to be validated manually by calling the validate endpoint. This is useful for donations that require a moderation step before being marked as claimed.
isDraft#booleanIf enabled, the campaign will be created as a draft and default fields will not be set.
Required in the spec, optional for the API.
leadCollectionOptions#objectFields to be collected from the donor: any of the keys below, at least one. custom is your own question, or false.
5 child fields
fullnamebooleancompanyNamebooleanemailbooleanphonebooleancustomstring | false
campaignTemplateId#stringUUIDId of a campaign template to start from, see list-campaign-templates. Some settings of the template, such as its recurring type, are applied to the campaign.
fiscalReceiptType#stringWhether fiscal receipts for this campaign's donations should be issued upon its closure or grouped with other donations in yearly fiscal receipts.
YEARLYSINGLE_DONATIONfiscalReceiptSendingMode#stringRestricted to B2C use cases. Set to EMAIL to let Charitips email their fiscal receipt to the donors who paid their donation (hasBeenCharged). With MANUAL, you send them yourself.
MANUALEMAILwithFiscalReceipts#booleanRestricted to B2C use cases. Default value of withFiscalReceipt for the donations of this campaign. Set to false when no fiscal receipt should be issued for them.
defaultHideAmount#booleanHide the donation amount from the participants on the campaign page and the donation cards.
withLeadCollection#booleanCollect the fields set in leadCollectionOptions from the participants when they choose a charity.
defaultHasBeenCharged#booleanRestricted to B2C use cases, and only set at creation. The donors pay every donation of the campaign with their own money, as with hasBeenCharged on each donation. Required for givingTarget.
givingTarget#integer (int64)Only used for fundraising campaigns. It represents the target amount to be raised.
postDonationWidgets#string[]Blocks shown after a donation on Charitips pages and widgets: social sharing, a top-up paid by the beneficiary and the charity newsletter subscription. All of them by default.
SOCIAL_SHARINGDONATION_MATCHINGCHARITY_NEWSLETTER_SUBSCRIPTION
Response
201 · CampaignNo field is described in the spec.
campaignId#stringalways returnedname#stringalways returnedtype#CampaignTypeTIME_BASEDPERMANENTamountType#CampaignAmountTypeFIXED_AMOUNTFREE_AMOUNTaudienceType#CampaignAudienceTypePRIVATEPUBLICdonationType#CampaignDonationTypeFACE_VALUEDISTRIBUTIONgivingType#GivingTypealways returnedFINANCIALPAYROLLPAID_TIME_OFFrecurringType#RecurringTypealways returnedNONEFREQUENCYMANUALstartDate#string (date-time)always returnedendDate#string (date-time)budget#integer (int64)sendingMode#CampaignSendingModeMANUALEMAILPHYSICALSLACKPOSTALstatus#CampaignStatusDRAFTPENDINGACTIVECOMPLETECANCELEDslug#stringpublicKey#stringalways returnedwithFiscalReceipts#booleanalways returnedlanguage#Languagefrenfrequency#stringbudgetFrequency#stringbillingStatus#BillingStatusalways returnedPENDINGBILLEDPAIDdefaultHideAmount#booleanwithHideAmountCustomization#booleanwithGiftCards#booleanwithLeadCollection#booleanwithoutCustomization#booleanalways returnedmomentType#MomentTypeOCCASIONKEY_MOMENTEDITIONmomentSlug#stringleadCollectionOptions#objectdonationsBilledOn#DonationBilledOnalways returnedCREATIONCLAIMwithDonationsValidation#booleanalways returnedfiscalReceiptType#FiscalReceiptTypealways returnedYEARLYSINGLE_DONATIONfiscalReceiptSendingMode#FiscalReceiptSendingModealways returnedMANUALEMAILdefaultHasBeenCharged#booleanalways returneddefaultFeeType#FeeTypealways returnedEXCLUDEDINCLUDEDdonationValidityPeriod#stringalways returnedtemplate#stringphysicalFormat#PhysicalFormatCUSTOMPRINTPARCELwithEmailWall#booleanpostDonationWidgets#PostDonationWidget[]always returnedtitle#stringdescription#stringlogoUrl#stringfaviconUrl#stringtitleColor#stringaccentColor#stringgivingTarget#integer (int64)message#stringreminderMessage#stringemailSenderName#stringemailSenderPictureUrl#stringemailSubject#stringemailTemplate#stringemailReplyTo#stringemailDisplayCard#booleanlastCustomerReminderId#stringcharitiesSelectionId#stringaccountId#stringalways returnedcampaignTemplateId#stringdonorPlatformId#stringcreatedAt#string (date-time)always returnedupdatedAt#string (date-time)always returned
Errors
- 400 Bad Request
Invalid charitiesSelectionId
{ "statusCode": 400, "message": "Invalid charitiesSelectionId", "error": "Bad Request" }Budget is required for FIXED_AMOUNT campaigns
{ "statusCode": 400, "message": "Budget is required for FIXED_AMOUNT campaigns", "error": "Bad Request" }INCLUDED fee type not supported
{ "statusCode": 400, "message": "INCLUDED fee type not supported", "error": "Bad Request" }Public campaigns must be both FIXED_AMOUNT and DISTRIBUTION campaigns
{ "statusCode": 400, "message": "Public campaigns must be both FIXED_AMOUNT and DISTRIBUTION campaigns", "error": "Bad Request" }DISTRIBUTION campaigns must also be FIXED_AMOUNT campaigns
{ "statusCode": 400, "message": "DISTRIBUTION campaigns must also be FIXED_AMOUNT campaigns", "error": "Bad Request" }givingTarget is only supported for fundraising campaigns
{ "statusCode": 400, "message": "givingTarget is only supported for fundraising campaigns", "error": "Bad Request" }Only one of <givingType> campaigns is supported
{ "statusCode": 400, "message": "Only one of <givingType> campaigns is supported", "error": "Bad Request" }A field is missing, has the wrong type, or is not part of the request schema.
Every request with a body or query is validated.
{ "statusCode": 400, "message": [ "amount must not be less than 1", "property foo should not exist" ], "error": "Bad Request" }- 401 Unauthorized
Unauthorized
Missing, expired or invalid access token.
{ "statusCode": 401, "message": "Unauthorized" }- 403 Forbidden
Account not validated
{ "statusCode": 403, "message": "Account not validated", "error": "Forbidden" }Account closed
{ "message": "Account closed", "code": "ACCOUNT_CLOSED" }- 409 Conflict
Slug already used
{ "message": "Slug already used", "code": "slug_already_used" }
curl -X POST https://api.sandbox.charitips.com/v1/campaigns \ -H "Authorization: Bearer $CHARITIPS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "Checkout donations", "charitiesSelectionId": "<charitiesSelectionId>" }'Request bodies are written for this docs and checked against the API's validation; ids in angle brackets are placeholders. Response values are placeholders built from the schema.