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
CreateChildAccountDto8 of 18 fields have no description in the spec.
street#stringrequiredHeadquarters' address line 1
streetAddition#stringHeadquarters' address line 2
city#stringrequiredHeadquarters' city
country#stringrequiredHeadquarters' country ISO code
zip#stringrequiredHeadquarters' zip code
subdomain#stringSubdomain of the external page
customDomain#stringCustom domain of the external page
titleColor#stringhex colorCustomize the default color of titles used in the campaign page
accentColor#stringhex colorCustomize the default color of buttons used in the campaign page
authSchemes#stringAuthentication schemes which can be used by the child account's users to login in the Charitips dashboard.
GOOGLEEMAILAPIname#stringrequired3 to 100 charactersfirstName#stringrequiredlastName#stringrequiredemail#stringrequiredemail addresslegalRegistrationNumber#stringrequiredphone#stringlogoUrl#stringURLfaviconUrl#stringURL
Response
201 · AccountNo field is described in the spec.
accountId#stringalways returnedname#stringalways returnedstatus#AccountStatusalways returnedPENDINGVALIDATEDCLOSEDtype#AccountTypealways returnedINDIVIDUALCOMPANYlogoUrl#stringfaviconUrl#stringtitleColor#stringaccentColor#stringheadcount#stringauthSchemes#AuthScheme[]always returnedparentAccountId#stringlinkedAccountId#stringcreatedAt#string (date-time)always returnedupdatedAt#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" }
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>" }'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.