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)

FieldTypeRequiredValidationDescription
identbulstatYESminLength: 9, pattern: [0-9]{1,13}Identification number
identtypeidenttypeYES1=Bulstat, 2=PIN, 3=FPN/PN, 5=NRAType of ID

1a. Supplier is Carrier Flag (issr)

FieldTypeRequiredValidationDescription
issrbooleanYEStrue/falseFlag: Supplier is also carrier (Доставчикът е и превозвач)

2. Recipient/Buyer (cr/rowenum)

FieldTypeRequiredValidationDescription
cridentvinYESpattern: [A-Z0-9\+\*]{1,15}Recipient ID/VIN
cridenttypevintypeYES1,5,6,9ID type
crnamestringYESmaxLength: 200Name/Title
tidentvinNO-Third party ID
tidenttypevintypeNO-Third party ID type
tnamestringNOmaxLength: 200Third party name
countrycountryYESmaxLength: 2Destination country (ISO)

3. Goods (goods/rowenum)

FieldTypeRequiredValidationDescription
codestringYESmaxLength: 20CN commodity code
quantitytypeenumConditionalкг | м2 | брояUnit of measure
quantitynetdecimalYESfractionDigits: 3Net quantity
quantitygrossdecimalNOfractionDigits: 3Gross quantity
pricedecimalYESfractionDigits: 2Value in leva
purposeenumYES01-07Purpose code
purposeotherstringNOmaxLength: 1000Other purpose (required for purpose 02, 06, 07)

3a. Purpose Codes (purpose)

CodeDescriptionpurposeother Required
01Delivery of goods (доставка на стока)No
02Reclamation (рекламация на стока)Yes - include protocol number
03Donation (дарение на стока)No
04Processing (обработка на стоката)No
05Warehousing/call-off stock (режим складиране на стока до поискване)No
06Other (друго)Yes
07Transit with transloading (преминаване с претоварни операции)Yes - include UNP

4. Transport Organizer (organizer)

Optional section for person organizing the transport.

FieldTypeRequiredValidationDescription
reprperson (Physical Person)
ispersonbooleanYES*trueFlag for physical person
egnstringYES*length: 10Identification number
namestringYES*maxLength: 200Name
identtypenumericYES*2,3,5,6Type of ID (2=EGN, 3=LNCh, 5=NRA, 6=Other)
reprfirm (Legal Entity)
isfirmbooleanYES*trueFlag for legal entity
bulstatstringYES*maxLength: 15, VIN cannot start with BGIdentification number
namestringYES*maxLength: 200Name
identtypenumericYES*1,5,6,9Type 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.

FieldTypeRequiredValidationDescription
istranshipmentbooleanYEStrue/falseFlag for transhipment from other transport type
transporttypenumericYES*-Type of transport (water/rail/air)
transdatedateYES*Must be after NRA submissionTranshipment date
transtimetimeYES*HH:MM formatTranshipment time
transaddresscomplexYES*ekatte, street, numb, localaddressTranshipment address

* Required when istranshipment = true


6. Carrier at Transloading (transcarrier)

New carrier data when there is a carrier change during transloading.

FieldTypeRequiredValidationDescription
reprperson (Physical Person)
ispersonbooleanYES*trueFlag for physical person
egnstringYES*length: 10Identification number
namestringYES*maxLength: 200Name
identtypenumericYES*2,3,5,6Type of ID
reprfirm (Legal Entity)
isfirmbooleanYES*trueFlag for legal entity
bulstatstringYES*maxLength: 15Identification number
namestringYES*maxLength: 200Name
identtypenumericYES*1,5,6,9Type 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: