---
title: "QR code on a product: donations with the Charitips API"
description: "A QR code under a product's cap gives 2 % of the price once scanned after purchase."
canonical: https://www.charitips.com/docs/use-cases/on-site/product-qr
---

# QR code on a product: donations with the Charitips API

> A QR code under a product's cap gives 2 % of the price once scanned after purchase. The buyer picks the charity on the scanned page; one donation per code, paid by the brand.

- **Use case**: [On site, at a kiosk or with a QR code](https://www.charitips.com/docs/use-cases/on-site.md)
- **Sector**: Retail
- **Who pays**: Your company
- **What starts the donation**: A customer action
- **Example**: 2 % of the price, scanned after purchase
- **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), [`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/onsite/product-qr.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": "Shared product",
    "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": "Shared product",
    "charitiesSelectionId": "<charitiesSelectionId>",
    "type": "PERMANENT",
    "amountType": "FREE_AMOUNT"
  }
  ```
- [`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. When the code is scanned

- Button: Scan the QR code

**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": 64,
    "uniqueExternalId": "SN7K2F93XQ"
  }
  ```

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.

## Other ways to run it

- [Cup returned at a festival](https://www.charitips.com/docs/use-cases/on-site/cup-return.md) (Culture and events): 0,50 € per cup returned
- [Game at an event stand](https://www.charitips.com/docs/use-cases/on-site/stand-game.md) (Culture and events): 1 € to 10 € per win
- [Contact left at a stand](https://www.charitips.com/docs/use-cases/on-site/stand-lead.md) (Culture and events): 0,50 € per contact
- [Packaging returned in store](https://www.charitips.com/docs/use-cases/on-site/packaging-return.md) (Retail): 0,10 € per item returned, settled monthly
- [Cashless wristband top-ups](https://www.charitips.com/docs/use-cases/on-site/cashless-top-up.md) (Culture and events): 0,50 € per top-up, sent after the festival
- [Full guide: edge cases, webhooks, receipts](https://www.charitips.com/docs/use-cases/on-site.md)
- [All use cases](https://www.charitips.com/docs/use-cases.md)
