<aside> 🔁 Synced from GitHub #0a389b1d1d3e. Edit in the paidhr-system-docs repository, not here: changes made in Notion are overwritten.

</aside>

Integrations & data sync

Status: Live

💡 In plain words

Integrations keep PaidHR in step with other systems.

Large employers can connect their own HR system so employee details, pay changes and leave flow in automatically. PaidHR also connects to lenders, insurers and payment providers, and lets approved apps read payslips. Data is also copied to a separate store for reporting.

Like pipes between buildings, carrying information so nobody has to retype it.

Who's involved: customers' IT teams (connect their systems), partners, and PaidHR (runs the sync).

In one paragraph

PaidHR exchanges data with customers' own systems, with partners and with internal reporting. HR system feeds (Oracle Fusion for large employers, and a generic integration format) keep employees, compensation, leave and payroll changes in step every five minutes. Partner integrations connect lenders and insurers. Client apps can sign in with OAuth or SSO to read payslips. White-label agents let resellers run PaidHR on their own domain. Webhooks from payment providers report payouts, and warehouse sync copies data for reporting.

HR system feeds

flowchart LR
  FUS[Oracle Fusion<br/>customer HR] -->|push to IntegrationController<br/>Fusion/*Notification| STG[(membership staging:<br/>FusionEmployees, FusionCompensations,<br/>IntegrationEmployees, …)]
  GEN[Other HR systems] -->|Integration/* notifications| STG
  STG -->|every 5 min<br/>Fusion*/Integration* workers| TEN[(Tenant: Persons, pay grades,<br/>leave requests, payroll changes)]
  TEN -->|payslip interface| FUS
Feed What it carries
Fusion employees, status, grade history New hires, changes, exits. Now also carries personal-profile fields — state of origin, LGA, town, state of issuance, means of identification and its number, marital status and number of primary dependants — which flow through to the person's record (marital status and dependants land on the profile) and feed the NSITF statutory report
Fusion compensation and history Pay changes, to payroll changes
Fusion reimbursements Reimbursement payroll changes
Fusion allowance days Allowance days imported for payroll (Import_Fusion_Allowance_Days)
Fusion payslip interface Payslip data sent back
Integration employees, status, compensation, custom fields, leave requests, payroll changes The same for non-Fusion systems

Each arrives in a staging table in membership, then a worker signs in as the organisation and applies it to the tenant. A record stuck in staging means the worker failed for it; staging rows keep their status.

Data-integration API keys, scoped by module

ewa-service's data-integration endpoints (the generic integration format: sync and fetch of employees, custom fields, compensation, employee status, payroll changes, payroll ledger and leave requests) are called with an api_key header rather than a user session. Each API key belongs to an integration client (one company). The guard refuses the call before anything runs:

A key is now scoped to a set of modules. Ops provision each key for one or more of five modules, each of which unlocks a fixed set of endpoints:

Module Endpoints it unlocks
Employees POST /employees, GET /employees and the /employees/{workplaces,departments,paybands,paygrades,pfas} lookups
Custom fields POST /custom-fields, GET /employees/custom-fields
Payroll POST/GET /compensation, /employee-status, /payroll-change
Payroll ledger GET /payroll-ledger
Leave POST/GET /leave-requests, /leave-requests/{policies,perks}

Each guarded endpoint declares the module it needs (@RequiresModule). When a key's modules are set and do not include the one an endpoint needs, the call is refused with Forbidden API key is not provisioned for the X module. A key with no modules set reaches every module — older keys provisioned before scoping existed keep full access until ops narrow them. The misc lookups (misc/countries, misc/states/:code, misc/banks/:code) and sub-accounts are not scoped to any module.

Payment webhooks

IntegrationController: PayoutNotification, Flutterwave/PayoutNotification, Paystack/PayoutNotification, plus Ewa/EmployeeNotification and Ewa/WithdrawalNotification from ewa-service.