Complex Types and Validations
KEY VALIDATION RULES SUMMARY
Date/Time Validation:
receiveddate/receivedtime (delivery) 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 delivery date
- If transhipment:
transdate/transtime must be after NRA submission
Quantity Validation:
quantitynet must be > 0.00
quantitygross must be >= quantitynet
quantitytype: MANDATORY from 01.05.2025 for new goods codes (Order ZMF-237/31.03.2025)
Price Validation:
price is MANDATORY and must be > 0.00
- Currency: BGN until 31.12.2025, EUR from 01.01.2026
Address Validation:
- Either (
street AND numb) OR localaddress must be provided
ekatte is ALWAYS REQUIRED
Vehicle Registration:
regvehicle: Only uppercase Latin letters (A-Z) and digits (0-9), no spaces
- Maximum 15 characters
Conditional Requirements:
- If
istransfer = true: transferaddress, transferdate, transfertime, transcarrier become MANDATORY
- If
istranshipment = true: transporttype, transdate, transtime, transaddress become MANDATORY
Complex Types
1. Address Types (address / addressdetailed)
| Field |
Type |
Required |
Validation |
Description (EN) |
localaddress | string | Conditional* | maxLength: 100 | Full local address string |
street | string | Conditional* | maxLength: 100 | Street name |
numb | string | Conditional* | maxLength: 5 | Street number |
ekatte | string | YES | maxLength: 5, pattern: [0-9]{1,5} | EKATTE settlement code |
*Conditional Rule: Either (street AND numb) OR localaddress must be provided.
2. Recipient (recipient)
| Field |
Type |
Required |
Validation |
Description (EN) |
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 identification number |
3. Carrier (carrier / transcarrier)
Must provide EITHER reprperson OR reprfirm (not both)
reprperson (Physical Person):
| Field | Type | Required | Validation | Description |
isperson | boolean | YES | true | Flag - Individual person |
name | string | YES | maxLength: 200 | Name/Title |
egn | egn | YES | length: 10, pattern: [0-9]{10} | Identification number |
identtype | egntype | YES | 2=PIN, 3=FPN/PN, 5=NRA, 6=Other | ID type |
reprfirm (Legal Entity):
| Field | Type | Required | Validation | Description |
isfirm | boolean | YES | true | Flag - legal entity |
name | string | YES | maxLength: 200 | Name/Title |
bulstat | vin | YES | maxLength: 15, pattern: [A-Z0-9\+\*]{1,15} | Identification number |
identtype | vintype | YES | 1=Bulstat, 5=NRA, 6=Other, 9=VIN | ID type |
3a. Transport Organizer (organizer)
Optional section for person organizing the transport. Must provide EITHER reprperson OR reprfirm (not both)
reprperson (Physical Person):
| Field | Type | Required | Validation | Description |
isperson | boolean | YES* | true | Flag - Individual person |
egn | string | YES* | length: 10 | Identification number |
name | string | YES* | maxLength: 200 | Name |
identtype | numeric | YES* | 2=EGN, 3=LNCh, 5=NRA, 6=Other | ID type |
reprfirm (Legal Entity):
| Field | Type | Required | Validation | Description |
isfirm | boolean | YES* | true | Flag - legal entity |
bulstat | string | YES* | maxLength: 15, VIN cannot start with BG | Identification number |
name | string | YES* | maxLength: 200 | Name |
identtype | numeric | YES* | 1=EIK, 5=NRA, 6=Other, 9=VIN | ID type |
* Required only if organizer section is used
4. Sender/Supplier (cr/rowenum)
| Field | Type | Required | Validation | Description |
crident | vin | YES | pattern: [A-Z0-9\+\*]{1,15} | Sender/supplier ID/VIN |
cridenttype | vintype | YES | 1=Bulstat, 5=NRA, 6=Other, 9=VIN | ID type |
crname | string | YES | maxLength: 200 | Name/Title |
tident | vin | NO | pattern: [A-Z0-9\+\*]{1,15} | Third party ID (triangular) |
tidenttype | vintype | NO | 1=Bulstat, 5=NRA, 6=Other, 9=VIN | Third party ID type |
tname | string | NO | maxLength: 200 | Third party name |
country | country | YES | ISO 3166-1 alpha-2, 2 chars | Origin country (EU Member State excluding Bulgaria) |
5. Goods (goods/rowenum)
| Field | Type | Required | Validation | Description |
code | string | YES | maxLength: 20 | Combined Nomenclature commodity code |
quantitytype | enum | Conditional* | кг | м2 | броя | Unit of measurement |
quantitynet | decimal | YES | fractionDigits: 3, >0 | Net quantity |
quantitygross | decimal | NO | fractionDigits: 3, >=quantitynet | Gross quantity |
price | decimal | YES | fractionDigits: 2 | Value of goods in leva |
purpose | enum | YES | 01-07 | Purpose code |
purposeother | string | Conditional* | maxLength: 1000 | Other purpose description |
*quantitytype: MANDATORY from 01.05.2025 for goods with new codes (Order ZMF-237)
*purposeother: MANDATORY when purpose = 02 (reclamation) or 06 (other)
Purpose Codes:
| 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 |
6. Transhipment (transhipment)
| Field | Type | Required | Validation | Description |
istranshipment | boolean | YES (in block) | true/false | Transhipment flag |
transporttype | enum | Conditional* | 1=Water, 2=Railway, 3=Air | Transport type |
transdate | date | Conditional* | xs:date | Transhipment date |
transtime | string | Conditional* | maxLength: 5 (HH:MM) | Transhipment time |
transaddress | address | Conditional* | See address type | Transhipment address |
*Conditional: All fields MANDATORY if istranshipment = true
XML Example
<?xml version="1.0" encoding="WINDOWS-1251"?>
<decHfrImport>
<part1>
<recipient>
<ident>123456789</ident>
<identtype>1</identtype>
</recipient>
<regvehicle>CA1234AB</regvehicle>
<istransfer>false</istransfer>
<cr>
<rowenum>
<crident>DE123456789</crident>
<cridenttype>9</cridenttype>
<crname>German Supplier GmbH</crname>
<address>
<rowenum>
<receivedaddress>
<localaddress>Industrial Zone</localaddress>
<ekatte>68134</ekatte>
</receivedaddress>
<receiveddate>2026-01-20</receiveddate>
<goods>
<rowenum>
<code>GOODS123</code>
<quantitynet>100.000</quantitynet>
<price>2500.00</price>
<purpose>01</purpose>
</rowenum>
</goods>
</rowenum>
</address>
</rowenum>
</cr>
<cname>Ivan Petrov</cname>
<cphone>888123456</cphone>
<cphonecode>+359</cphonecode>
<cpemail>[email protected]</cpemail>
<dname>Maria Ivanova</dname>
<iscorrect>true</iscorrect>
</part1>
</decHfrImport>
Document Information:
- Schema Version: 5.0
- Schema File: decHfr_import_v5_restrict.xsd
- Encoding: WIND