HFRGBULGARIA - Flat XML Import Template

<?xml version="1.0" encoding="utf-8"?> <!-- NRA HFRG - Flat XML Import Format (Bulgaria) Transport declarations only. Annul (11) and Confirm (12) use their own root elements (see flat-import-annul.xml / flat-import-confirm.xml). OperationType values: 9 = Import 10 = Export 13 = Internal Transport 14 = Third Country Fill only the fields relevant to the chosen OperationType. Empty elements can be omitted. IMPORTANT - address codes: Every *Ekatte element expects a 4-digit POSTAL CODE, not an EKATTE code. The hub converts it to EKATTE using wwwroot/data/postal-to-ekatte.json. An unrecognized value is left blank on purpose, so the declaration fails validation instead of being submitted with a wrong EKATTE. Example: 1000 (postal code for Sofia) -> 68134 (EKATTE). --> <HFRGBULGARIA> <!-- System header --> <Header> <!-- Version, FiscalRegNo and TransportDate are accepted but ignored by the hub. --> <Version>1</Version> <FiscalRegNo>123456789</FiscalRegNo> <TransportDate>2025-04-15T08:00:00</TransportDate> <!-- Required. Selects the declaration type. --> <OperationType>9</OperationType> <!-- Reference from the source system. Becomes the job folder name and is echoed back in the result file (see flat-import-result.xml). When empty, a GUID is used instead and the result cannot be matched back. --> <InternalReference>76767879879809</InternalReference> <!-- Only when correcting an already submitted declaration. Leave empty otherwise. --> <UIN></UIN> <!-- Taxpayer: the firm or person the declaration is submitted for (NRA "taxpayerPin"). NOT READ BY THE HUB YET. Today the taxpayer always comes from Settings > NRA (CompanyId / CompanyIdType). Once the hub supports these elements, a value supplied here will take precedence for this file. TaxpayerIdentType accepts the identifier type name (or its number): IND_EGN (1) - EGN IND_LNCH (2) - LNCH IND_SLNO (3) - NRA service number IND_BULSTAT (4) - personal Bulstat BUS_BULSTAT (5) - company Bulstat --> <TaxpayerIdent>123456789</TaxpayerIdent> <TaxpayerIdentType>BUS_BULSTAT</TaxpayerIdentType> </Header> <!-- Recipient: used by Import (9), Export (10) --> <RecipientIdent>123456789</RecipientIdent> <RecipientIdentType>1</RecipientIdentType> <!-- 1=Bulstat, 2=PIN, 3=FPN, 5=NRA --> <!-- Shipper: used by Internal (13), ThirdCountry (14) --> <ShipperIdent>123456789</ShipperIdent> <ShipperIdentType>1</ShipperIdentType> <!-- Export-specific (10): is supplier also carrier? --> <IsSr>false</IsSr> <!-- Customs: used by ThirdCountry (14) --> <CustomsOffice>BG001000</CustomsOffice> <CustomsDocument>25BG000012345678</CustomsDocument> <CustomsDate>2025-04-14</CustomsDate> <CustomsTime>09:00</CustomsTime> <CustomsLocation>BG001000</CustomsLocation> <!-- Carrier. The block is ignored unless HasCarrier is true AND CarrierIdent is non-empty. --> <HasCarrier>true</HasCarrier> <CarrierIsPerson>false</CarrierIsPerson> <CarrierName>Transport Ltd</CarrierName> <CarrierIdent>987654321</CarrierIdent> <CarrierIdentType>1</CarrierIdentType> <!-- Person: 2=PIN,3=FPN,5=NRA,6=Other; Firm: 1=Bulstat,5=NRA,6=Other,9=VIN --> <!-- Organizer. Ignored unless HasOrganizer is true AND OrganizerIdent is non-empty. --> <HasOrganizer>false</HasOrganizer> <OrganizerIsPerson>false</OrganizerIsPerson> <OrganizerName></OrganizerName> <OrganizerIdent></OrganizerIdent> <OrganizerIdentType>1</OrganizerIdentType> <!-- Vehicle --> <RegVehicle>CA1234AB</RegVehicle> <RegTrailer1>CB5678CD</RegTrailer1> <RegTrailer2></RegTrailer2> <!-- Loading address: used by Export (10), Internal (13) --> <LoadLocalAddress>Sofia</LoadLocalAddress> <LoadStreet>ul. Maritza</LoadStreet> <LoadNumber>55</LoadNumber> <LoadEkatte>1000</LoadEkatte> <!-- postal code --> <LoadDate>2025-04-15</LoadDate> <LoadTime>08:00</LoadTime> <!-- Transhipment: Import (9), Export (10), Internal (13). Not available for ThirdCountry (14). The whole block is ignored unless IsTranshipment is true. --> <IsTranshipment>false</IsTranshipment> <TranshipmentTransportType>1</TranshipmentTransportType> <!-- 1=Water, 2=Railway, 3=Air --> <TranshipmentDate>2025-04-15</TranshipmentDate> <TranshipmentTime>10:00</TranshipmentTime> <TranshipmentLocalAddress>Sofia</TranshipmentLocalAddress> <TranshipmentStreet>bul. Tsarigradsko shose</TranshipmentStreet> <TranshipmentNumber>100</TranshipmentNumber> <TranshipmentEkatte>1000</TranshipmentEkatte> <!-- postal code --> <!-- Transfer: all four transport types. The whole block is ignored unless IsTransfer is true. --> <IsTransfer>false</IsTransfer> <TransferLocalAddress></TransferLocalAddress> <TransferStreet></TransferStreet> <TransferNumber></TransferNumber> <TransferEkatte></TransferEkatte> <!-- postal code --> <TransferDate></TransferDate> <TransferTime></TransferTime> <TransCarrierIsPerson>false</TransCarrierIsPerson> <TransCarrierName></TransCarrierName> <TransCarrierIdent></TransCarrierIdent> <!-- transfer carrier is skipped when this is empty --> <TransCarrierIdentType>1</TransCarrierIdentType> <TransRegVehicle></TransRegVehicle> <TransRegTrailer1></TransRegTrailer1> <TransRegTrailer2></TransRegTrailer2> <!-- Counterparties: used by Import (9), Internal (13), ThirdCountry (14). These types have no Country element - Country exists only under Buyer (Export). --> <Counterparties> <Counterparty> <Ident>987654321</Ident> <IdentType>1</IdentType> <!-- 1=Bulstat, 5=NRA, 6=Other, 9=VIN --> <Name>Mueller GmbH</Name> <TIdent></TIdent> <TIdentType></TIdentType> <TName></TName> <Addresses> <Address> <LocalAddress>Sofia</LocalAddress> <Street>ul. Vitosha</Street> <Number>10</Number> <Ekatte>1000</Ekatte> <!-- postal code --> <ReceivedDate>2025-04-15</ReceivedDate> <ReceivedTime>14:00</ReceivedTime> <Goods> <Good> <Code>31024010</Code> <QuantityType>kg</QuantityType> <!-- kg, m2, pcs; empty defaults to kg --> <QuantityNet>1000.000</QuantityNet> <QuantityGross>1050.000</QuantityGross> <Price>5000.00</Price> <Purpose>01</Purpose> <!-- Import: 01-07; Internal: 01,02,03,04,06; ThirdCountry: 01,06,07 --> <PurposeOther></PurposeOther> <!-- only when Purpose is 06 --> </Good> <Good> <Code>31024012</Code> <QuantityType>kg</QuantityType> <QuantityNet>1000.000</QuantityNet> <QuantityGross>1050.000</QuantityGross> <Price>5000.00</Price> <Purpose>01</Purpose> <PurposeOther></PurposeOther> </Good> </Goods> </Address> </Addresses> </Counterparty> </Counterparties> <!-- Buyers: used by Export (10) - simpler structure, no addresses --> <Buyers> <Buyer> <Ident>111222333</Ident> <IdentType>1</IdentType> <!-- 1=Bulstat, 5=NRA, 6=Other, 9=VIN --> <Name>Fischer AG</Name> <TIdent></TIdent> <TIdentType></TIdentType> <TName></TName> <Country>DE</Country> <!-- required; 2-letter ISO country code --> <Goods> <Good> <Code>31024010</Code> <QuantityType>kg</QuantityType> <QuantityNet>2000.000</QuantityNet> <QuantityGross>2100.000</QuantityGross> <Price>10000.00</Price> <Purpose>01</Purpose> <!-- Export: 01-07 --> <PurposeOther></PurposeOther> </Good> <Good> <Code>31024011</Code> <QuantityType>kg</QuantityType> <QuantityNet>2000.000</QuantityNet> <QuantityGross>2100.000</QuantityGross> <Price>10000.00</Price> <Purpose>01</Purpose> <PurposeOther></PurposeOther> </Good> </Goods> </Buyer> </Buyers> <ContactName></ContactName> <ContactPhoneCode></ContactPhoneCode> <ContactPhone></ContactPhone> <ContactEmail></ContactEmail> <DeclarantName></DeclarantName> </HFRGBULGARIA>