---
title: "In-game charity event: donations with the Charitips API"
description: "A game runs a timed charity event: each challenge cleared adds 0,10 € to a pot for a named charity, up to a set budget."
canonical: https://www.charitips.com/docs/use-cases/campaign-for-a-date/game-event
---

# In-game charity event: donations with the Charitips API

> A 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.

- **Use case**: [A campaign for a date](https://www.charitips.com/docs/use-cases/campaign-for-a-date.md)
- **Sector**: Software and apps
- **Who pays**: Your company
- **What starts the donation**: A purchase
- **Example**: 0,10 € per challenge, into a capped pot
- **Works in**: Mobile games, Console games, PC games, Browser games, Casual games, Hybrid-casual games, Mid-core games, Hardcore games, Puzzle games, Match-3 games, Word games, Trivia games, Role-playing games (RPGs), MMOs, Strategy and 4X games, Tower defense games, Simulation and tycoon games, Sports games, Racing games, Shooters, Battle royale games, Survival games, Sandbox games, Fitness games and exergames, Location-based games, Esports
- **Calls**: [`POST /v1/charities-selections`](https://www.charitips.com/docs/api-reference/create-charities-selection.md), [`POST /v1/campaigns`](https://www.charitips.com/docs/api-reference/create-campaign.md), [`POST /v1/campaigns/{campaignId}/activate`](https://www.charitips.com/docs/api-reference/activate-campaign.md), [`POST /v1/donations`](https://www.charitips.com/docs/api-reference/create-donation.md), [`GET /v1/campaigns/{campaignId}/metrics`](https://www.charitips.com/docs/api-reference/get-campaign-metrics.md)
- **Webhooks**: `donation_create`

Interactive demo on the page. The same flow as a build spec: https://www.charitips.com/docs/demos/moment/game-event.md

## How it works

The screens of the demo in order, with the calls your server makes at each one.

### Once, before the first customer

- [`POST /v1/charities-selections`](https://www.charitips.com/docs/api-reference/create-charities-selection.md) Create a charities selection: once: the charities you offer, from the catalog

  ```json
  {
    "name": "Your online game",
    "charityIds": [
      "<charityId>"
    ]
  }
  ```
- [`POST /v1/campaigns`](https://www.charitips.com/docs/api-reference/create-campaign.md) Create a campaign: once: the campaign the donations go to

  ```json
  {
    "name": "Your online game",
    "charitiesSelectionId": "<charitiesSelectionId>",
    "type": "TIME_BASED",
    "endDate": "2026-10-17",
    "amountType": "FIXED_AMOUNT",
    "budget": 1000000
  }
  ```
- [`POST /v1/campaigns/{campaignId}/activate`](https://www.charitips.com/docs/api-reference/activate-campaign.md) Activate a campaign: once: the campaign starts taking donations

### 1. With each challenge cleared

- Button: Start the fight

No call: this screen only shows the result.

### 2. At the end of the hour

- Button: Skip to 15:00

**Your server calls:**

- [`POST /v1/donations`](https://www.charitips.com/docs/api-reference/create-donation.md) Create a donation: from your server, when it happens; amount in cents

  ```json
  {
    "campaignId": "<campaignId>",
    "amount": 12050,
    "uniqueExternalId": "event_hour_14",
    "charityId": "<charityId>"
  }
  ```
- [`GET /v1/campaigns/{campaignId}/metrics`](https://www.charitips.com/docs/api-reference/get-campaign-metrics.md) Get campaign metrics: what the campaign has received so far, for the gauge

Charitips then sends the `donation_create` webhook to your endpoint.

### 3. Pot full

- Button: Start the fight

**Your server calls:**

- [`POST /v1/donations`](https://www.charitips.com/docs/api-reference/create-donation.md) Create a donation: from your server, when it happens; amount in cents

  ```json
  {
    "campaignId": "<campaignId>",
    "amount": 12040,
    "uniqueExternalId": "event_hour_15",
    "charityId": "<charityId>"
  }
  ```

## Other ways to run it

- [A date with a budget](https://www.charitips.com/docs/use-cases/campaign-for-a-date/campaign-for-a-date.md) (Retail): A fixed budget spent on the orders of Earth Day
- [Flash sale](https://www.charitips.com/docs/use-cases/campaign-for-a-date/flash-sale.md) (Retail): 5 % of the sales during the slot
- [Happy hour](https://www.charitips.com/docs/use-cases/campaign-for-a-date/happy-hour.md) (Hotels and restaurants): 5 % of the evening's happy-hour sales
- [Full guide: edge cases, webhooks, receipts](https://www.charitips.com/docs/use-cases/campaign-for-a-date.md)
- [All use cases](https://www.charitips.com/docs/use-cases.md)
