---
title: "A sale split between seller and buyer"
description: "On a marketplace, a listing marked for charity gives a share paid by the seller and an extra paid by the buyer, each on its own account."
canonical: https://www.charitips.com/docs/use-cases/marketplace-split
---

# A sale split between seller and buyer

> On a marketplace, a listing marked for charity gives a share paid by the seller and an extra paid by the buyer, each on its own account.

- **Who pays**: Your business customers
- **Starts with**: A purchase
- **Tax receipt**: In each business customer's name
- Needs [API access](https://www.charitips.com/docs/overview/plans.md#api-access-for-webhooks-and-credentials), [The B2C use case](https://www.charitips.com/docs/overview/plans.md#the-b2c-use-case-when-your-users-pay), [The account hierarchy feature](https://www.charitips.com/docs/overview/plans.md#the-account-hierarchy-feature-for-your-business-customers) on a validated account. [Plans](https://www.charitips.com/docs/overview/plans.md#what-every-flow-needs)

Interactive demo on the page. The same flow as a build spec: https://www.charitips.com/docs/demos/marketplace/shared-sale.md

**Scenarios this flow covers:**

- [Only the seller gives](https://www.charitips.com/docs/use-cases/marketplace-split/maker-sale.md): No extra for the buyer: one donation per sale, on the seller's account.
- [Only the buyer gives](https://www.charitips.com/docs/use-cases/b2c.md): The buyer adds an extra at checkout, with their own money and a receipt in their name.
- [The marketplace pays](https://www.charitips.com/docs/use-cases/donation-per-order.md): No account per seller: the marketplace funds every donation, as a donation with every order.

**Variants**: the same flow in other sectors, each with its build spec.

- [Solidarity sale](https://www.charitips.com/docs/use-cases/marketplace-split/shared-sale.md) (Retail): 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. 3 % of the sale, split between seller and buyer. Build spec: https://www.charitips.com/docs/demos/marketplace/shared-sale.md
- [Independent maker's sale](https://www.charitips.com/docs/use-cases/marketplace-split/maker-sale.md) (Retail): An independent maker on a marketplace gives 5 % of a piece's price from their studio. The buyer picks the charity at checkout and can add their own extra, on a separate account. 5 % of the price from the studio, plus the buyer's extra. Build spec: https://www.charitips.com/docs/demos/marketplace/maker-sale.md

## Build it
- **Calls**: [`create-charities-selection`](https://www.charitips.com/docs/api-reference/create-charities-selection.md), [`create-campaign`](https://www.charitips.com/docs/api-reference/create-campaign.md), [`activate-campaign`](https://www.charitips.com/docs/api-reference/activate-campaign.md), [`create-child-account`](https://www.charitips.com/docs/api-reference/create-child-account.md), [`create-donation`](https://www.charitips.com/docs/api-reference/create-donation.md), [`claim-donation`](https://www.charitips.com/docs/api-reference/claim-donation.md)
- **Webhooks**: `donation_create`, `donation_update`
- **Before you start**: Each seller who marks a listing for charity has its own Charitips account under yours, with its own campaign and receipts.

### Give each seller an account

Once per seller, when they turn the option on, create their own account under yours with [Create a child account](https://www.charitips.com/docs/api-reference/create-child-account.md). Keep the `accountId` from the response with the seller's record. See [Account hierarchy](https://www.charitips.com/docs/concepts/account-hierarchy.md) for the details it needs.

```bash
curl -X POST https://api.sandbox.charitips.com/v1/accounts/<accountId>/child-accounts \
  -H "Authorization: Bearer $CHARITIPS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Seller A",
    "firstName": "Jane",
    "lastName": "Doe",
    "email": "jane.doe@example.com",
    "legalRegistrationNumber": "<SIREN or VAT number>",
    "street": "8 rue de la Paix",
    "city": "Paris",
    "zip": "75002",
    "country": "FR"
  }'
```

### Create the seller's campaign

On the seller's account, create a charities selection and a campaign, both with the seller's `accountId`, then activate the campaign. It takes the seller's share of each charity sale.

```bash
curl -X POST https://api.sandbox.charitips.com/v1/campaigns \
  -H "Authorization: Bearer $CHARITIPS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Solidarity sales",
    "accountId": "<seller accountId>",
    "charitiesSelectionId": "<charitiesSelectionId>"
  }'
```

### Create the campaign for extras

Once, on your own account, create and activate the campaign that takes the buyers' extras. Your users pay them with their own money.

```bash
curl -X POST https://api.sandbox.charitips.com/v1/campaigns \
  -H "Authorization: Bearer $CHARITIPS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Buyer extras",
    "charitiesSelectionId": "<charitiesSelectionId>"
  }'
```

### Give the seller's share

When the order is paid, create the seller's share on the seller's campaign: it exists on every charity sale. Each payer gets its own donation, with its own `uniqueExternalId` built from the order.

```bash
curl -X POST https://api.sandbox.charitips.com/v1/donations \
  -H "Authorization: Bearer $CHARITIPS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "campaignId": "<seller campaignId>",
    "amount": 300,
    "uniqueExternalId": "order_1042_seller"
  }'
```

### Add the buyer's extra

When the buyer added the extra at checkout, create a second donation on your campaign, with `hasBeenCharged`, `withFiscalReceipt` and the buyer's address in `donor`.

```bash
curl -X POST https://api.sandbox.charitips.com/v1/donations \
  -H "Authorization: Bearer $CHARITIPS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "campaignId": "<campaignId>",
    "amount": 96,
    "uniqueExternalId": "order_1042_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"
    }
  }'
```

### Claim both for the buyer's charity

The buyer picks one charity on the confirmation page. Claim the seller's share with it, then the extra when there is one.

```bash
curl -X POST https://api.sandbox.charitips.com/v1/donations/<donationId>/claim \
  -H "Authorization: Bearer $CHARITIPS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "charityId": "<charityId>"
  }'
```

## Edge cases

- **Only one side gives.** Without the extra, the seller's share is the only donation and the buyer still chooses its charity. Create donations only for listings marked for charity.
- **Receipts.** The buyer's receipt is issued in their name; the seller's goes to the seller's account, where they find their donations and their dashboard.
- **Prerequisites.** The buyers' own money needs the B2C use case, and the accounts per seller the account hierarchy feature: see [Plans and prerequisites](https://www.charitips.com/docs/overview/plans.md).

## Related pages

- [Account hierarchy](https://www.charitips.com/docs/concepts/account-hierarchy.md)
- [Donations for your business customers](https://www.charitips.com/docs/use-cases/account-hierarchy.md)
- [Your users give their own money](https://www.charitips.com/docs/use-cases/b2c.md)
- [Webhooks](https://www.charitips.com/docs/webhooks/configuration.md)
