What are DIR3 codes?
DIR3 codes are three codes that must be included in the electronic invoice when it is to be sent to the Spanish public administration, and which are used to direct the invoice to the corresponding department so that it can be processed correctly.
These codes are called Managing Body, Processing Unit and Accounting Office, and each recipient may have one or several combinations of different codes. In addition, they are mandatory data to be able to send an electronic invoice to the Spanish Public Administration. These codes are composed of one or two initial letters, plus seven or eight numbers. For example, LA1111111.
How to obtain DIR3 codes
Section titled “How to obtain DIR3 codes”Each public entity has its own DIR3, so your customer must provide you with this information when you send them an invoice. There is also an alternative, the B2Brouter directory, where you will find all the DIR3 related to a public entity.
In the directory, each organizational unit is identified by its three codes, not by its name. The name the directory publishes may differ from the name your customer gave you: compare the codes. Often all the units of an entity share the Accounting Office and the Managing Body, and the code that tells them apart is the Processing Unit.
Where the DIR3 fields are on the contact
Section titled “Where the DIR3 fields are on the contact”The contact only shows the routing codes of the sending method you have selected, under Invoice sending method:
- With FACe, eFACT or another public administration entry point, you see the DIR3 fields.
- With FACeB2B, you only see the DIRe code, because that channel does not use DIR3 codes.
If you cannot find the DIR3 fields, check the contact’s sending method. The format of the code tells you which is which: a DIR3 code has one or two letters and seven or eight digits, and a DIRe code has 15 characters and starts with the recipient’s tax number.
How to add DIR3 codes to the electronic invoice
Section titled “How to add DIR3 codes to the electronic invoice”You need to create a new invoice to be able to add DIR3’s. To do this, access the Invoices section through the main top menu and then select Invoices issued from the options that are activated in the left menu. Next, use the option at the top right New Invoice. Next:
- From the Customer drop-down select the invoice recipient.
- If the selected receiver is in the B2Brouter directory, the option Organizational unit will be activated.
- Select the DIR3 codes in the Organizational Unit dropdown.
Finally, continue with the creation of the invoice and the DIR3 codes will already be present.
If the Organizational Unit is not activated, or the unit you need is not listed
Section titled “If the Organizational Unit is not activated, or the unit you need is not listed”If the Organizational Unit drop-down is not activated, the customer you selected or its DIR3 codes are not in the B2Brouter directory. If it is activated but the unit your customer indicated is not listed, the directory does not publish that combination of codes.
In both cases you can still issue the invoice. The codes that count are the ones the receiving body gave you, and the invoice accepts them even if the directory does not have them. You have two options:
Add DIR3 codes manually
Section titled “Add DIR3 codes manually”Once you have selected the receiver and you have started to create the invoice, in the General data section you find the options Managing body, Processing unit and Accounting office, where you have to add the DIR3 codes provided by the customer.
Create and assign the organizational units to the client
Section titled “Create and assign the organizational units to the client”To avoid having to add DIR3 codes to invoices every time you generate an invoice, you can also create the organizational units assigned to each receiver. To do this, access the Contacts section via the main menu at the top and open the company by clicking on the name.
On the next page, select Add organizational unit.
If the contact is linked to the directory, you first see the list of directory units you have not added yet. If the unit you need is not there, use the link Organisational unit is not on the list? to create it yourself with the codes your customer gave you. You do not need to unlink the contact from the directory: it stays verified.
Next, you can add the data to the Organizational Unit with the corresponding DIR3 codes:
- In Fiscal data put the name and address. They can be the same as those of the main company.
- Fill in the other options you want/need.
- Access at the bottom to Delivery method.
- Add the DIR3 codes in the Accounting Office, Managing Body and Processing Unit options.
Finally, save the changes using the Save option and repeat the process to create as many organizational units as you need for each client.
From then on, the unit you created appears in the invoice’s Organizational Unit drop-down, with its codes, just like the directory ones.
If FACe rejects the invoice because of the DIR3 codes
Section titled “If FACe rejects the invoice because of the DIR3 codes”B2Brouter sends the codes as you saved them, and FACe is the one that checks them. When FACe rejects them, the invoice is left in error state and has not entered FACe, so you can correct it and send it again without issuing any corrective invoice. The most common messages:
- «No existe o inactiva la Oficina Contable asociado al código “%OC%”» (error code 411). FACe recognised no valid Accounting Office code. The text
%OC%is not a value from your invoice: it is what FACe writes in place of the code. It happens when the invoice was sent without codes, for example because the contact had none and the directory entry publishes no codes on the main entity, only on its units. Select the organizational unit on the invoice, or add the codes to the invoice or to the contact, and send again. If the invoice already carried codes, check them: each DIR3 code has 9 characters, and an incomplete code also gives this error. If the public body receives invoices through another entry point (for example, eFACT Catalonia for Catalan administrations, or Osakidetza), do not send it through FACe again: change the contact’s Invoice sending method to that entry point and send the invoice again. - «La Unidad Tramitadora, Órgano Gestor u Oficina contable especificados no están relacionados» (error code 412). The three codes arrived, but they are not a valid combination for that recipient: usually codes from two different units were mixed, or the combination is no longer in force. Compare the three codes with the directory unit’s or with the ones your customer gave you, correct them and send again.
- «No existe o inactiva el Órgano Gestor asociado al código …» (error code 409). The code shown does not exist or is inactive at FACe. Ask your customer for the current code.
If the codes are the ones your customer gave you and FACe keeps rejecting them, only the receiving body can confirm which combination the invoice needs.