# Demo: Round-up on every payment: Festival cashless wallet

> A festival's cashless wristband rounds each drink or food payment up to the next euro. The attendee agrees once at top-up, pays the cents and gets the receipt in their name.

One variant of **Round-up on every payment**, in Culture and events: Each wristband payment rounded up to the next euro.

A made-up site, app.your-festival.example/wallet, 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 round-up settings, the multiplier, the save button and the card payments.

The full guide, with edge cases: https://www.charitips.com/docs/use-cases/round-up.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": "Festival round-up charities",
    "charityIds": [
      "<charityId>"
    ]
  }
  ```
- [`POST /v1/campaigns`](https://www.charitips.com/docs/api-reference/create-campaign.md) Create a campaign: once: the campaign, on an account with the B2C use case

  ```json
  {
    "name": "Festival round-ups",
    "charitiesSelectionId": "<charitiesSelectionId>"
  }
  ```
- [`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. Turn on round-ups

The customer picks a charity, a multiplier and a monthly cap, and agrees to pay the round-ups. Your app saves it on its side. Nothing is sent to Charitips yet.

- The customer picks a charity from your selection.
- Button: Turn on

No call: this screen only shows the result.

### 2. Wristband payment rounded up

Every wristband payment is rounded up on its own, with no confirmation. Your server charges the round-up with the payment, then records the donation in the customer's name: one fiscal receipt a year, and in France 66 % of the donation comes off their income tax.

- Bar: 6,40 €
- Round-up for the charity: 0,60 €
- **Charged to the wristband: 7,00 €**
- Button: Simulate a wristband payment

**Your server calls:**

- [`POST /v1/donations`](https://www.charitips.com/docs/api-reference/create-donation.md) Create a donation: for each rounded payment, once the customer is charged; amount in cents, after the multiplier and the cap; hasBeenCharged puts the receipt in the customer's name

  ```json
  {
    "campaignId": "<campaignId>",
    "amount": 60,
    "uniqueExternalId": "transaction_40121",
    "externalId": "attendee_8812",
    "charityId": "<charityId>",
    "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"
    }
  }
  ```

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

### 3. Refund received

The merchant refunds the payment: your server deletes its round-up, as long as it is not billed yet.

- Button: Simulate a refund

**Your server calls:**

- [`DELETE /v1/donations/{donationId}`](https://www.charitips.com/docs/api-reference/delete-donation.md) Delete a donation: donationId kept with the transaction; only before the monthly bill

## Clone it with a coding agent

```prompt
Clone the Charitips demo "Round-up on every payment: Festival cashless wallet" into this project. Read https://www.charitips.com/docs/demos/round-up/festival-wallet.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.
```
