# Demo: On site, at a kiosk or with a QR code: Contact left at a stand

> At a trade show, an exhibitor gives 0,50 € for each visitor who leaves their details. One tap on the stand's tablet sends the contact and the charity choice; the exhibitor pays.

One variant of **On site, at a kiosk or with a QR code**, in Culture and events: 0,50 € per contact.

A made-up site, expo.your-company.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 kiosk screens, the button that confirms the choice and the thank-you screen.

The full guide, with edge cases: https://www.charitips.com/docs/use-cases/on-site.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": "Trade show charity leads",
    "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": "Trade show charity leads",
    "charitiesSelectionId": "<charitiesSelectionId>",
    "type": "PERMANENT",
    "amountType": "FREE_AMOUNT",
    "withLeadCollection": true,
    "leadCollectionOptions": {
      "fullname": true,
      "companyName": true,
      "email": true,
      "phone": true,
      "custom": false
    }
  }
  ```
- [`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. When the form opens

- Button: Leave my details

**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": "stand_b12_lead_0087"
  }
  ```

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

### 2. When the form is sent

- 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>",
    "lead": {
      "fullname": "Camille Martin",
      "companyName": "Martin Consulting",
      "email": "camille.martin@example.com",
      "phone": "06 12 34 56 78",
      "hasAcceptedTerms": true
    }
  }
  ```

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

## Clone it with a coding agent

```prompt
Clone the Charitips demo "On site, at a kiosk or with a QR code: Contact left at a stand" into this project. Read https://www.charitips.com/docs/demos/onsite/stand-lead.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.
```
