# Demo: Your users give their own money: An extra on a group pot

> On a group pot, a contributor chips in for the gift and can add a donation in their own name on top. They pick the charity; the receipt is theirs, next to the platform's fee share.

One variant of **Your users give their own money**, in Banking and insurance: A contributor's extra, next to the platform's fee share.

A made-up site, pot.your-platform.example, walked through screen by screen with the Charitips API calls the product makes at each step. Rebuild it in your own project to start from a working flow.

The charity choice in this demo is the Charitips [charity selection widget](https://www.charitips.com/docs/widgets/charity_selection.md), a ready-made proposal. Use it whole, use parts of it, or build your own experience from scratch with the API: [List charities](https://www.charitips.com/docs/api-reference/list-charities.md) gives the charities to show, and the calls below carry the chosen `charityId`.

Charitips widget: the charity cards and their profiles. Your own UI, built with the API: the amount, the payment step, the button that confirms the choice and the receipt.

The full guide, with edge cases: https://www.charitips.com/docs/use-cases/b2c.md.

**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 pot",
    "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 pot",
    "charitiesSelectionId": "<charitiesSelectionId>",
    "type": "PERMANENT",
    "amountType": "FREE_AMOUNT",
    "defaultHasBeenCharged": true,
    "givingTarget": 6000
  }
  ```
- [`POST /v1/campaigns/{campaignId}/activate`](https://www.charitips.com/docs/api-reference/activate-campaign.md) Activate a campaign: once: the campaign starts taking donations

## Screens and calls

### 1. Gift added after the contribution

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

**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": 50,
    "uniqueExternalId": "contribution_8812_fees",
    "hasBeenCharged": false,
    "charityId": "<charityId>"
  }
  ```
- [`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": 500,
    "uniqueExternalId": "contribution_8812",
    "hasBeenCharged": true,
    "withFiscalReceipt": true,
    "donor": {
      "firstName": "Camille",
      "lastName": "Martin",
      "email": "camille.martin@example.com",
      "street": "12 rue des Lilas",
      "zip": "75011",
      "city": "Paris",
      "country": "FR"
    },
    "charityId": "<charityId>"
  }
  ```

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

### 2. Fiscal receipt issued

- Button: Process the donation

No call: this screen only shows the result.

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

### 3. Receipt downloaded

- Button: Download

**Your server calls:**

- [`GET /v1/donations/{donationId}/fiscal-receipt`](https://www.charitips.com/docs/api-reference/get-donation-fiscal-receipt.md) Get a donation fiscal receipt: the receipt in the donor's name, once Charitips has issued it

## Clone it with a coding agent

```prompt
Clone the Charitips demo "Your users give their own money: An extra on a group pot" into this project. Read https://www.charitips.com/docs/demos/collect/pot-extra.md: it lists each screen and the Charitips API calls behind it. Build the same flow in this codebase, on the sandbox (https://api.sandbox.charitips.com), with my client id and secret read from environment variables, and follow the rules of https://www.charitips.com/docs/skill.md. Make every API call from the server, never from the browser. When it works, show me each call and its response.
```
