ANBIMA XML (types 5 and 401)
Overview
QI CTVM generates the portfolio position files in the ANBIMA standard from the fund's portfolio composition. There are two models, delivered as independent files:
| Model | Standard | Description |
|---|---|---|
xml_5_by_composition | ANBIMA 5.0 Position File (ISO 20022, semt.003.001.04) | Portfolio position in an ISO 20022 structure, with the identification of the administrator, manager and custodian, position by asset, payables and receivables. |
xml_401_by_composition | ANBIMA 4.01 Position File | Portfolio position in the 4.01 layout, with the fund header and blocks by asset class. |
When people talk about the ANBIMA XML in everyday work, the file in question is the xml_5_by_composition — version 5.0 of the position file. The xml_401_by_composition is the previous version of the same standard, still required by some consumers.
What you need to provide
| Variable | Required | Description |
|---|---|---|
fund_class_key | yes | Identifier of the fund class the file is generated for. |
reference_date | yes | Reference date of the position, in the YYYY-MM-DD format. |
type_fund_code_anbima | no | Code of the fund type in the ANBIMA table. When omitted, it is derived from the fund registration. A code outside the list of valid ones makes the generation fail. |
issuance_serie_key | no (XML 401 only) | Restricts the file to a single issuance series. Without it, all the series of the class enter the file. |
File Structure
| Attribute | Value |
|---|---|
| Format | XML |
| Encoding | UTF-8 |
| Naming | {short_fund_name}_xml_5_by_composition_{YYYY-MM-DD}.xml and {short_fund_name}_xml_401_by_composition_{YYYY-MM-DD}.xml |
Both files are generated from a portfolio composition already closed on the reference date — confirmed or awaiting confirmation. Before assembling the file, the service reconciles the position: the sum of the assets, plus the receivables, minus the payables, must reconcile with the net worth reported by the issuance series. When it does not reconcile, the file is not generated.
How to receive them
There are two ways, which can be used together:
- In the fund's delivery routine, along with the other reports — see how the reports are delivered. Just ask the integration team to include the
xml_5_by_compositionand/orxml_401_by_compositionmodels in the delivery configuration. - On demand, through the API, with the composition report download route:
{
"composition_type": "final_quota",
"report_type": "xml_5_by_composition",
"reference_date": "2026-07-29"
}
The response returns the file in base64, in the document_b64 field. The portfolio must be in the confirmed status for the download to be possible. Details in Portfolio - Download the Portfolio.
Content of the type 5 file
The file has the PosicaoAtivosCarteira root element and is divided into two parts:
AppHdr— message header: sending administrator (name and CNPJ), recipient fund, message identifier, layout version (semt.003.001.04), service (Arquivo de Posicao 5.0) and generation date/time.Document / SctiesBalAcctgRpt— body of the position:
| Element | Content |
|---|---|
Pgntn | Pagination of the file. |
StmtGnlDtls | General data of the statement: composition date, frequency and update type. |
AcctOwnr | CNPJ of the administrator (account owner). |
AcctSvcr | CNPJ of the manager. |
SfkpgAcct | CNPJ and name of the custodian. |
BalForAcct | Fund class and issuance series, with ISIN, number of quotas, quota value, total value of the assets, and the breakdown of payables (PAYA) and receivables (RECE). |
SubAcctDtls | One entry per asset of the portfolio: public securities, private securities, debentures, fund quotas, credit rights, swaps, real estate and cash accounts. |
AcctBaseCcyTtlAmts | Total net worth of the fund. |
The payables are classified with the ISO codes corresponding to the nature of the expense — ADMF (administration fee), MANF (management), PERF (performance), CETI (CETIP), REGF (CVM), ANBI (ANBIMA), AUDT (audit), SELC (SELIC), CUST (custody), LEGA (services) — or OTHR for the others.
Content of the type 401 file
The file has the arquivoposicao_4_01 root element, with a fundo element that brings together:
| Block | Content |
|---|---|
header | ISIN, CNPJ and name of the fund, position date, administrator, manager and custodian, quota value and number of quotas, net worth, value of the assets, receivables and payables, ANBIMA fund type. |
titpublico | One block per public security, with the SELIC code, dates, quantities, unit prices, index and financial value. |
titprivado | One block per private security that is not a debenture. |
debenture | One block per debenture. |
swap | One block per swap contract, with asset and liability values. |
cotas | One block per invested fund quota, with ISIN, CNPJ of the fund, quantity and unit price. |
caixa | Balance of the cash accounts. |
despesas | Administration and performance fees of the fund. |
outrasdespesas | Other provisioned expenses. |
provisao | Provisions established, with date and value. |
fidc | Total financial value of the credit rights of the portfolio. |
Blocks without a position on the date are not included in the file.