Skip to content
Aller au contenu
Charitips

API reference · Accounts

Create a child account

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

Create a child account. Restricted to platform accounts

Requires a Bearer access token.

Parameters

This field has no description in the spec.

  • accountId#stringin pathrequired

Body

CreateChildAccountDto

8 of 18 fields have no description in the spec.

  • street#stringrequired

    Headquarters' address line 1

  • streetAddition#string

    Headquarters' address line 2

  • city#stringrequired

    Headquarters' city

  • country#stringrequired

    Headquarters' country ISO code

  • zip#stringrequired

    Headquarters' zip code

  • subdomain#string

    Subdomain of the external page

  • customDomain#string

    Custom domain of the external page

  • titleColor#stringhex color

    Customize the default color of titles used in the campaign page

  • accentColor#stringhex 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.

    GOOGLEEMAILAPI

  • name#stringrequired3 to 100 characters

  • firstName#stringrequired

  • lastName#stringrequired

  • email#stringrequiredemail address

  • legalRegistrationNumber#stringrequired

  • phone#string

  • logoUrl#stringURL

  • faviconUrl#stringURL

Response

201 · Account

No field is described in the spec.

  • accountId#stringalways returned

  • name#stringalways returned

  • status#AccountStatusalways returned

    PENDINGVALIDATEDCLOSED

  • type#AccountTypealways returned

    INDIVIDUALCOMPANY

  • logoUrl#string

  • faviconUrl#string

  • titleColor#string

  • accentColor#string

  • headcount#string

  • authSchemes#AuthScheme[]always returned

  • parentAccountId#string

  • linkedAccountId#string

  • createdAt#string (date-time)always returned

  • updatedAt#string (date-time)always returned

Errors

  • 400 Bad Request
  • Invalid customDomain
    {
      "statusCode": 400,
      "message": "Invalid customDomain",
      "error": "Bad Request"
    }
  • Subdomain must ends with .<subdomain>
    {
      "statusCode": 400,
      "message": "Subdomain must ends with .<subdomain>",
      "error": "Bad Request"
    }
  • Nested subdomains are not allowed
    {
      "statusCode": 400,
      "message": "Nested subdomains are not allowed",
      "error": "Bad Request"
    }
  • A field is missing, has the wrong type, or is not part of the request schema.

    Every request with a body or query is validated.

    {
      "statusCode": 400,
      "message": [
        "amount must not be less than 1",
        "property foo should not exist"
      ],
      "error": "Bad Request"
    }
  • 401 Unauthorized
  • Unauthorized

    Missing, expired or invalid access token.

    {
      "statusCode": 401,
      "message": "Unauthorized"
    }
  • 402 Payment Required
  • Plan upgrade required
    {
      "statusCode": 402,
      "message": "Plan upgrade required"
    }
  • 403 Forbidden
  • Forbidden
    {
      "statusCode": 403,
      "message": "Forbidden"
    }
  • Parent account is missing a domain
    {
      "statusCode": 403,
      "message": "Parent account is missing a domain",
      "error": "Forbidden"
    }
  • Account closed
    {
      "message": "Account closed",
      "code": "ACCOUNT_CLOSED"
    }
  • 404 Not Found
  • Not Found

    No resource with this id on your account: the API answers as if it did not exist.

    {
      "statusCode": 404,
      "message": "Not Found"
    }
  • 409 Conflict
  • Domain already exists
    {
      "message": "Domain already exists",
      "code": "domain_already_exist"
    }
POST /v1/accounts/<accountId>/child-accounts
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>"  }'
Built from the spec and the API code

Request bodies are written for this docs and checked against the API's validation; ids in angle brackets are placeholders. Response values are placeholders built from the schema.