---
title: "Solidarity items in an in-game shop: donations with the Charitips API"
description: "In a game's shop, some items are tied to a charity. An interactive demo of the Charitips donation API, with its calls."
canonical: https://www.charitips.com/docs/use-cases/loyalty-points/in-game-shop
---

# Solidarity items in an in-game shop: donations with the Charitips API

> In a game's shop, some items are tied to a charity. When the player buys one with gems earned in play, the studio gives 1 € or 2 € for it; the player never pays.

- **Use case**: [Loyalty points turned into donations](https://www.charitips.com/docs/use-cases/loyalty-points.md)
- **Sector**: Culture and events
- **Who pays**: Your company
- **What starts the donation**: A customer action
- **Example**: 1 € or 2 € from the studio for each solidarity item bought
- **Works in**: Mobile games, Console games, PC games, Browser games, Casual games, Hybrid-casual games, Mid-core games, Hardcore games, Idle and incremental games, Puzzle games, Match-3 games, Action games, Adventure games, Role-playing games (RPGs), MMOs, Strategy and 4X games, Tower defense games, Simulation and tycoon games, Sports games, Racing games, Shooters, Battle royale games, Survival games, Sandbox games, Location-based games
- **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)
- **Webhooks**: `donation_create`

Interactive demo on the page. The same flow as a build spec: https://www.charitips.com/docs/demos/loyalty/in-game-shop.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": "Solidarity items",
    "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": "Solidarity items",
    "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. Elixir bought, the studio gives to its charity

- Button: Buy the elixir

**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": 100,
    "charityId": "<charityId>",
    "uniqueExternalId": "purchase_88412",
    "externalId": "player_77361"
  }
  ```

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

### 2. Seed bought, the studio gives to its charity

- Button: Buy the seed

**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": 100,
    "charityId": "<charityId>",
    "uniqueExternalId": "purchase_88413",
    "externalId": "player_77361"
  }
  ```

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

### 3. Bread bought, the studio gives to its charity

- Button: Buy the bread

**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": 200,
    "charityId": "<charityId>",
    "uniqueExternalId": "purchase_88414",
    "externalId": "player_77361"
  }
  ```

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

## Other ways to run it

- [Store loyalty points](https://www.charitips.com/docs/use-cases/loyalty-points/loyalty-points.md) (Retail): 100 points for 1 €
- [Unused gift card balance](https://www.charitips.com/docs/use-cases/gift-card-balance.md) (Retail): The remaining balance, given by the holder
- [Travel loyalty points](https://www.charitips.com/docs/use-cases/loyalty-points/travel-points.md) (Travel and mobility): 100 points for 5 €
- [Cultural member card](https://www.charitips.com/docs/use-cases/loyalty-points/member-card.md) (Culture and events): 100 points for 1 €
- [In-game currency](https://www.charitips.com/docs/use-cases/loyalty-points/game-currency.md) (Software and apps): Virtual currency at a fixed rate
- [Employee solidarity voucher](https://www.charitips.com/docs/use-cases/loyalty-points/solidarity-voucher.md) (Professional services): A 60 € voucher funded by the employer, given all or part
- [Full guide: edge cases, webhooks, receipts](https://www.charitips.com/docs/use-cases/loyalty-points.md)
- [All use cases](https://www.charitips.com/docs/use-cases.md)
