Sub-organizations
An organization that runs several businesses holds each one as a sub-organization. Each sub-organization is a business of its own on Yona: its own tax number, onboarding, tax connection, invoices and API keys. With a key of the parent organization you can list them, see how far each is from issuing live invoices, and create new ones.
How many sub-organizations an organization may hold depends on its plan.
The two permissions
| Capability | Allows | Keys |
|---|---|---|
organization.children.read | Listing sub-organizations and reading their readiness | Sandbox and live |
organization.children.create | Creating a sub-organization | Live only |
Neither is part of any key preset. They are added to a key on purpose: when you create the key in the Yona app, tick List or Create under Sub-organizations. Adding Create takes an Owner or an Admin. A key without the capability is answered 403 with AUTH019.
These routes answer 409 with BIZ014 when the key’s organization is itself a sub-organization: a sub-organization has none of its own.
List sub-organizations
GET /a/v1/organizations/me/children answers a page, newest first, with the total in meta.pagination.
| Parameter | Notes |
|---|---|
page, limit | A page holds 100 at most, and 100 when limit is left out |
search | Part of the name |
ids | Only these sub-organizations: ids separated by commas, 100 at most. An id that is not one of yours is left out of the answer |
Each item carries id, name, legalName, status (pending_verification until its onboarding is completed, then active), tinStatus, liveStatus, country, logoUrl and createdAt.
See which are ready for live
GET /a/v1/organizations/me/children/readiness answers the same page, with the same parameters, and for each sub-organization:
| Field | Meaning |
|---|---|
checklist | tin (its verification status and verifiedAt), contactInfoComplete, phoneVerified, termsAccepted, onboardingCompleted |
liveStatus | not_requested, pending_review, approved, rejected or revoked |
liveEnabled | true once it is approved for live and live mode is open |
nextStep | What that business has to do next: verify_tin, contact_info, verify_phone, complete, awaiting_review, rejected, revoked, live or live_closed |
The work itself is done by the sub-organization’s own members, signed in to it in the Yona app. A parent that onboards its businesses itself can take those steps with its key: see Onboard your businesses by API.
Check their tax connections
GET /i/v1/tax-connection/children?ids= answers one item for each sub-organization named: organizationId, the state of its connection to the tax authority in the key’s environment, and submissionsAllowed, which is true only while it is connected. It needs tax_connection.read, which every preset includes.
ids is required: 100 at most, each once, or the answer is 400 with VAL001. Only the state is shown. The tax number, the key and the history stay with the sub-organization.
Create a sub-organization
POST /a/v1/organizations with a live key that holds organization.children.create.
| Field | Notes |
|---|---|
businessName | Required, 2 to 255 characters. Unique among the parent’s sub-organizations |
email | Required. Becomes the business’s contact email |
phoneNumber | Optional, in international form (+234…) |
website | Optional, an https address |
The answer is 201 with the new organization: type is secondary, parentOrganizationId is your organization, and status is pending_verification until the business completes its own onboarding. It takes the parent’s country, and it is recorded under the parent’s longest-standing Owner, who becomes its Owner.
What to expect when it is refused:
| Status | errorCode | Meaning |
|---|---|---|
403 | BIZ003 | A sandbox key. An organization exists for both environments, so creating one takes a live key |
403 | AUTH019 | The key does not hold organization.children.create |
402 | BIZ016 | The plan allows no more organizations. Upgrading is the remedy, not a retry |
409 | RES002 | A sub-organization of that name exists already (compared without case) |
409 | BIZ010 | The parent has not completed its own onboarding |
429 | SYS005 | More than 60 creations a minute with this key. Wait for Retry-After |
Send an Idempotency-Key header (8 to 128 letters, digits, _ or -) and a request sent twice answers the organization already made, with replayed: true. Without one, a name is unique under its parent, so the second request answers 409 with RES002 and nothing is created twice. Find the organization with GET /a/v1/organizations/me/children?search=.
Hear about new sub-organizations
The parent’s webhook organization.child.created is sent when a sub-organization is created. Its data holds ids only: childOrganizationId, actorUserId (the person it is recorded under) and, when an API key created it, keyId. Read the name and status with GET /a/v1/organizations/me/children?ids=.
What a parent’s key does not do
A key belongs to one organization. The parent’s key lists and creates sub-organizations and reads their readiness; it does not issue invoices for them. With one more permission it can take a business it created through onboarding, and nothing after that: see Onboard your businesses by API. To invoice as a sub-organization, create a key in that sub-organization.