kua_test_…
key so nothing moves real money.
Everything here runs in test mode. Test data is
isolated and auto-purges after 14 days, so experiment freely.
Before you start
- A
kua_test_…API key with theemployees:writeandpayroll:writescopes (or*). - An employment type to place the employee in. Employment types are created
in the dashboard; grab its
idfrom Settings → Employment types. We’ll call itEMPLOYMENT_TYPE_IDbelow. - Optionally, an SDK installed (
npm install @kua/nodeorpip install kua).
Add an employee
Create the person you’re going to pay. Send an
You get back the new employee’s
Idempotency-Key so a retry can’t add them twice.id. Set their salary structure in the dashboard
so they’re included in payroll (or via your normal onboarding flow).Create a payroll run
Build a draft run for the month from your current roster. This does not move
money — it stages payroll for approval.The run comes back with
status: "Draft".Approve and disburse
Approval and disbursement are deliberate, owner-gated steps — done from the
dashboard (or an owner-authorized flow), not with a scoped API key. This
keeps an integration from releasing funds on its own. Approve and disburse the
draft run there.As it progresses, Kua emits events:
payroll.run.hr_approved,
payroll.run.disbursement_started, payroll.line.settled (per employee), and
finally payroll.run.disbursed.Receive the event
Rather than polling, let Kua tell you when the run settles. Register a webhook
(once), then handle the delivery.The response includes a signing Not ready to stand up a public endpoint? Fire a test delivery at your handler
with
Register an endpoint
secret (whsec_…) — store it. Now handle
deliveries, verifying each one:POST /v1/webhooks/{id}/ping, or just poll GET /v1/events.What you built
You added an employee, staged a payroll run, and wired up a verified, real-time event handler — the backbone of any Kua integration. From here:Webhooks overview
Delivery, retries, and the full event catalog.
API reference
Every endpoint with a live playground.