Complex Types and Validations
KEY VALIDATION RULES SUMMARY
Customs Information:
customsoffice: Must be valid customs office code from nomenclature (e.g., BG001000)
document: Single Administrative Document (SAD) number, max 20 characters
customslocation: Must be valid customs location code
Date/Time Validation:
customsdate/customstime: Date/time of transport continuation after customs release - must be after NRA submission time
receiveddate/receivedtime: Must be after customsdate/customstime
- If transfer:
transferdate/transfertime must be after NRA submission and between customs and received times
- If transhipment:
transdate/transtime must be after NRA submission
Purpose Codes (LIMITED):
- Only
01, 06, 07 are allowed for third country transport
- Codes 02-05 are NOT valid for this declaration type
Recipient Identification:
- Uses
identtype (Bulgarian ID types only): 1, 2, 3, 5
- Does NOT use vintype (no foreign IDs for recipients)
Complex Types
1. Importer (shipper)
| Field | Type | Required | Validation | Description |
ident | bulstat | YES | minLength: 9 | Identification number |
identtype | identtype | YES | 1,2,3,5 | Type of ID |
2. Customs Information (customs)
| Field | Type | Required | Validation | Description |
customsoffice | string | YES | maxLength: 8 | Customs authority - select from nomenclature |
document | string | YES | maxLength: 20 | Single Administrative Document (import customs declaration) |
3. Recipient (cr/rowenum)
Note: Uses identtype (Bulgarian), not vintype.
| Field | Type | Required | Validation | Description |
crident | bulstat | YES | pattern: [0-9]{1,13} | Identification number |
cridenttype | identtype | YES | 1,2,3,5 | ID type (Bulgarian only) |
crname | string | YES | maxLength: 200 | Name/Title |
4. 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, 06, 07 ONLY | Purpose code (LIMITED) |
purposeother | string | Conditional* | maxLength: 1000 | Other purpose description (required for 06, 07) |
5. 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 for physical 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 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=EIK, 5=NRA, 6=Other, 9=VIN | ID type |
* Required only if organizer section is used
Purpose Codes for Third Country
| Code | Bulgarian | English | purposeother Required |
| 01 | доставка на стока | Delivery of goods | No |
| 06 | друго | Other | Yes |
| 07 | преминаване с претоварни операции | Transit with transshipment operations | Yes - include UNP |
Note: Codes 02, 03, 04, 05 are NOT available for third country transport.
XML Example
<?xml version="1.0" encoding="WINDOWS-1251"?>
<decHfrThirdcountry>
<part1>
<shipper>
<ident>123456789</ident>
<identtype>1</identtype>
</shipper>
<customs>
<customsoffice>BG001000</customsoffice>
<document>26BG123456789012</document>
</customs>
<customsdate>2026-01-20</customsdate>
<customstime>10:00</customstime>
<customslocation>BG001015</customslocation>
<regvehicle>CA1234AB</regvehicle>
<istransfer>false</istransfer>
<cr>
<rowenum>
<crident>987654321</crident>
<cridenttype>1</cridenttype>
<crname>Bulgarian Recipient EOOD</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>
</decHfrThirdcountry>
Document Information:
- Schema Version: 5.0
- Schema File: decHfr_thirdcountry_v5_restrict.xsd
- Encoding: WINDOWS-1251
- Purpose: