---
title: "Flash sale: donations with the Charitips API"
description: "During a two-hour flash sale, a shop gives 5 % of each order into a capped pot."
canonical: https://www.charitips.com/docs/use-cases/campaign-for-a-date/flash-sale
---

# Flash sale: donations with the Charitips API

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

- **Use case**: [A campaign for a date](https://www.charitips.com/docs/use-cases/campaign-for-a-date.md)
- **Sector**: Retail
- **Who pays**: Your company
- **What starts the donation**: A purchase
- **Example**: 5 % of the sales during the slot
- **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), [`POST /v1/donations/{donationId}/claim`](https://www.charitips.com/docs/api-reference/claim-donation.md)
- **Webhooks**: `donation_create`, `donation_update`

Interactive demo on the page. The same flow as a build spec: https://www.charitips.com/docs/demos/moment/flash-sale.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 shop",
    "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 shop",
    "charitiesSelectionId": "<charitiesSelectionId>",
    "type": "TIME_BASED",
    "endDate": "2026-10-17",
    "amountType": "FIXED_AMOUNT",
    "budget": 200000
  }
  ```
- [`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. At checkout

- Button: Pay 64,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": 320,
    "uniqueExternalId": "order_20817",
    "externalId": "customer_5521"
  }
  ```
- [`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.

### 2. When the charity is chosen

- The customer picks a charity from your selection.
- Button: Choose the charity

**Your server calls:**

- [`POST /v1/donations/{donationId}/claim`](https://www.charitips.com/docs/api-reference/claim-donation.md) Claim a donation: donationId from the create-donation response

  ```json
  {
    "charityId": "<charityId>"
  }
  ```

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

### 3. Pot full

- Button: Pay 64,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": 320,
    "uniqueExternalId": "order_20818",
    "externalId": "customer_5521"
  }
  ```

## 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
- [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
- [In-game charity event](https://www.charitips.com/docs/use-cases/campaign-for-a-date/game-event.md) (Software and apps): 0,10 € per challenge, into a capped pot
- [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)
