ANBIMA XML (types 5 and 401)
Overview
QI DTVM 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.
Routine parameters
In the delivery through the fund's routine, the file is generated for the delivery's fund_class_key and reference_date. Two optional parameters can be configured in the routine by the integration team — they are not accepted in the on-demand download through the API:
| Parameter | Description |
|---|---|
type_fund_code_anbima | 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 | 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 | Type 5: FD{fund CNPJ, digits only}_{YYYYMMDD}.xml, the ANBIMA standard name (without a registered CNPJ, it falls back to the {short_fund_name}_xml_5_by_composition_{YYYY-MM-DD}.xml pattern, which is the one in the examples package). Type 401: {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
POST /composition/fund_class/{fund_class_key}/report, settingreport_typetoxml_5_by_compositionorxml_401_by_composition. The response returns the file in base64 in thedocument_b64field. Contract, profiles with access and errors in Download the Portfolio.
{
"composition_type": "final_quota",
"report_type": "xml_5_by_composition",
"reference_date": "2026-07-29"
}
The two XMLs are not generated for the pre_quota portfolio (response 404, CMP000026). The portfolio must be in confirmed, pending_confirmation or reproved_by_agent; in any other status, the response is 400 (CMP000015).
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.