---
title: "Gym accessories shop: donations with the Charitips API"
description: "A gym's accessories shop gives 2 € on each order over 50 €, or 1 % of the order. The gym pays, and the member picks the charity once the order is confirmed."
canonical: https://www.charitips.com/docs/use-cases/donation-per-order/gym-shop
---

# Gym accessories shop: donations with the Charitips API

> A gym's accessories shop gives 2 € on each order over 50 €, or 1 % of the order. The gym pays, and the member picks the charity once the order is confirmed.

- **Use case**: [A donation with every order](https://www.charitips.com/docs/use-cases/donation-per-order.md)
- **Sector**: Health and sport
- **Who pays**: Your company
- **What starts the donation**: A purchase
- **Example**: 2 € for every order over 50 €, or 1 % of each order
- **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/checkout/gym-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": "Gym shop charities",
    "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": "Gym shop donations",
    "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

### 1. Your bag

Orders over 50 € give 2 € to a charity the customer chooses. Under 50 €, no donation is created.

- Training T-shirt: 34,00 €
- Water bottle 750 ml: 18,00 €
- Delivery: Free
- **Total: 52,00 €**
- Button: Pay 52,00 €

**Your server calls:**

- [`POST /v1/donations`](https://www.charitips.com/docs/api-reference/create-donation.md) Create a donation: from your payment webhook, once the order is paid; amount in cents. Keep the donationId with the order: the order page and your confirmation email bring the customer back to the choice

  ```json
  {
    "campaignId": "<campaignId>",
    "amount": 200,
    "uniqueExternalId": "order_2290"
  }
  ```

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

### 2. Thank you. Choose the charity for your 2 €

The confirmation page offers a short choice of charities. Not now? The order history brings the customer back, and without a choice the donation still goes to one of the charities: none is lost.

- The customer picks a charity from your selection.
- Button: Give 2 € to 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.

### 3. Your orders

Your server reads the donation_update webhook and keeps the charity on the order. An order still waiting for a choice offers it again.

- Button: Start again

No call: this screen only shows the result.

## Other ways to run it

- [Online store](https://www.charitips.com/docs/use-cases/donation-per-order/running-store.md) (Retail): 2 € for every order over 50 €, or 1 % of each order
- [Museum shop](https://www.charitips.com/docs/use-cases/donation-per-order/museum-shop.md) (Culture and events): 2 € for every order over 50 €, or 1 % of each order
- [Full guide: edge cases, webhooks, receipts](https://www.charitips.com/docs/use-cases/donation-per-order.md)
- [All use cases](https://www.charitips.com/docs/use-cases.md)
