---
title: "Donations for your business customers"
description: "Give each business customer its own Charitips account, giving and dashboard, with its donations billed to you or to the customer."
canonical: https://www.charitips.com/docs/use-cases/account-hierarchy
---

# Donations for your business customers

> Give each business customer its own Charitips account, giving and dashboard, with its donations billed to you or to the customer.

- **Who pays**: Your business customers
- **Starts with**: Each business customer's own campaigns
- **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 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/account-hierarchy.md

**This demo is one example**: A SaaS offers giving to its business customers. The same flow also covers:

- [Any use case, per business customer](https://www.charitips.com/docs/use-cases/account-hierarchy/business-customers.md): Each child account runs its own campaigns: per order, round-up, loyalty, votes, matching or monthly giving.
- [Direct or delegated billing](https://www.charitips.com/docs/guides/account-hierarchy-billing.md): You pay for all your customers' donations, or each customer is invoiced directly.
- [A dashboard for each customer](https://www.charitips.com/docs/concepts/account-hierarchy.md#dashboards-and-users): Each business customer follows its giving in its own dashboard, opened with a magic link.
- [Employee giving for your customers](https://www.charitips.com/docs/use-cases/employee-giving.md): Your business customers' employees give from their pay or give days off, in Charitips widgets embedded in your HR or payroll software, after a call with our team.
- [Thank-you donations to colleagues](https://www.charitips.com/docs/use-cases/delivered-gift.md#send-the-gift-by-email): Your company sends an employee or a partner a donation to give: on a time-limited EMAIL campaign, Charitips emails the link and they pick the charity.

## Build it
- **Calls**: [`create-child-account`](https://www.charitips.com/docs/api-reference/create-child-account.md), [`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), [`create-shareable-billing-link`](https://www.charitips.com/docs/api-reference/create-shareable-billing-link.md), [`activate-campaign`](https://www.charitips.com/docs/api-reference/activate-campaign.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), [`list-users`](https://www.charitips.com/docs/api-reference/list-users.md), [`create-user-magic-link`](https://www.charitips.com/docs/api-reference/create-user-magic-link.md)
- **Webhooks**: `campaign_create`, `campaign_update`, `donation_create`, `donation_update`
- **Before you start**: The account hierarchy feature.
- **Before you start**: Every donation type in these docs, run separately for each business customer: a donation with every order, round-up, loyalty points, gift cards, referral, cashback, a share of each subscription, monthly giving, matching and votes. Billed to each business customer with delegated billing, or to you with direct billing.

### Request account hierarchy access

Account hierarchy lets you create and manage Charitips accounts on behalf of your business customers. Ask for it at [contact@charitips.com](mailto:contact@charitips.com): our team validates it on your account. Your own account is the parent account, and each customer gets a child account linked to it: see [Account hierarchy](https://www.charitips.com/docs/concepts/account-hierarchy.md).

### Create a child account

For each customer, create a child account with [Create a child account](https://www.charitips.com/docs/api-reference/create-child-account.md), during their onboarding once you have their company details. It needs the company name, a contact's first name, last name and email, a legal registration number (SIREN for French businesses, a valid VAT number for others) and the postal address. They become the customer's billing and fiscal information: invoices use the first, fiscal receipts the second. Save the `accountId` from the response with your customer: the next steps use it.

```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": "Hero Corp",
    "firstName": "John",
    "lastName": "Doe",
    "email": "john.doe@herocorp.com",
    "legalRegistrationNumber": "883060550",
    "street": "8 rue de la Paix",
    "city": "Paris",
    "zip": "75002",
    "country": "FR"
  }'
```

### Create a charities selection

On the child account, create the charities your customer offers with [Create a charities selection](https://www.charitips.com/docs/api-reference/create-charities-selection.md) and the child's `accountId`. Get the charity ids from [List charities](https://www.charitips.com/docs/api-reference/list-charities.md).

```bash
curl -X POST https://api.sandbox.charitips.com/v1/charities-selections \
  -H "Authorization: Bearer $CHARITIPS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Hero Corp selection",
    "charityIds": [
      "ca68f22c-2fdf-48b1-b8f6-43c3073e83bb",
      "1cccaa7c-cc5e-4dc8-9978-fc2de5f5d7b3",
      "0d65b4e6-f663-4ec7-b69d-0da5e7e8b2ee"
    ],
    "accountId": "<child accountId>"
  }'
```

### Create and activate the campaign

Create the campaign with [Create a campaign](https://www.charitips.com/docs/api-reference/create-campaign.md), the child's `accountId` and the `charitiesSelectionId`. Without a `type`, it runs until you end it and its total depends on usage, which suits long-lived and usage-based experiences. Campaigns are created `PENDING`: activate it with [Activate a campaign](https://www.charitips.com/docs/api-reference/activate-campaign.md) once it is configured. Write to [contact@charitips.com](mailto:contact@charitips.com) for help with the first one.

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

### Let the user pick a charity

To record a donation, the user first chooses the charity to support. Show the charities with the [charity selection widgets](https://www.charitips.com/docs/widgets/charity_selection.md), and call your backend when the user picks one.

### Create the donation

In that backend endpoint, create the donation with [Create a donation](https://www.charitips.com/docs/api-reference/create-donation.md) on the child's campaign. `externalId` is an optional id of your system, such as a customer, transaction or order id; `uniqueExternalId` is the same but unique across all donations, so a retried call answers `409` instead of creating a duplicate. `amount` is in cents: 2000 is 20 €.

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

### Claim it for the chosen charity

Right after, link the donation to the user's charity with [Claim a donation](https://www.charitips.com/docs/api-reference/claim-donation.md).

```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>"
  }'
```

### Store the ids on your side

Keep your parent `accountId` in an environment variable, and each child `accountId` on the record of your customer. Store the `campaignId` and `publicKey` of each campaign there too, or on your own campaign record when a customer has several; both are also in the **Informations** tab of the campaign in the dashboard. On donations, votes and donors, pass your own id in `uniqueExternalId`, or in `externalId` when it is not unique, and the person choosing the charity in `donor` to track usage.

### Billing and receipts

Donations without a set budget are billed monthly. A campaign's fiscal receipts are in the child account's name: yearly by default, at the end of the campaign for a time-limited one. To bill each customer directly instead of your account, see [Bill your business customers](https://www.charitips.com/docs/guides/account-hierarchy-billing.md); to open each customer's dashboard, see [Dashboards and users](https://www.charitips.com/docs/concepts/account-hierarchy.md#dashboards-and-users).

## Edge cases

- **A known duration.** Add `"type": "TIME_BASED"` and an `endDate` for a one-time experience with a free budget: donations are billed monthly and the receipts come at the end of the campaign.
- **A known budget and duration.** Add `"amountType": "FIXED_AMOUNT"` and a `budget` in cents (100000 is 1000 €) to a `TIME_BASED` campaign: the whole budget is billed at activation, and the receipts cover it at the end of the campaign.
- **Several campaigns per customer.** Start with one campaign per child account. Add more when a customer needs other colors, logos or texts, when you segment donations and analytics by your own campaigns, themes or teams, or when experiences need different campaign settings.
- **Your API credentials.** They give access to your account and every child account, so pass the child's `accountId` on your GET requests and when you create a campaign, a charities selection, a user invitation or a site. Keep them secret, on your server only, never in a front-end application.

## Related pages

- [Account hierarchy](https://www.charitips.com/docs/concepts/account-hierarchy.md)
- [Bill your business customers](https://www.charitips.com/docs/guides/account-hierarchy-billing.md)
- [Employee giving](https://www.charitips.com/docs/use-cases/employee-giving.md)
