Complex Types and Validations
KEY VALIDATION RULES SUMMARY
Date/Time Validation:
receiveddate/receivedtime (loading) must be after NRA submission time
receiveddate/receivedtime must be after transferdate/transfertime (if transloading applies)
receiveddate/receivedtime must be after transdate/transtime (if transhipment applies)
- If transfer:
transferdate/transfertime must be after NRA submission and before loading date
Supplier/Carrier Relationship:
- If
issr = true: Supplier is the carrier, carrier section not needed
- If
issr = false: carrier section should be provided
Country Code:
country is REQUIRED for each recipient - 2-letter ISO country code
- Must be an EU Member State (excluding Bulgaria)
Quantity Validation:
quantitynet must be > 0.00
quantitygross must be >= quantitynet
quantitytype: MANDATORY from 01.05.2025
Price Validation:
price is MANDATORY and must be > 0.00
- Currency: BGN until 31.12.2025, EUR from 01.01.2026
Complex Types
1. Supplier/Seller (recipient)
| Field | Type | Required | Validation | Description |
ident | bulstat | YES | minLength: 9, pattern: [0-9]{1,13} | Identification number |
identtype | identtype | YES | 1=Bulstat, 2=PIN, 3=FPN/PN, 5=NRA | Type of ID |
1a. Supplier is Carrier Flag (issr)
| Field | Type | Required | Validation | Description |
issr | boolean | YES | true/false | Flag: Supplier is also carrier (Доставчикът е и превозвач) |
2. Recipient/Buyer (cr/rowenum)
| Field | Type | Required | Validation | Description |
crident | vin | YES | pattern: [A-Z0-9\+\*]{1,15} | Recipient ID/VIN |
cridenttype | vintype | YES | 1,5,6,9 | ID type |
crname | string | YES | maxLength: 200 | Name/Title |
tident | vin | NO | - | Third party ID |
tidenttype | vintype | NO | - | Third party ID type |
tname | string | NO | maxLength: 200 | Third party name |
country | country | YES | maxLength: 2 | Destination country (ISO) |
3. Goods (goods/rowenum)
| Field | Type | Required | Validation | Description |
code | string | YES | maxLength: 20 | CN commodity code |
quantitytype | enum | Conditional | кг | м2 | броя | Unit of measure |
quantitynet | decimal | YES | fractionDigits: 3 | Net quantity |
quantitygross | decimal | NO | fractionDigits: 3 | Gross quantity |
price | decimal | YES | fractionDigits: 2 | Value in leva |
purpose | enum | YES | 01-07 | Purpose code |
purposeother | string | NO | maxLength: 1000 | Other purpose (required for purpose 02, 06, 07) |
3a. Purpose Codes (purpose)
| Code | Description | purposeother Required |
| 01 | Delivery of goods (доставка на стока) | No |
| 02 | Reclamation (рекламация на стока) | Yes - include protocol number |
| 03 | Donation (дарение на стока) | No |
| 04 | Processing (обработка на стоката) | No |
| 05 | Warehousing/call-off stock (режим складиране на стока до поискване) | No |
| 06 | Other (друго) | Yes |
| 07 | Transit with transloading (преминаване с претоварни операции) | Yes - include UNP |
4. Transport Organizer (organizer)
Optional section for person organizing the transport.
| Field | Type | Required | Validation | Description |
| reprperson (Physical Person) |
isperson | boolean | YES* | true | Flag for physical person |
egn | string | YES* | length: 10 | Identification number |
name | string | YES* | maxLength: 200 | Name |
identtype | numeric | YES* | 2,3,5,6 | Type of ID (2=EGN, 3=LNCh, 5=NRA, 6=Other) |
| reprfirm (Legal Entity) |
isfirm | boolean | YES* | true | Flag for legal entity |
bulstat | string | YES* | maxLength: 15, VIN cannot start with BG | Identification number |
name | string | YES* | maxLength: 200 | Name |
identtype | numeric | YES* | 1,5,6,9 | Type of ID (1=EIK, 5=NRA, 6=Other, 9=VIN) |
* Required only if organizer section is used
5. Transhipment (transhipment)
For transloading from water, rail, or air transport.
| Field | Type | Required | Validation | Description |
istranshipment | boolean | YES | true/false | Flag for transhipment from other transport type |
transporttype | numeric | YES* | - | Type of transport (water/rail/air) |
transdate | date | YES* | Must be after NRA submission | Transhipment date |
transtime | time | YES* | HH:MM format | Transhipment time |
transaddress | complex | YES* | ekatte, street, numb, localaddress | Transhipment address |
* Required when istranshipment = true
6. Carrier at Transloading (transcarrier)
New carrier data when there is a carrier change during transloading.
| Field | Type | Required | Validation | Description |
| reprperson (Physical Person) |
isperson | boolean | YES* | true | Flag for physical person |
egn | string | YES* | length: 10 | Identification number |
name | string | YES* | maxLength: 200 | Name |
identtype | numeric | YES* | 2,3,5,6 | Type of ID |
| reprfirm (Legal Entity) |
isfirm | boolean | YES* | true | Flag for legal entity |
bulstat | string | YES* | maxLength: 15 | Identification number |
name | string | YES* | maxLength: 200 | Name |
identtype | numeric | YES* | 1,5,6,9 | Type of ID |
* Required when transcarrier section is used
XML Example
<?xml version="1.0" encoding="WINDOWS-1251"?>
<decHfrExport>
<part1>
<recipient>
<ident>123456789</ident>
<identtype>1</identtype>
</recipient>
<issr>true</issr>
<regvehicle>CA1234AB</regvehicle>
<istransfer>false</istransfer>
<receivedaddress>
<localaddress>Industrial Zone</localaddress>
<ekatte>68134</ekatte>
</receivedaddress>
<receiveddate>2026-01-20</receiveddate>
<cr>
<rowenum>
<crident>DE123456789</crident>
<cridenttype>9</cridenttype>
<crname>German Buyer GmbH</crname>
<country>DE</country>
<goods>
<rowenum>
<code>GOODS123</code>
<quantitynet>100.000</quantitynet>
<price>2500.00</price>
<purpose>01</purpose>
</rowenum>
</goods>
</rowenum>
</cr>
<cname>Ivan Petrov</cname>
<cphone>888123456</cphone>
<cphonecode>+359</cphonecode>
<cpemail>[email protected]</cpemail>
<dname>Maria Ivanova</dname>
<iscorrect>true</iscorrect>
</part1>
</decHfrExport>
Document Information:
- Schema Version: 5.0
- Schema File: decHfr_export_v5_restrict.xsd
- Encoding: WIND