Blog · 24 November 2026 · 8 min read

Payroll API compliance,what to check before you plug one in

You judge a payroll API by what it reports to HMRC, on the right day, under the right tax year's rules, not by its documentation.

A white wireframe rubber stamp on a stack of wireframe sheets, on a black background, with a green line linking the stack to a small server
Fig. 01A white wireframe rubber stamp on a stack of wireframe sheets, on a black background, with a green line linking the stack to a small server

You need to plug a payroll API into your product, or into your IT estate, to pay employees in the UK. The documentation is tidy, the examples run, the sales team talks about compliance. One question the demo does not answer: what does the API report to HMRC, and on the day it gets something wrong, who notices?

I write about this because Moonworkers, the company I founded, has been a payroll API for small UK businesses since 2017. Here is what I look at, what I would ask a supplier and what I would test myself, with the official guidance open next to me.

01A payroll API is not a payment API

The first misunderstanding is in the words. When I look up "payroll API" in a French keyword tool, almost every result is about payment APIs: taking a card, moving money. A payroll API does something else. It works out what an employer owes each employee and the tax authority, produces payslips, and sends the reports.

Paying the salaries often happens somewhere else: the bank, a BACS file. That split matters when you scope your project. If you put both in the same piece of work, you will test the payment, which everyone can see, and forget the report, which nobody sees.

02What HMRC expects from payroll software

In the UK, reporting happens in real time (Real Time Information, RTI). The government page on reporting to HMRC is clear: the Full Payment Submission (FPS) goes on or before payday, for every employee you pay. Then the Employer Payment Summary (EPS) goes by the 19th of the following tax month, and the balance is due by the 22nd.

HMRC's own channel sums it up in a video on payroll software: the FPS tells HMRC what you paid, what you deducted, what you owe, and who has joined or left since your last report. A late FPS can mean a penalty. The page on sending an FPS after payday lists the only exceptions allowed, each with its own reason code.

For a software supplier, that means three concrete things:

  • the API has to produce a correct FPS on every pay run, not just a correct payslip;
  • it has to be able to send a corrected FPS and an EPS, which the guidance on choosing software flags as missing from some products;
  • a technical delay on your side becomes a late report on the employer's side.

HMRC publishes a list of the software it recognises, without recommending any of it. The RTI technical specifications state that recognition requires finished development, thorough testing and a product already on the market. It is a first filter, not a guarantee that your edge cases are covered.

France works in a similar way. The DSN as described by Service Public (in French) is monthly, generated from the payroll software, and filed per establishment. The timetable differs, the idea is the same: the report comes out of the software, so its mistakes do too.

03The rules change every 6 April, and the API has to know

The UK tax year starts on 6 April. The page of rates and thresholds for 2026 to 2027 states that its figures apply from 6 April 2026 to 5 April 2027. It also shows that Income Tax depends on the nation: three bands in England and Northern Ireland, six in Scotland, from 19% to 48%.

So the same salary does not give the same take-home pay depending on the year and the place. On integrations between tools, I learnt the hard way that an implicit reference value ends up skewing everything: a mix of centimetres and millimetres once cost me a whole render, as I explain in my write-up of a unit of measure bug. In payroll, the equivalent is the tax year and the nation. I want to see both in every request and every response, not inferred from the server's clock.

The rules also move mid-stream. HMRC has published how to prepare for mandatory payrolling of benefits in kind: from 6 April 2027, company cars, vans and medical insurance go through the FPS, and almost every other benefit follows a year later. HMRC asks employers to check that their payroll software provider is ready. If you integrate a payroll API, that provider is your supplier. If you resell it, the provider is you.

04Check the calculations before you pay anyone

A payroll error is silent. The payslip shows a plausible amount, just a few pence out, and the error repeats for every employee, every month.

At Moonworkers, an oracle written from HMRC's own texts replayed 896 contribution cases. It found four one-penny errors, all caused by a rounding rule. The existing tests could not see them, because they expected whatever the code already returned. I describe the method in my article on test oracles.

We applied the same discipline to the free calculators on the website, each one checked against the official tools before going live. The approach is set out in the article on verified online calculators. If you are integrating someone else's API, you can do the same thing on a small scale.

