---
title: "Solidarity sale: donations with the Charitips API"
description: "A marketplace seller marks a listing as a charity sale and gives 3 % of the price."
canonical: https://www.charitips.com/docs/use-cases/marketplace-split/shared-sale
---

# Solidarity sale: donations with the Charitips API

> A marketplace seller marks a listing as a charity sale and gives 3 % of the price. The buyer picks the charity after paying and can add an extra; each pays on their own account.

- **Use case**: [A sale split between seller and buyer](https://www.charitips.com/docs/use-cases/marketplace-split.md)
- **Sector**: Retail
- **Who pays**: Your business customers (child accounts)
- **What starts the donation**: A purchase
- **Example**: 3 % of the sale, split between seller and buyer
- **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/accounts/{accountId}/child-accounts`](https://www.charitips.com/docs/api-reference/create-child-account.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/marketplace/shared-sale.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": "Charity sales",
    "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": "Charity sales",
    "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
- [`POST /v1/accounts/{accountId}/child-accounts`](https://www.charitips.com/docs/api-reference/create-child-account.md) Create a child account: once per seller: their own account under yours

  ```json
  {
    "name": "Léa's workshop",
    "firstName": "Léa",
    "lastName": "Bernard",
    "email": "lea.bernard@example.com",
    "legalRegistrationNumber": "832145678",
    "street": "8 quai Saint-Vincent",
    "zip": "69001",
    "city": "Lyon",
    "country": "FR"
  }
  ```
- [`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": "Charity sales",
    "accountId": "<accountId>",
    "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": "Charity sales",
    "accountId": "<accountId>",
    "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 listing goes live

- Button: Publish the listing

No call: this screen only shows the result.

### 2. When the order is paid: the seller's part

- Button: Pay 65,80 €

**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": 90,
    "uniqueExternalId": "order_20931_seller",
    "externalId": "seller_3310"
  }
  ```

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

### 3. When the order is paid: the buyer's extra

- Button: Pay 65,80 €

**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": 90,
    "uniqueExternalId": "order_20931_buyer",
    "hasBeenCharged": true,
    "withFiscalReceipt": true,
    "donor": {
      "firstName": "Camille",
      "lastName": "Martin",
      "email": "camille.martin@example.com",
      "street": "12 rue des Lilas",
      "zip": "75011",
      "city": "Paris",
      "country": "FR"
    }
  }
  ```

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

### 4. 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.

### 5. The buyer's extra follows the same choice

- Button: Start again

**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

- [Independent maker's sale](https://www.charitips.com/docs/use-cases/marketplace-split/maker-sale.md) (Retail): 5 % of the price from the studio, plus the buyer's extra
- [Full guide: edge cases, webhooks, receipts](https://www.charitips.com/docs/use-cases/marketplace-split.md)
- [All use cases](https://www.charitips.com/docs/use-cases.md)
