Skip to Content
GuidesSub-organizations

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

CapabilityAllowsKeys
organization.children.readListing sub-organizations and reading their readinessSandbox and live
organization.children.createCreating a sub-organizationLive 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.

ParameterNotes
page, limitA page holds 100 at most, and 100 when limit is left out
searchPart of the name
idsOnly these sub-organizations: ids separated by commas, 100 at most. An id that is not one of yours is left out of the answer
bash
curl "https://gp.useyona.com/a/v1/organizations/me/children?search=acme&limit=50" \
-H "Authorization: Bearer sk_test_your_key_here"

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:

FieldMeaning
checklisttin (its verification status and verifiedAt), contactInfoComplete, phoneVerified, termsAccepted, onboardingCompleted
liveStatusnot_requested, pending_review, approved, rejected or revoked
liveEnabledtrue once it is approved for live and live mode is open
nextStepWhat 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.

bash
curl "https://gp.useyona.com/i/v1/tax-connection/children?ids=SUB_ORG_ID_1,SUB_ORG_ID_2" \
-H "Authorization: Bearer sk_test_your_key_here"

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.

bash
curl -X POST https://gp.useyona.com/a/v1/organizations \
-H "Authorization: Bearer sk_live_your_key_here" \
-H "Content-Type: application/json" \
-d '{
  "businessName": "Acme Retail Ltd",
  "email": "accounts@acmeretail.example",
  "phoneNumber": "+2348012345678"
}'
FieldNotes
businessNameRequired, 2 to 255 characters. Unique among the parent’s sub-organizations
emailRequired. Becomes the business’s contact email
phoneNumberOptional, in international form (+234…)
websiteOptional, 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:

StatuserrorCodeMeaning
403BIZ003A sandbox key. An organization exists for both environments, so creating one takes a live key
403AUTH019The key does not hold organization.children.create
402BIZ016The plan allows no more organizations. Upgrading is the remedy, not a retry
409RES002A sub-organization of that name exists already (compared without case)
409BIZ010The parent has not completed its own onboarding
429SYS005More than 60 creations a minute with this key. Wait for Retry-After
Repeating a request is safe

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.