Who it is for

Payroll tax API in Google Sheets

A custom function that returns net pay for a row.

Google Apps Script can call any HTTPS API with UrlFetchApp, so a sheet can use the Omnia Express engine for the calculation while you keep your own layout. The key must not live in a cell: store it in Script Properties.

The script

function NETPAY(state, grossDollars) {
  const key = PropertiesService.getScriptProperties().getProperty("OMNIA_KEY");
  const body = {
    checkDate: "2026-09-15",
    payFrequency: "biweekly",
    earnings: [{ code: "REG", category: "regular", amount: Math.round(grossDollars * 100) }],
    deductions: [],
    federalW4: { filingStatus: "single", multipleJobs: false,
      dependentCredit: 0, otherIncome: 0, deductions: 0, extraWithholding: 0 },
    ytd: { socialSecurity: 0, medicare: 0, futa: 0 },
    workState: { code: state, certificate: {} },
  };
  const res = UrlFetchApp.fetch("https://omniatax.io/v1/paycheck", {
    method: "post",
    contentType: "application/json",
    headers: { Authorization: "Bearer " + key },
    payload: JSON.stringify(body),
    muteHttpExceptions: true,
  });
  if (res.getResponseCode() !== 200) return "error " + res.getResponseCode();
  return JSON.parse(res.getContentText()).result.netPay / 100;
}

Use it

In a cell: =NETPAY("TX", 3000). For the Texas example it returns 2450.12. =NETPAY("CA", 3000) returns 2277.06.

Cautions

Beyond one number

Return the whole response into a range, or one line at a time, by reading result.taxes. See the response fields.

Keep reading

Payroll tax API vs spreadsheet · Payroll tax API JavaScript example · Payroll tax API test keys · Payroll tax API response fields · All guides

Questions

Can Google Sheets call a payroll tax API?

Yes. Apps Script can post JSON to the API with UrlFetchApp and return a value to a cell through a custom function.

Where should I keep the API key?

In Script Properties, never in a cell. Anyone with access to the sheet could read a key stored in it.

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.