Onboard your businesses by API
A platform or group that brings many businesses to Yona can take each one from created to waiting for approval with five calls. Yona calls this managed onboarding: your organization manages the setup, and the business owner confirms it. The business owner then does two short things on a link Yona hosts: proves the business phone with a code sent by SMS, and, once Yona has approved the business, gives the consent that lets Yona report its e-invoices to NRS.
Nothing a person had to prove before is skipped. The phone check is the owner’s, the approval is a Yona reviewer’s, and the consent is the owner’s.
Who does what
| Who | Does |
|---|---|
| Your Owner or Admin, once | Accepts the managed onboarding terms in the Yona app and creates a live key with the permissions below |
| Your key, for each business | Creates it, sends its Tax ID and contact details, creates its setup link, asks for the review |
| The business owner, first visit | Opens the link and enters the code Yona texts to the business phone |
| Yona | Reviews the business and approves it |
| The business owner, second visit | Opens the same link, enters a fresh code, gives the NRS consent with their name and role, follows the NRS portal steps and uploads the NRS key |
| You | Hear each step on one webhook endpoint |
The same steps can be done without code: in the Yona app, Sub-organizations, Add businesses takes a CSV file and runs them for each row.
Before you start
- Your organization is approved for live, and its plan has room for the businesses you will add. Each business is a sub-organization of yours.
- An Owner or Admin has accepted the managed onboarding terms. This is done once, signed in to the Yona app in live mode, on the Sub-organizations page. With them your organization accepts Yona’s terms on behalf of the businesses it onboards.
GET /a/v1/organizations/me/group-termsanswers where you stand:acceptedistrueonly for the current version. - A live key with three permissions. When you create the key in the Yona app, tick all three under Sub-organizations:
| Capability | Allows |
|---|---|
organization.children.read | Listing your businesses and reading their readiness |
organization.children.create | Creating a business |
organization.children.onboard | The onboarding steps on this page |
None of them is part of a key preset, and only an Owner or an Admin can add them. A sandbox key is refused with 403 BIZ003: businesses are onboarded for live.
The five calls
1. Create the business
POST /a/v1/organizations
| Field | Notes |
|---|---|
businessName | Required. The name as it is registered: the Tax ID check in the next step compares it with the registry’s |
email | Required. The business’s contact email |
phoneNumber | Optional here, in international form (+234…). The contact step sets it |
externalReference | Optional. Your own id for this business: 1 to 64 letters, digits, ., _, : or -. Unique among your businesses and never changed |
The answer is 201 with the business. Keep its id: every later call names it. origin is parent_key and onboardingManaged is true, which is what lets your key take the next steps.
2. Verify its Tax ID
POST /a/v1/organizations/me/children/{id}/onboarding/tax-id
taxNo is the 13 digit Tax ID, or a TIN written as 12345678-0001. Yona checks it with the tax registry and compares the registered name with businessName. The answer is 200 with tinStatus: "verified" and the legalName the registry holds.
Which number to send. Send the business’s TIN (12345678-0001) if it has one, otherwise its 13 digit Tax ID. The NRS knows each business by one of the two, and an older business by its TIN. The business owner never signs in to Yona, so sending the TIN now saves a step later.
3. Set its contact details
PUT /a/v1/organizations/me/children/{id}/onboarding/contact
phoneNumber is required and must be the business owner’s own phone: the codes go to it and nowhere else. Two businesses you are onboarding cannot share a number. contactEmail and address are optional.
4. Create its setup link
POST /a/v1/organizations/me/children/{id}/setup-link
The answer is 201 with url and expiresAt. A link works for 14 days unless you ask for another life, 30 days at most.
The address is shown once. Yona keeps only a fingerprint of it, so store it or send it to the owner straight away. A lost address cannot be read again: create a new link.
A business has one working link. Creating another stops the one before it. DELETE on the same address withdraws the working link at once.
5. Ask for the review
POST /a/v1/organizations/me/children/{id}/onboarding/submit
You do not have to wait for the owner. Before the phone is verified the answer says state: "awaiting_phone_verification", and the business goes to Yona’s reviewers by itself the moment the owner enters the code. With the phone already verified the answer says state: "in_review".
Send the link to the owner
Yona does not send the link. You do, in whatever way your customer expects to hear from you.
On the link the owner sees your organization’s name, the business’s name and the last digits of the phone on record, and asks for a code. The code is sent by SMS to that phone only. The page asks the owner to stop if they do not know your organization.
After the first visit there is nothing more for the owner to do until Yona approves the business. Tell them to keep the link: they finish on it.
After approval
When the review ends you hear organization.child.live_access_approved or organization.child.live_access_rejected.
- Approved. The owner opens the same link, enters a fresh code, and gives the consent with their name and role. The page then shows the steps to take on the NRS portal and takes the NRS key. Your key can make a new link for an approved business if the first is lost or has expired. It can do nothing else to it.
- Rejected. Correct the Tax ID or the contact details with the same calls, then ask for the review again.
Hear every step
Subscribe an endpoint of your organization to these events. Each carries childOrganizationId; none carries a phone number, a name or a reviewer’s message.
| Event | Sent when |
|---|---|
organization.child.created | The business is created |
organization.child.tax_id_verified | Its Tax ID is verified |
organization.child.onboarding_submitted | You ask for the review |
organization.child.phone_verified | The owner enters the code on the link, the first time |
organization.child.live_access_approved | Yona approves it |
organization.child.live_access_rejected | Yona does not approve it |
organization.child.tax_connection_action_required | After the consent, someone must act. state, nextAction and nextActionBy say who and what, for example enable_on_nrs by the taxpayer |
organization.child.tax_connection_connected | The business is connected to NRS and can report live invoices |
organization.child.tax_connection_suspended | The business withdrew Yona’s permission at NRS |
onboarding_submitted and phone_verified can arrive in either order. An event can be delivered more than once: ignore an event id you have already handled.
Where every business stands is also one read: GET /a/v1/organizations/me/children/readiness, described in Sub-organizations.
Repeating a call is safe
The calls are made to be looped, so each can be sent again.
| Call | Sent again |
|---|---|
| Create | With the same Idempotency-Key, or the same externalReference and name, the answer is the business already made, with replayed: true. Nothing is created twice |
| Tax ID | The same number, already verified, answers the stored result with replayed: true. No second lookup is made |
| Contact | The same values change nothing and never undo the phone check |
| Setup link | With the same Idempotency-Key, the answer names the same link with url: null and replayed: true. To get an address again, create a new link on purpose |
| Submit | Answers where the business stands, with replayed: true |
An Idempotency-Key is 8 to 128 letters, digits, _ or -, and is remembered for 7 days. The same key with different details is refused with 409 BIZ107.
When a call is refused
| Status | errorCode | Meaning |
|---|---|---|
404 | RES001 | Not a business your key may onboard. The same answer covers an id that is not yours, a sub-organization its own people set up, and a business Yona has already approved |
403 | BIZ003 | A sandbox key |
403 | AUTH019 | The key does not hold organization.children.onboard, or was revoked |
409 | BIZ004 | errors[0].reason says why: group_terms_not_accepted (accept the current managed onboarding terms), or in_review (nothing can change while Yona reviews the business) |
409 | BIZ010 | Something is missing before this step. errors[].missing names it: tin or contact_info |
409 | RES002 | errors[0] names the field: a phoneNumber another of your businesses uses, or an externalReference that names another business |
409 | BIZ009 | The Tax ID is verified for another organization on Yona |
422 | BIZ007 | The registry’s name for that Tax ID does not match businessName |
402 | BIZ016 | Your plan has no room for another business |
429 | BIZ002 | The day’s limit on Tax ID checks is reached. Try again tomorrow |
503 | The tax registry could not be reached. Wait for Retry-After |
What your key does not do
The key onboards. It does not read a business’s invoices, buyers or documents, it does not approve, and it does not give the NRS consent. Once Yona approves a business the key can only make it a new setup link. To issue invoices as a business, create a key in that business.