A date with a budget: donations with the Charitips API
A store runs a one-day campaign with a fixed budget, for example 10 000 € on Earth Day. Each order of the day gives 5 €, billed at activation, until the budget runs out.
- Who paysYour company
- Starts withA purchase
- Tax receiptIn your company's name
Needs API access on a validated account. Plans
One variant of A campaign for a date · Retail
A fixed budget spent on the orders of Earth Day
See every variantyour-brand.example/earth-day
Step by step
Click through the site. Each step shows what your customer does, what your server sends and what Charitips answers.
1Order paid
To comeYour customer does…
Clicks “Buy now, 35,00 €”.
Your server sends…
Creates a 5 € donation for order #2204 on the campaign “Earth Day”.
POSTcreate-donation
Charitips answers…
Charitips records the donation and returns its id: it waits for your customer to pick a charity.
Charitips will then tell your server the donation was created.
2Charity chosen
To comeYour customer does…
Clicks “Give 5 € to the charity”.
Your server sends…
Assigns that donation to the charity your customer picks.
POSTclaim-donation
Charitips answers…
The donation now goes to the charity your customer picks.
Charitips will then tell your server the donation was updated.
3Impact page
To comeYour customer does…
Clicks “See where Earth Day goes”.
Your server sends…
Reads the campaign's totals.
Charitips answers…
Charitips returns the total given, the number of donations and the most chosen charities.
How to read this demo: the site shows what your customer does, and the panel what your server sends and what Charitips answers, step by step.
The site is made up and nothing is sent. The endpoints, fields and webhook events are the real ones, and so are the charities.
How it works
The screens of the demo in order, with the calls your server makes at each one. Its build spec
donation_createdonation_updateOnce, before the first customer
- POST /v1/charities-selectionsCreate a charities selection: once: the charities you offer, from the catalog
- POST /v1/campaignsCreate a campaign: once: a time-limited campaign with its budget, billed at activation
- POST /v1/campaigns/{campaignId}/activateActivate a campaign: once: the whole budget is billed, then the campaign takes donations
01
Today, every order gives 5 €
On 22 April only, up to 10 000 € in all. Once the budget is spent, the API answers 400 INSUFFICIENT_CAMPAIGN_BUDGET and the order goes through without a donation. After the end date it answers 403, so your server stops asking.
- Organic cotton tee: 35,00 €
- Total: 35,00 €
Button: Buy now, 35,00 €
Your server calls:
- POST /v1/donationsCreate a donation: from your payment webhook, for each order of the day; amount in cents
Charitips then sends the
donation_createwebhook to your endpoint.02
Choose the charity for your 5 €
The confirmation page shows the Earth Day charities, the most chosen one marked from the campaign metrics your server already caches. Without a choice, the donation still goes to one of them: none is lost.
The customer picks a charity from your selection. Button: Give 5 € to the charity
Your server calls:
- POST /v1/donations/{donationId}/claimClaim a donation: donationId from the create-donation response
Charitips then sends the
donation_updatewebhook to your endpoint.03
Where Earth Day goes
A public page with the running total, the share of each charity and what it funds, read on your server and cached.
Button: See where Earth Day goes
Your server calls:
- GET /v1/campaigns/{campaignId}/metricsGet campaign metrics: on your server, cached for a few minutes; totalDonation, numberOfDonations and sortedCharities
Other ways to run it
The same calls in other sectors and products. Each card opens its own page, with its demo.
- RetailFlash saleDuring a two-hour flash sale, a shop gives 5 % of each order into a capped pot. The buyer picks the charity after payment; the shop pays and the price does not change.5 % of the sales during the slotTry the demoA campaign for a date: Flash sale
- Hotels and restaurantsHappy hourA restaurant's charity happy hour puts 5 % of each order into the evening's pot for a named charity. At 8 pm, the till sends the pot as one donation; the restaurant pays.5 % of the evening's happy-hour salesTry the demoA campaign for a date: Happy hour
- Software and appsIn-game charity eventA game runs a timed charity event: each challenge cleared adds 0,10 € to a pot for a named charity, up to a set budget. The server sends each hour's pot; the studio pays.0,10 € per challenge, into a capped potTry the demoA campaign for a date: In-game charity event


