# Demo: Round-up on every payment: Restaurant self-order kiosk

> A restaurant's self-order kiosk offers to round the bill up to the next euro before payment. The customer picks the charity and pays the difference with the meal.

One variant of **Round-up on every payment**, in Hotels and restaurants: The bill rounded up to the next euro at the kiosk.

A made-up site, your-restaurant.example/kiosk, 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 round-up offer, the order and the payment.

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": "Kiosk 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": "Kiosk 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. Round up the bill

Before payment, the kiosk offers to round the bill up to the next euro. The customer picks a charity in the widget and accepts. Your kiosk keeps it with the order. Nothing is sent to Charitips yet.

- The customer picks a charity from your selection.
- Button: Round up for the chosen charity

No call: this screen only shows the result.

### 2. Bill paid with its round-up

The customer pays the meal and the round-up in one card payment. Your server then records the donation as paid by the customer.

- Your order: 14,60 €
- Round-up for the charity: 0,40 €
- **Charged to the card: 15,00 €**
- Button: Simulate a card payment

**Your server calls:**

- [`POST /v1/donations`](https://www.charitips.com/docs/api-reference/create-donation.md) Create a donation: once the card payment is accepted, from your till or payment server; amount in cents; with no donor, withFiscalReceipt is false

  ```json
  {
    "campaignId": "<campaignId>",
    "amount": 40,
    "uniqueExternalId": "order_31248",
    "charityId": "<charityId>",
    "hasBeenCharged": true,
    "withFiscalReceipt": false
  }
  ```

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

### 3. Order canceled at the counter

The counter cancels and refunds the order: your server deletes its round-up, as long as it is not billed yet.

- Button: Simulate a cancellation at the counter

**Your server calls:**

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

## Clone it with a coding agent

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