How do I call a payroll tax API from Node.js?
Use fetch to POST a JSON paycheck to https://omniatax.io/v1/paycheck with an Authorization: Bearer header, then read result.taxes and result.netPay from the response.
Developers
Calculate a paycheck from Node with fetch.
This example uses the built-in fetch in Node 18 and later. Call the API from your server, never from a browser page, because a bearer key in front-end code is a key anyone can copy.
const res = await fetch("https://omniatax.io/v1/paycheck", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.OMNIA_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
checkDate: "2026-09-15",
payFrequency: "biweekly",
earnings: [{ code: "REG", category: "regular", amount: 300000 }],
deductions: [],
federalW4: { filingStatus: "single", multipleJobs: false,
dependentCredit: 0, otherIncome: 0, deductions: 0, extraWithholding: 0 },
ytd: { socialSecurity: 0, medicare: 0, futa: 0 },
workState: { code: "TX", certificate: {} },
}),
});
if (res.status === 422) {
const { details = [] } = await res.json();
for (const d of details) console.error(d.path, "-", d.message);
process.exit(1);
}
if (res.status === 429) throw new Error(`retry in ${res.headers.get("Retry-After")}s`);
if (!res.ok) throw new Error(`HTTP ${res.status}`);
const { result } = await res.json();
for (const t of result.taxes) console.log(t.id, t.payer, t.amount);
console.log("net pay (cents):", result.netPay);For this paycheck result.netPay is 245012 cents ($2,450.12). The first lines of result.taxes are US_FIT (32038), US_SS_EE (18600), US_SS_ER (18600).
0.1 + 0.2 is the reason.result.notices and result.warnings if present and surface them to a reviewer.Payroll tax API Python example · Payroll tax API cURL example · Payroll tax API authentication · Payroll tax API integration guide · All guides
Use fetch to POST a JSON paycheck to https://omniatax.io/v1/paycheck with an Authorization: Bearer header, then read result.taxes and result.netPay from the response.
Avoid it. A bearer key in front-end code can be copied by any visitor. Call the API from your server and expose only what your page needs.
14-day free trial, then $0.08 per paycheck calculation. Omnia Express calculates; it does not file, deposit tax, or give tax advice. Disclaimer.