A test set in four steps

  1. Take ten to twenty real, anonymised profiles: full time, part time, a mid-month starter, a leaver, an employee in Scotland.
  2. Add the edges: just under a National Insurance threshold, exactly on it, just over it, a zero salary, a very large amount.
  3. Work out the expected result with a tool that is independent of the supplier, the official tool or a spreadsheet someone has checked, noting the rule and the tax year for each case.
  4. Compare line by line with the API's answer, and settle every difference by going back to the guidance.

Replay this test set at every new tax year and every new version of the API. I treat it as business acceptance testing, with the same sign-off rules as user acceptance testing.

05Questions to ask a payroll API supplier

This is the list I would take to the meeting. It does not judge the quality of the product. It shows whether the supplier has asked themselves the same questions you are asking.

  • Is the software on HMRC's list of recognised products, and for which reports exactly (FPS, EPS, EYU)?
  • How does the API receive the tax year and the employee's nation? What happens to a pay run dated 5 April and paid on 6 April?
  • When are the new tax year's figures available, and how are you told?
  • How do you correct an FPS that has already gone? With which call, and what audit trail?
  • What does the API return when HMRC rejects a submission, and how quickly?
  • Does sending the same request twice create two pay runs? A network drop should never produce a duplicate.
  • What happens when you switch supplier? The government guidance warns that a badly reported change of payroll IDs can make your PAYE bill wrong and duplicate records.
  • Where is the list of cases the product does not handle?

The last question is my favourite. A supplier who can answer it precisely has tested their limits. A supplier who says "we handle everything" has not found them yet.

There is also the choice between real-time calls and batch feeds to bring data into payroll (hours, bonuses, starters and leavers). I cover it in the article on real-time APIs and batch feeds. For payroll, my rule is simple: the data has to be right and frozen at the cut-off date, not right to the second.

06What this approach does not cover

I am neither a lawyer nor an accountant. This method checks that an API does what the published guidance describes. It does not replace advice on a specific case: an unclear employment status, a seconded employee, a French collective agreement.

It also has a cost. A serious test set takes several days to build, and someone has to replay it every spring. If you have three employees and simple payroll, off-the-shelf software and a bureau will do better, for less, than integrating an API. A payroll API makes sense when payroll is part of your product, not when it is one of your overheads.

Finally, I have said nothing about data security. A National Insurance number or a salary is sensitive personal data, and handling it deserves its own piece of work.

07Where to start on Monday

Open the documentation for the API you are considering and search for two things: the tax year and the nation. If neither appears in any request, ask before going any further. Then write your first ten test cases with their expected results, before you read a single response from the API.

If you would like an outside view on an integration like this, my services page explains how I work, and the portfolio shows what I have already built, Moonworkers included. Happy to talk it through.

Frequently asked questions

Do you have to use payroll software?
In the UK, HMRC requires an employer who runs payroll themselves to use software that reports PAYE online, unless they are exempt. In France, the monthly DSN is generated from compatible payroll software. In both countries you can hand payroll to a bureau or an accountant, but the report still goes through software, yours or theirs.
How does payroll software work?
It starts from each employee's details (contract, salary, tax code, National Insurance number) and the rules for the current tax year, works out gross pay, deductions and net pay, produces payslips, then sends the report to the tax authority. A payroll API does the same thing without a screen: your product sends it the data and reads back the results.
How do you integrate payroll software with other business tools?
I start by listing who owns each piece of data (the HR system for contracts, the time tracking tool for hours, the accounts for journal entries) and which way it flows. Then, data item by data item, I choose between a real-time call and a batch feed. Payroll itself does not take well to improvisation, so I set a cut-off date before every pay run.
What are the modern alternatives to traditional payroll software?
Online payroll software, bureaus that run payroll for you, and payroll APIs, which let a software company build calculation and reporting into its own product. The choice mostly depends on who is responsible for the report and who has the time to check the calculations every month.

Sources

  1. 01GOV.UK, Running payroll: Reporting to HMRC (FPS)
  2. 02HMRCgovuk (YouTube), How do I use payroll software to send reports to HMRC?
  3. 03GOV.UK, Running payroll: Sending an FPS after payday
  4. 04GOV.UK, Find payroll software
  5. 05HM Revenue & Customs, Real Time Information internet submissions: generic technical specifications
  6. 06Service Public Entreprendre, Nominative social declaration (DSN) (in French)
  7. 07HM Revenue & Customs, Rates and thresholds for employers 2026 to 2027
  8. 08HM Revenue & Customs, Prepare for mandatory payrolling of benefits in kind