List sub-accounts
Overview
Get the accounts nested under this one, if the account has a hierarchy.
Use this to build an account switcher for a multi-brand customer.
You'll need a token.
Returns the child accounts: one level down only. Sending search or limit returns a short slice ordered by name (for autocomplete); sending neither returns the full list.
Prerequisites
- A bearer token. See Authentication.
Base URL
| Environment | URL |
|---|---|
| Production | https://production-api.shoutaboutus.com |
| Development | https://development-api.shoutaboutus.com |
Endpoint
GET /api/v1/account/child-accounts
Authentication
Partner or Account token
- The list is always the children of the company behind the token: for a Partner token its accounts (and sub-partners), for an Account token its locations.
- Only direct children are returned, not the whole tree.
- A user limited to some accounts sees only those.
Rate limit
This endpoint has no rate limit.
Request parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
search | query | string | No | Up to 255 characters. Matches children whose name or client_account_id contains the text. Turns on the short, name-ordered slice. |
limit | query | integer | No | How many to return in the short slice, 10 to 50. Values below 10 are raised to 10; above 50 returns 422. Default 10. Turns on the short slice. |
Request body
None.
Request payload
None.
Response body
data is an array of child companies.
| Field | Type | Description |
|---|---|---|
data[] | array of objects | The child companies. [] when there are none or none match. |
data[].value | integer | The child company's id. |
data[].label | string | The child's name, followed by - and its client_account_id when one is set. A partner row is labelled with (Partner) instead. |
Response payload
{
"data": [
{
"value": 5995,
"label": "Acme Coffee"
},
{
"value": 5996,
"label": "Acme Coffee - Circular Quay"
}
]
}Examples
Success payload
Every child of the account behind an Account token: see Response payload.
No child matches search:
{
"data": []
}Error payload
404 Company not found
{
"message": "Not Found",
"status": "error",
"errors": "Company not found."
}422 limit above 50
{
"message": "The limit field must not be greater than 50.",
"errors": {
"limit": [
"The limit field must not be greater than 50."
]
}
}| Status | Meaning |
|---|---|
200 | The child companies. |
401 | The token is missing, expired or invalid. |
404 | The user behind the token has no company. |
422 | search is longer than 255 characters, or limit is above 50. |
500 | Unexpected server error. |
Example request
curl --request GET \
--url "https://production-api.shoutaboutus.com/api/v1/account/child-accounts" \
--header 'Authorization: Bearer <bearer-token>' \
--header 'Accept: application/json'Updated 17 days ago
Did this page help you?
