ac-co.ai docs

HMRC data

What the restricted hmrc.* group returns, how payroll, CIS and P11D filings reach HMRC, and why HMRC MTD data (VAT, ITSA) is not available through the API.

The Public API has a small restricted hmrc.* group with two Self Assessment reads, mounted at /api/rpc/hmrc/...:

  • selfAssessment.listTaxYears — the tax years with a Self Assessment draft or submission in ac-co.ai.
  • selfAssessment.getFilingSummary — the summary of a submitted return.

Both are answered from records held in ac-co.ai. Neither calls HMRC. See the hmrc group in the API Reference.

Restricted scope

Both endpoints need hmrc:read, a restricted scope: ac-co.ai grants it to an API key or OAuth client only after manual approval, even though you can select it in the key creator or request it in an OAuth scope parameter. hmrc:write is in the scope catalog but no endpoint uses it.

Payroll, CIS and P11D filings

These filings are not sent through the Public API. The API can only prepare them (see Payroll, CIS and P11D); everything after that happens in the ac-co.ai apps, through one shared payrollFiling flow on our HMRC service:

  1. Prepare. The server builds and validates the filing, freezes a preview and a payload hash, and queues it as awaiting_approval. Nothing is sent.
  2. Approve. A signed-in person with permission to submit approves the preparation. An approval is good for one send attempt: a failed send after it is consumed needs a new preparation and approval.
  3. Submit. The HMRC service re-checks that the prepared document is unchanged, spends the approval and sends it. Submission is switched on per deployment, and fails closed when it is not.

Which route reaches HMRC depends on the filing:

FilingRoute
FPS, EPSHMRC Basic PAYE Tools when the deployment has it configured, otherwise the GovTalk Transaction Engine.
CIS300, CIS verificationGovTalk only.
P11D and P11D(b) (EXB)GovTalk only.

Basic PAYE Tools carries RTI only, so CIS and EXB never go through it.

Unknown outcomes

If a request may have reached HMRC but no final answer came back (a timeout, a server error, an unreadable reply, or no HMRC correlation ID), the filing is unknown_outcome, not failed. We only mark a filing accepted or rejected on a final HMRC answer, and failed only when we can prove nothing left. While a filing is unknown_outcome, no further send of that kind is allowed: it is never resent automatically. A polled final answer settles it, or a person reconciles it by recording what HMRC actually did. Watch outcomes with the submission.accepted / submission.rejected webhooks or GET .../filings/{id}/status.

The older direct submit routes in the payroll app refuse FPS, EPS, CIS and P11D filings, so the flow above is the only way they reach HMRC.

No VAT or ITSA data

HMRC Making Tax Digital endpoints (VAT, Income Tax Self Assessment) are not available through the API, reads included. Every MTD call must carry HMRC's fraud prevention headers, which describe the end user's own device and every hop between it and HMRC, collected by the software that talks to HMRC. When a request comes from your integration, the device in front of the user is yours, not ours, so we cannot send headers that are true. That work stays in the ac-co.ai web app and Excel add-in, where the user's own browser supplies them.

Errors

If our HMRC service is unreachable when we forward a request, you get HTTP 502:

{
  "error": "bad_gateway",
  "message": "HMRC service unreachable: <reason>"
}

This is an outage on our side, not a problem with your request. Retry with backoff.

On this page