Developers

Payroll tax API: a JavaScript example

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.

The call

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);

What you get

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).

Practical points

Keep reading

Payroll tax API Python example · Payroll tax API cURL example · Payroll tax API authentication · Payroll tax API integration guide · All guides

Questions

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.

Can I call the API from browser JavaScript?

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.

Start the 14-day trial Read the docs →

14-day free trial, then $0.08 per paycheck calculation. Omnia Express calculates; it does not file, deposit tax, or give tax advice. Disclaimer.