Jackson Kojo Osei
statusoperationalaccra--:--:--regiongh · uk
operational

Ghana Payroll API

PAYE, SSNIT and net pay for Ghana, calculated exactly and explained line by line.

What it does

An open-source API that works out PAYE, SSNIT Tier 1 and Tier 2, and net pay from the official GRA and SSNIT rate tables, including the new bands from 1 September 2026. Every result shows its working and names the official table it used, and rate changes are versioned so old payslips recalculate exactly.

The problem

Small businesses and HR tools in Ghana still calculate payroll in spreadsheets, and tax bands change. Mistakes cost money and trust.

What you get

Payroll calculator: GHS 5,000 basic and GHS 1,000 allowances gives GHS 4,689.25 net pay, with SSNIT and each PAYE band shown
GHS 5,000 basic and GHS 1,000 allowances: GHS 4,689.25 net, with every step shown.
A high earner's payslip with SSNIT capped at GHS 69,000, the bonus split at the 15% limit and income over GHS 50,000 taxed at 35%
A high earner with a big bonus: SSNIT stops at the GHS 69,000 cap, and the bonus over the 15% limit is taxed as income.
How the Ghana Payroll API works: the pay period picks official rate tables, then SSNIT, bonus and overtime, chargeable income and PAYE bands lead to the payslip
The pay period picks the official tables. Everything after that is shown step by step.

How to use it

Run the API next to your HR or accounting app and send it amounts in pesewas (GHS 5,000.00 is 500000). Store the rate_tables it returns with each payslip so you can always show your working.

1. Install and run

git clone https://github.com/Jacksonoseikojo1122/ghana-payroll-api.git
cd ghana-payroll-api && npm install
npm start   # http://localhost:8788, with a calculator at /

2. Calculate a payslip

curl -X POST http://localhost:8788/v1/payslip -H 'content-type: application/json' -d '{
  "period": "2026-10",
  "basic_salary": 500000,
  "allowances": [{ "name": "Transport", "amount": 100000 }]
}'
# net_pay 468925 (GHS 4,689.25), tax.paye 103575, ssnit.tier1 67500, ssnit.tier2 25000

3. From your app (TypeScript)

const res = await fetch(`${PAYROLL_URL}/v1/payslip`, {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({ period: "2026-10", basic_salary: 500000 }),
});
const slip = await res.json();
if (res.status === 422) throw new Error(slip.error); // no official table for that period

console.log(slip.net_pay / 100);   // net pay in cedis
console.log(slip.working);         // every step, in words
console.log(slip.rate_tables);     // which GRA and SSNIT tables were used

4. A whole payroll, safely retried

res = requests.post(f"{PAYROLL_URL}/v1/payroll-runs",
    headers={"Authorization": f"Bearer {KEY}", "Idempotency-Key": "acme-2026-10"},
    json={"period": "2026-10", "employees": employees})
run = res.json()   # same key again returns this run, never a second one
csv = requests.get(f"{PAYROLL_URL}/v1/payroll-runs/{run['id']}/payslips.csv",
    headers={"Authorization": f"Bearer {KEY}"}).text

Documentation

Features

  • PAYE from GRA's Act 1178 bands (from 1 September 2026), with bonus, overtime, non-resident and casual-worker rules
  • SSNIT on basic salary within the 2026 limits, split into employee, employer, Tier 1 and Tier 2
  • Every step of the working in the response, with links to the official GRA and SSNIT sources
  • Integer pesewas throughout, rounded per band, so the numbers always add up
  • Versioned rate tables: no official table for a period means an error, never a guess
  • Gross-up from a target net pay, and payroll runs with idempotency keys and CSV export

What building it covers

  • Exact money logic
  • Versioned business rules
  • Audit trails
  • Idempotent batch jobs

Stack

  • TypeScript
  • Node.js
  • Hono
  • Zod
  • PostgreSQL
  • SQLite
  • Vitest
  • Docker

Questions

What are the PAYE rates in Ghana from September 2026?

Under the Income Tax (Amendment) Act, 2026 (Act 1178), monthly chargeable income for residents is taxed at 0% on the first GHS 588, 5% on the next GHS 80, 10% on the next GHS 100, 17.5% on the next GHS 2,900, 25% on the next GHS 16,000, 30% on the next GHS 30,332, and 35% above GHS 50,000. GRA says the new rates apply from 1 September 2026.

How is SSNIT calculated?

On basic salary only. The employee pays 5.5% and the employer 13%, 18.5% in total. Of that, 13.5% goes to SSNIT as Tier 1 and 5% to the Tier 2 trustee. For 2026, insurable earnings are between GHS 587.80 and GHS 69,000 a month, so the most anyone pays to SSNIT is GHS 9,315.

How much is PAYE on a GHS 5,000 salary?

With GHS 5,000 basic and GHS 1,000 taxable allowances in October 2026: SSNIT is GHS 275, chargeable income is GHS 5,725, PAYE is GHS 1,035.75 and net pay is GHS 4,689.25. The employer also pays GHS 650 SSNIT.

How is a bonus taxed in Ghana?

Bonus up to 15% of the employee's annual basic salary is taxed at 5%. Anything over that is added to income for the month and taxed at the normal rates. The API tracks bonus already paid earlier in the year.

Can it calculate pay for months before September 2026?

Not yet. Those months used the earlier bands, and the API only uses tables taken from official GRA and SSNIT documents. Until that table is added, those periods return an error instead of a guess.

Is it tax advice?

No. It does the arithmetic from the rules GRA and SSNIT publish and shows its working. Check unusual cases with GRA or a tax adviser.

Is it free?

Yes. It's open source under the MIT licence.

All projects