States and LGAs
A Nigerian address on an e-invoice names its state and local government area (LGA) with the tax authority’s own codes: NG-LA for Lagos, NG-LA-IKE for Ikeja. Yona serves both lists, checks a buyer’s address against them, and sends the codes to the authority when an invoice is issued.
The lists
Both are free to read with any key (reference.read) and change rarely, so read them once and keep them.
| List | Route | Item | Example |
|---|---|---|---|
| States | GET /i/v1/invoices/resources/states | { code, name } | { "code": "NG-LA", "name": "Lagos" } |
| LGAs | GET /i/v1/invoices/resources/lgas | { code, name, stateCode } | { "code": "NG-LA-IKE", "name": "Ikeja", "stateCode": "NG-LA" } |
| Countries | GET /i/v1/invoices/resources/countries | { code, name } | { "code": "NG", "name": "Nigeria" } |
The answer is the usual envelope with data: { type, version, items, fetchedAt, stale }. version goes up when the authority changes a list, and GET /i/v1/invoices/resources lists every code list with its version, which is a cheap way to notice a change.
- There are 37 states: the 36 states and the Federal Capital Territory (
NG-FC). - An LGA belongs to one state. Its
stateCodeis that state’scode. - A code cannot be worked out from a name. Ikeja is
NG-LA-IKE; Kwali in the FCT isNG-FC-KL1. Read the codes from the list. - A few LGA names exist in two states (Surulere, Obi, Bassa, Ifelodun, Irepodun, Nasarawa). Keep the code, never the name alone.
A State and LGA picker
Load both lists once. When the user picks a state, show the LGAs whose stateCode is that state’s code, and keep the two codes.
const lagos = states.find((state) => state.name === 'Lagos'); // { code: 'NG-LA', name: 'Lagos' }
const lgasOfLagos = lgas.filter((lga) => lga.stateCode === lagos.code); // the LGA picker's optionsBuyers
A postal address is { line1, line2?, city, state?, lga?, postalCode?, country }. state and lga are optional. For an address in Nigeria (country: "NG"):
stateis a statecode. Its exactname(Lagos) is accepted too and is stored as the code.lgais thecodeof an LGA of that state. Its exactnamewithin the state (Ikeja) is accepted too and is stored as the code.- An
lgasent without astatefills the state in, unless the name exists in two states. - Answers always carry the codes.
For any other country, state is free text and is not checked.
POST /i/v1/buyers and PATCH /i/v1/buyers/{id} refuse a value that is not on the lists. Nothing is saved and nothing is charged:
| Status | errorCode | Meaning | Field in errors |
|---|---|---|---|
400 | VAL202 | state is not on the list of states | address.state |
400 | VAL203 | lga is not on the list of LGAs, or belongs to another state | address.lga |
Your own address
Your organization is the seller on every invoice. Its address is edited in the Yona app, where the state and the LGA are chosen from the same lists.
What the tax authority receives
When an invoice is issued, the seller’s and the buyer’s state and LGA go to the authority as codes, and the invoice keeps the names beside them as stateName and lgaName for the PDF.
A buyer or an organization address saved before these lists (free text such as “Lagos State”) is matched to them when the invoice is issued. A value that matches nothing is left off what the authority receives and still prints on the PDF. Issuing never fails because of an old address.