Build the FATCA Form 8966 Report into IDES XML
Skill: Convert account-holder data into the FATCA Form 8966 XML for IDES
Region: United States
Category: FATCA — Form 8966 (FATCA XML for IDES)
Does: Takes reportable-account data and produces the FATCA Report (Form 8966) XML in the IRS FATCA XML v2.0 schema for transmission through the International Data Exchange Service (IDES).
Schema version: IRS FATCA XML v2.0 — urn:oecd:ties:fatca:v2
The AI builds the report payload only. IDES requires the file to be signed, compressed, and AES/RSA-encrypted with the IRS public key and packaged per the IDES User Guide — those steps happen in your transmission tooling, not here. Validate against the FATCA XML v2.0 XSD before packaging. Reporting is annual; a Reporting Period of
YYYY-12-31.
This skill assists with authorized, legitimate tax-reporting compliance only.
When this applies
- A Foreign Financial Institution (FFI), a Model 2 IGA FFI, or a withholding agent reports U.S. accounts (or pooled/aggregate reporting) directly to the IRS via IDES.
- Model 1 IGA filers usually send to their host tax authority in the same schema; the wrapper/transmission differs but the
FATCA_OECDpayload is the same. - Use for new reports (
FATCA1), nil reports (FATCA3), and corrections/amendments/voids (FATCA2/FATCA4) viaDocTypeIndic.
Conversion procedure
- Read the source. Accept CSV/JSON of accounts plus the FFI's identity (GIIN, name, address, country). Identify the reporting period and message type.
- Extract fields. For each account: account number, holder (individual or organisation), U.S. TIN, address, account balance, and payments (dividends, interest, gross proceeds, other). If a GIIN, U.S. TIN, AccountNumber, or AccountBalance is missing, stop and ask.
- Normalize. Dates
YYYY-MM-DD. Currency codes ISO-4217 (USD). Country codes ISO-3166 alpha-2. Generate a uniqueMessageRefIdand, for eachDocSpec, a uniqueDocRefId(convention: GIIN + period + sequence). - Assemble
MessageSpeconce, thenReportingFI,ReportingGroup, and oneAccountReportper account (or aPoolReport/NilReport). - Emit the XML per the structure and worked example.
- Validate against the XSD and the checklist.
Source → FATCA XML field map
| From the source | → Target element |
|---|---|
| Sender GIIN | MessageSpec/SendingCompanyIN, ReportingFI/TIN (the GIIN) |
| Transmitting country | MessageSpec/TransmittingCountry |
| Receiving country (IRS = US) | MessageSpec/ReceivingCountry |
| Message type (FATCA) | MessageSpec/MessageType |
| Unique message id | MessageSpec/MessageRefId |
| New vs correction | MessageSpec/MessageTypeIndic (FATCA1/FATCA2/FATCA3/FATCA4) |
| Reporting period end | MessageSpec/ReportingPeriod (YYYY-12-31) |
| FFI name / address / country | ReportingFI/Name, Address, CountryCode |
| Doc type / ref / correction ref | DocSpec/DocTypeIndic, DocRefId, CorrDocRefId |
| Account number | AccountReport/AccountNumber |
| Holder name (individual/org) | AccountHolder/Individual|Organisation/Name |
| Holder U.S. TIN | AccountHolder/.../TIN issuedBy="US" |
| Account balance + currency | AccountBalance currCode="USD" |
| Payment type + amount | Payment/Type, Payment/PaymentAmnt |
Document structure
FATCA_OECD (version 2.0)
├── MessageSpec
│ ├── SendingCompanyIN (GIIN)
│ ├── TransmittingCountry (ISO-2)
│ ├── ReceivingCountry (US)
│ ├── MessageType (FATCA)
│ ├── MessageRefId (unique)
│ ├── MessageTypeIndic (FATCA1 new / FATCA2 corrected / FATCA3 void / FATCA4 amended)
│ └── ReportingPeriod (YYYY-12-31)
└── FATCA
├── ReportingFI
│ ├── ResCountryCode / TIN (GIIN) / Name / Address
│ └── DocSpec (DocTypeIndic, DocRefId)
├── ReportingGroup
│ └── AccountReport ... (one per account)
│ ├── DocSpec (DocTypeIndic, DocRefId[, CorrDocRefId])
│ ├── AccountNumber
│ ├── AccountHolder (Individual | Organisation + TIN)
│ ├── AccountBalance
│ └── Payment ...
└── (PoolReport | NilReport as alternatives)
Code tables
MessageTypeIndic / DocTypeIndic
| Code | Meaning |
|---|---|
FATCA1 |
New data |
FATCA2 |
Corrected data |
FATCA3 |
Void data |
FATCA4 |
Amended data |
FATCA11 (DocTypeIndic) |
New data |
FATCA12 |
Corrected data |
FATCA13 |
Void data |
FATCA14 |
Amended data |
Payment/Type (selected)
| Code | Meaning |
|---|---|
FATCA501 |
Dividends |
FATCA502 |
Interest |
FATCA503 |
Gross proceeds / redemptions |
FATCA504 |
Other |
AcctHolderType (Organisation accounts)
| Code | Meaning |
|---|---|
FATCA101 |
Owner-documented FI with specified U.S. owner(s) |
FATCA102 |
Passive NFFE with substantial U.S. owner(s) |
FATCA103 |
Non-participating FFI |
FATCA104 |
Specified U.S. person |
Calculation rules
- AccountBalance is the period-end balance/value in the account currency; report
0only for a closed account flagged accordingly. - Payment amounts are aggregate gross amounts paid/credited during the period, per type, to the cent.
- DocRefId must be globally unique and begin with the reporting GIIN; a correction sets
CorrDocRefIdto the priorDocRefIdandDocTypeIndicto the corrected/void/amended code. - Recompute payment totals from source rows; flag mismatches.
Worked example (end-to-end)
Input — one reportable individual account
Reporting FI: Example Bank Ltd, Germany, GIIN S519K4.99999.SL.276
Reporting period: 2025
Account: CH9300762011623852957, holder Maria Schmidt, US TIN 123-45-6789
Balance: 250000 USD ; Dividends paid: 1200 USD
After normalization (intermediate)
MessageRefId S519K4.99999.SL.276-2025-001
DocRefId(FI) S519K4.99999.SL.276-2025-FI
DocRefId(acct) S519K4.99999.SL.276-2025-A001
US TIN 123456789 ; ReportingPeriod 2025-12-31
Output — FATCA Form 8966 XML
<?xml version="1.0" encoding="UTF-8"?>
<ftc:FATCA_OECD xmlns:ftc="urn:oecd:ties:fatca:v2"
xmlns:sfa="urn:oecd:ties:stffatcatypes:v2"
xmlns:iso="urn:oecd:ties:isofatcatypes:v1" version="2.0">
<ftc:MessageSpec>
<sfa:SendingCompanyIN>S519K4.99999.SL.276</sfa:SendingCompanyIN>
<sfa:TransmittingCountry>DE</sfa:TransmittingCountry>
<sfa:ReceivingCountry>US</sfa:ReceivingCountry>
<sfa:MessageType>FATCA</sfa:MessageType>
<sfa:MessageRefId>S519K4.99999.SL.276-2025-001</sfa:MessageRefId>
<sfa:MessageTypeIndic>FATCA1</sfa:MessageTypeIndic>
<sfa:ReportingPeriod>2025-12-31</sfa:ReportingPeriod>
</ftc:MessageSpec>
<ftc:FATCA>
<ftc:ReportingFI>
<sfa:ResCountryCode>DE</sfa:ResCountryCode>
<sfa:TIN issuedBy="US">S519K4.99999.SL.276</sfa:TIN>
<sfa:Name>Example Bank Ltd</sfa:Name>
<sfa:Address>
<iso:CountryCode>DE</iso:CountryCode>
<sfa:AddressFree>Hauptstrasse 1, 60311 Frankfurt</sfa:AddressFree>
</sfa:Address>
<ftc:DocSpec>
<sfa:DocTypeIndic>FATCA11</sfa:DocTypeIndic>
<sfa:DocRefId>S519K4.99999.SL.276-2025-FI</sfa:DocRefId>
</ftc:DocSpec>
</ftc:ReportingFI>
<ftc:ReportingGroup>
<ftc:AccountReport>
<ftc:DocSpec>
<sfa:DocTypeIndic>FATCA11</sfa:DocTypeIndic>
<sfa:DocRefId>S519K4.99999.SL.276-2025-A001</sfa:DocRefId>
</ftc:DocSpec>
<ftc:AccountNumber>CH9300762011623852957</ftc:AccountNumber>
<ftc:AccountHolder>
<ftc:Individual>
<sfa:TIN issuedBy="US">123456789</sfa:TIN>
<sfa:Name>
<sfa:FirstName>Maria</sfa:FirstName>
<sfa:LastName>Schmidt</sfa:LastName>
</sfa:Name>
<sfa:Address>
<iso:CountryCode>DE</iso:CountryCode>
<sfa:AddressFree>Hauptstrasse 1, 60311 Frankfurt</sfa:AddressFree>
</sfa:Address>
</ftc:Individual>
</ftc:AccountHolder>
<ftc:AccountBalance currCode="USD">250000</ftc:AccountBalance>
<ftc:Payment>
<ftc:Type>FATCA501</ftc:Type>
<ftc:PaymentAmnt currCode="USD">1200</ftc:PaymentAmnt>
</ftc:Payment>
</ftc:AccountReport>
</ftc:ReportingGroup>
</ftc:FATCA>
</ftc:FATCA_OECD>
Normalisations shown: U.S. TIN 123-45-6789 → 123456789; reporting year 2025 → ReportingPeriod 2025-12-31; DocRefIds prefixed with the GIIN; dividends mapped to FATCA501.
Validation checklist
- All required fields extracted; AI asked about any missing GIIN, U.S. TIN, account number, or balance (nothing invented)
-
MessageRefIdunique; everyDocRefIdglobally unique and GIIN-prefixed -
MessageTypeIndiccorrect (FATCA1 new vs FATCA2/3/4) andDocTypeIndicconsistent - Corrections set
CorrDocRefIdto the priorDocRefId -
ReportingPeriod=YYYY-12-31; country codes ISO-3166-2; currency ISO-4217 - U.S. TIN present (9 digits, no hyphens) or the documented missing-TIN handling applied
- Payment types/amounts reconcile to source; balances at period end
- XML validates against FATCA XML v2.0 XSD before IDES packaging (sign/compress/encrypt)
Last updated: 2026-06-13 — verify the active FATCA XML schema version, DocTypeIndic/MessageTypeIndic code lists, and IDES packaging requirements before use.