FinchContext
Run with

Build the TFN Declaration Report into ATO XML

Skill: Convert new-employee TFN declaration data into the ATO electronic TFN declaration report

Region: Australia Category: Payroll — TFN Declaration (ATO; STP Phase 2 onboarding) Does: Takes new-employee Tax File Number declaration data and produces the ATO electronic TFN declaration report XML — payee TFN/exemption, residency, tax-free threshold, and study/training loan flags that set the payee's tax treatment. Standard: ATO TFN declaration electronic reporting; tax-treatment data also conveyed via STP Phase 2.

Under STP Phase 2, the payee's tax circumstances are usually reported through the employer's STP pay event (tax treatment code), and a separate TFN declaration report is often no longer lodged. Produce this report only where your process still lodges TFN declaration data electronically. Validate against the current ATO specification before lodging. The employee must still complete and the employer retain the TFN declaration.


When this applies


Conversion procedure

  1. Read the source. Accept the completed TFN declaration (form fields/CSV/JSON) plus the payer ABN and branch. Identify each payee.
  2. Extract fields. Payee TFN (or an exemption code), name, date of birth, address, residency status, tax-free-threshold claim, study/training support loan (STSL) flag, and basis of payment. If the payer ABN, payee name, or TFN/exemption is missing, stop and ask.
  3. Normalize. TFN digits only (or a valid exemption code). Dates YYYY-MM-DD. Booleans to yes/no (or the spec's Y/N).
  4. Derive the residency/threshold/loan combination that sets the tax treatment; ensure the tax-free threshold is claimed with only one employer.
  5. Emit the XML report per the structure and worked example.
  6. Validate with the checklist.

Source → TFN declaration field map

From the source → Target element
Payer ABN Payer/ABN
Payer branch Payer/BranchNumber
Payee TFN (or exemption) Payee/TFN
Payee name Payee/Name
Date of birth Payee/DateOfBirth
Residency status Payee/ResidencyStatus
Tax-free threshold claimed Payee/TaxFreeThreshold
STSL (HELP/SSL/TSL) debt Payee/StudyTrainingLoan
Basis of payment Payee/BasisOfPayment

Document structure

TFNDeclarationReport
├── Payer
│   ├── ABN
│   ├── BranchNumber
│   └── Name
└── Payee ...                 (one per declaration)
    ├── TFN                   (digits or exemption code)
    ├── Name / DateOfBirth / Address
    ├── ResidencyStatus       (resident / foreign / WHM)
    ├── TaxFreeThreshold      (yes/no)
    ├── StudyTrainingLoan     (yes/no)
    └── BasisOfPayment        (F/P/C/L/N)

Code tables

TFN exemption codes (when no TFN provided)

Code Meaning
000000000 New payee — TFN not yet provided / applying within 28 days
111111111 Payee has applied for a TFN (use during the 28-day window)
333333333 Payee is under 18 and earns below the threshold
444444444 Payee is a recipient of a social-security/Centrelink pension or benefit
987654321 Payee chose not to quote and is not claiming an exemption

Basis of payment

Code Meaning
F Full-time employment
P Part-time employment
C Casual employment
L Labour hire
N Non-employment (e.g. superannuation income stream)

Residency status

Code Meaning
resident Australian resident for tax purposes
foreign Foreign resident
whm Working holiday maker

Calculation rules


Worked example (end-to-end)

Input — new employee TFN declaration

Payer ABN 53004085616, branch 001, Sunrise Cafe Pty Ltd
Payee: Alex Tan, DOB 1995-03-12, TFN 123456782
Australian resident, claims tax-free threshold, has a HELP debt, part-time

After normalization (intermediate)

TFN 123456782 ; residency resident ; threshold yes ; STSL yes ; basis P
DOB 1995-03-12 ; ABN 53004085616 ; branch 001

Output — TFN declaration report XML

<?xml version="1.0" encoding="UTF-8"?>
<TFNDeclarationReport>
  <Payer>
    <ABN>53004085616</ABN>
    <BranchNumber>001</BranchNumber>
    <Name>Sunrise Cafe Pty Ltd</Name>
  </Payer>
  <Payee>
    <TFN>123456782</TFN>
    <Name>
      <FamilyName>Tan</FamilyName>
      <GivenName>Alex</GivenName>
    </Name>
    <DateOfBirth>1995-03-12</DateOfBirth>
    <ResidencyStatus>resident</ResidencyStatus>
    <TaxFreeThreshold>yes</TaxFreeThreshold>
    <StudyTrainingLoan>yes</StudyTrainingLoan>
    <BasisOfPayment>P</BasisOfPayment>
  </Payee>
</TFNDeclarationReport>

Normalisations shown: TFN kept as 9 digits 123456782; threshold and HELP flags to yes; residency resident; basis of payment part-time → P; DOB to YYYY-MM-DD.


Validation checklist


Last updated: 2026-06-13 — verify the current ATO TFN declaration electronic specification, STP Phase 2 tax-treatment reporting, and exemption codes before use.