---
title: "Create a child account"
description: "Create a child account."
canonical: https://www.charitips.com/docs/api-reference/create-child-account
---

# Create a child account

`POST /v1/accounts/{accountId}/child-accounts`

Create a child account. Restricted to platform accounts

**Authentication**: Bearer access token.

## Parameters

- `accountId` (string, required)

## Body

- `street` (string, required): Headquarters' address line 1
- `streetAddition` (string): Headquarters' address line 2
- `city` (string, required): Headquarters' city
- `country` (string, required): Headquarters' country ISO code
- `zip` (string, required): Headquarters' zip code
- `subdomain` (string): Subdomain of the external page
- `customDomain` (string): Custom domain of the external page
- `titleColor` (string, hex color): Customize the default color of titles used in the campaign page
- `accentColor` (string, hex color): Customize the default color of buttons used in the campaign page
- `authSchemes` (string): Authentication schemes which can be used by the child account's users to login in the Charitips dashboard. One of `GOOGLE`, `EMAIL`, `API`.
- `name` (string, required, 3 to 100 characters)
- `firstName` (string, required)
- `lastName` (string, required)
- `email` (string, required, email address)
- `legalRegistrationNumber` (string, required)
- `phone` (string)
- `logoUrl` (string, URL)
- `faviconUrl` (string, URL)

## Response 201

- `accountId` (string, required)
- `name` (string, required)
- `status` (AccountStatus, required) One of `PENDING`, `VALIDATED`, `CLOSED`.
- `type` (AccountType, required) One of `INDIVIDUAL`, `COMPANY`.
- `logoUrl` (string)
- `faviconUrl` (string)
- `titleColor` (string)
- `accentColor` (string)
- `headcount` (string)
- `authSchemes` (AuthScheme[], required)
- `parentAccountId` (string)
- `linkedAccountId` (string)
- `createdAt` (string (date-time), required)
- `updatedAt` (string (date-time), required)

## Errors

- 400 `Invalid customDomain`: A custom domain cannot contain a Charitips domain (charitips.com, charitips.net, charitips.org, charitips.tech, chari.tips). Use a domain you own, or `subdomain` for an address under Charitips. See https://www.charitips.com/docs/api-reference/create-site.md.
- 400 `Subdomain must ends with .<subdomain>`: A child account's subdomain sits under yours: send `<child>.<your subdomain>`, for example `shop.acme` when your subdomain is `acme`. The message gives your subdomain. See https://www.charitips.com/docs/use-cases/account-hierarchy.md.
- 400 `Nested subdomains are not allowed`: The part before your own subdomain must be a single label: 1 to 63 lowercase letters, digits or hyphens, no dot, not starting or ending with a hyphen. See https://www.charitips.com/docs/use-cases/account-hierarchy.md.
- 400 `A field is missing, has the wrong type, or is not part of the request schema.`: `message` lists every problem. Unknown fields are rejected, not ignored: remove them rather than sending extra data. See https://www.charitips.com/docs/api-reference/errors.md.
- 401 `Unauthorized`: The access token is missing, expired or invalid. Create a new one with your client id and secret, send it as `Authorization: Bearer <accessToken>`, then retry once. Sandbox tokens only work on api.sandbox.charitips.com. See https://www.charitips.com/docs/get-started/authentication.md.
- 402 `Plan upgrade required`: Your plan does not include this feature. Upgrade the plan from the dashboard, then retry. See https://www.charitips.com/docs/overview/plans.md.
- 403 `Forbidden`: Your credentials cannot perform this action on this resource. An id from another account never answers 403: it is treated as unknown, with a 404 in the path or a 400 `Bad Request` in the body or the query. See https://www.charitips.com/docs/api-reference/errors.md.
- 403 `Parent account is missing a domain`: A child's subdomain is built under your own subdomain, and your account has none. Contact us to set it up, or give the child account a `customDomain` instead. See https://www.charitips.com/docs/use-cases/account-hierarchy.md.
- 403 `Account closed`: The account behind these credentials is closed: no token is issued and every call is refused, reads included. Contact Charitips to reopen it. See https://www.charitips.com/docs/api-reference/troubleshooting.md#calls-answer-403-account-not-active-account-not-validated-or-account-closed.
- 404 `Not Found`: No resource with this id on your account and environment. An id that belongs to another account answers 404 too when it is in the path. Ids from the sandbox do not exist in production. See https://www.charitips.com/docs/get-started/sandbox.md.
- 409 `Domain already exists`: This subdomain or custom domain is already used by a Charitips site, possibly one of your own accounts. Pick another one, or detach it from the other site first. See https://www.charitips.com/docs/api-reference/create-child-account.md.

## Example

```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 '{
    "street": "<street>",
    "city": "<city>",
    "country": "FR",
    "zip": "<zip>",
    "name": "<name>",
    "firstName": "<firstName>",
    "lastName": "<lastName>",
    "email": "donor@example.com",
    "legalRegistrationNumber": "<legalRegistrationNumber>"
  }'
```

```javascript
const response = await fetch('https://api.sandbox.charitips.com/v1/accounts/<accountId>/child-accounts', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.CHARITIPS_TOKEN}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "street": "<street>",
    "city": "<city>",
    "country": "FR",
    "zip": "<zip>",
    "name": "<name>",
    "firstName": "<firstName>",
    "lastName": "<lastName>",
    "email": "donor@example.com",
    "legalRegistrationNumber": "<legalRegistrationNumber>"
  }),
});
if (!response.ok) throw new Error(`${response.status} ${await response.text()}`);
const data = await response.json();
```

```python
import os, requests

response = requests.post(
    "https://api.sandbox.charitips.com/v1/accounts/<accountId>/child-accounts",
    headers={"Authorization": f"Bearer {os.environ['CHARITIPS_TOKEN']}"},
    json={
      "street": "<street>",
      "city": "<city>",
      "country": "FR",
      "zip": "<zip>",
      "name": "<name>",
      "firstName": "<firstName>",
      "lastName": "<lastName>",
      "email": "donor@example.com",
      "legalRegistrationNumber": "<legalRegistrationNumber>"
    },
)
response.raise_for_status()
data = response.json()
```

## Response example (201, placeholder values)

```json
{
  "accountId": "<accountId>",
  "name": "<name>",
  "status": "PENDING",
  "type": "INDIVIDUAL",
  "logoUrl": "<logoUrl>",
  "faviconUrl": "<faviconUrl>",
  "titleColor": "<titleColor>",
  "accentColor": "<accentColor>"
}
```
