Getting Started

Getting Started

Goals

Your main goal is to enable full or partial integration with MER for the end users following operations via your ERP system and implementing all legal requirement for Fiscalization 2.0 :

 

  1. Send documents, properly formatted and wrapped in XML with enabled attachments
  2. Receive documents (importing data from XML document)
  3. Monitor statuses of fiscalization of sent invoices and other non-financial documents
  4. Enable resend and cancel actions with outgoing and reject action on incoming eInvoices
  5. Send information regarding received payment of your outgoing eInvoices

 

 

What are the general steps for successful integration with MER?

  1. Get the XML specification for generating eInvoice and eCreditNote formats from the Download section. Specifications are available in Croatian (Specifikacija osnovne uporabe eRačuna s proširenjima) and English (Specification of the usecase of eInvoice with HR extensions)
  2. Download and check the examples in Download section (Examples of eInvoice XML files)
  3. Check if you can use XSD shemas for generating XML files (available in Download section)
  4. Test your XML examples on a UBL validator (https://manual.moj-eracun.hr/documentation/ubl-validation/ ‎). After all XML examples are been created in your ERP, ensure that you insert a test email of the customers whom you want to send test eInvoices. The system sends e-mail notification so be mindfull of that.
  5. Register on MER test environment and get user credentials for testing purposes. Procedure is described in a this section https://manual.moj-eracun.hr/documentation/demo-environment/.
  6. Check the listo of APIs available for implementation into your ERP system. Specification is listed on our site https://manual.moj-eracun.hr/documentation/api-specification/. Ensure that you read responses from MER system as well as do a propper error hendling of most of responses that you can receive.
  7. Connect all invoice scenarios that users need with available API methods and scenarios based on responses from exchange of the documents.
  8. Test the connection and send XML files on MER platform. In case you get an error that customer is not registered (check the responses on a link https://manual.moj-eracun.hr/documentation/api-specification/error-codes/), please try to send document to another company or contact us via mail to register a new organization so you can send them test documents.
  9. After testing phase is done, contact us via mail integracije@moj-eracun.hr with the information about your company as ERP integrator. Requered data is company OIB/VAT number, name of the company and name of your ERP solution. Upon receiving said information, we will register your solution and provide you with your unique  production SoftwareID. For commercial SaaS sollution this is used to track and distinguish your customer on top of enagling simpler logging of errors.
  10. Update the endpoints for the production MER system and deliver your the solution to the end users so they can start to send electronic documents.

Step-by-step detailed description of the integration process

 

Building XML structure of the eInvoice and eCreditNote

In order to build XML’s properly, make sure to donload the Specification for usecase of the eInvoice (english or croatian version). All specification can be found in the Download section of the site.  As you go through the specification. you will find definitions of each existing tag, nodes and business rules that have to be followed accoiringly.

On top of this, to make the generation of XML as smooth as possible, XSD scheme was provided as a machine readable format of the expected structure.

For filling XML, use values that are described for every field

——————-

Example

BT-1.  InvoiceNumber

Description: Unique identification account

Cardinality: 1..1 (meaning field has to be created and used only once)

In XML structure, it looks like:

<Invoice>

….

<cbc:CustomizationID>>urn:cen.eu:en16931:2017#compliant#urn:mfin.gov.hr:cius-2025:1.0#conformant#urn:mfin.gov.hr:ext-2025:1.0</cbc:CustomizationID>
<cbc:ProfileID>P9</cbc:ProfileID>
<cbc:ID>2152/HQX/1-12</cbc:ID>
<cbc:IssueDate>2023-01-01</cbc:IssueDate>
<cbc:IssueTime>11:52:00</cbc:IssueTime>

</Invoice>

——————-

When building XML structure of the, you will need to follow specification strictly and the order of the fields and nodes (Parent and child hierarchy).

 

 

Validating XML structure of eInvoice and eCreditNote

Some XML fields and nodes have business rules that need to be met to be valid.

In the specification, there is a list of business rule list marked BR-XYZ or HR-BR-XYZ with the concrete description of business rule with exact description of the error.

——————-

Example

BR-2. The Invoice must have an Invoice number (BT-1).

HR-BR-1 The account number must not contain whitespace characters

Correct value should be:

<cbc:ID>23/1/1</cbc:ID>

——————-

From the January 1st 2026 all XMLs of eInvoice and eCreditNotes sent to MER will be validated synchronously when you send request on API methods Send or eReporting and the response will be list of errors in case document is not valid.

 

 

Implementation of APIs

For integrating APIs, first you need to understand the process of the communication between ERP system, MER and other participants in the exchange of the electronic documents.

 

Sending electronic documents to MER

To be able to send document to MER for Fiscalization, first of all, you will need to implement API method SEND which is a standard method for sending electronic document to MER which will be sent to Fiscalization.

Send method process documents asynchronously.

In the same moment you send document to MER, there are two things MER will check before giving you response:

  1. If the XML is valid using UBL validator
  2. If the customer is registered into AMS of the Tax Authority System

Response from this API can be one of three options: (UPDATE 2025-09-24)

  1. success (status code 200) with parametar ElectronicID
  2. error (status code 200) with error message and description (check the list of error code for APIs on our site https://manual.moj-eracun.hr/documentation/api-specification/error-codes/)
  3. customer not registered in AMS (status code 400)

In case a document is successfuly sent, you will get a response with an ElectronicID value which you need to store in your system as a unique identifier of the sent electronic document in MER system. With that value, you will be able to pull the status of the fiscalization of the document sent to MER.

Otherwise, if you get an error while trying to send document to MER via Send method, MER will give a description of the error and it won’t process the document any further.  Based on the error message, you should present the information in your end user with the information that the attempt of sending the document to MER failed.

The most common error categories are:

  • User credentials are not correct
    • User needs to check user credentials and update them in ERP system if needed. After updating user credentials, allow them to resubmit electronic document.
  • XML UBL validation error
    • Check whether the user entered incorrect information while creating the XML or the issue is in the structure of the XML
  • Customer is not registered in MER system or in a AMS of the Tax Authority System –
    • Check with the customer if and when they will register to MER/AMS. When customer registers to receive electronic documents via MER/AMS, allow user to resubmit electronic document
  • Encoding of the XML is not correct or some ASCII code of the character is not JSON escaped properly for MER server to be processed
      • User need to check if they entered character that is not allowed. After updating data inside the invoice, allow them to resubmit electronic document.
  • Issues with attachements
    • These errors ususally occur due to incorrec base64 conversion or incorrecr mimecode attributes. After updating data inside the XML, allow resubmission of the electronic document.

 

NOTE: if the XML is correct but customer is not registered in AMS of the Tax Authority system from 1.1.2026., you will need to implement an option to send document to the eReporting system via API eReporting. Until 1.1.2026. eReporting system shouldn’t be used on production, but only on our test environment.

The Fiscalization law has proposed that user whose document couldn’t be fiscalized, need to send it to eReporting system to inform Tax Authority that the invoice was issued but couldn’t be fiscalized. That is a backup option in case fiscalization fails.

Sending to eReporting API will be syncrously sent to eReporting system of the Tax Authority system so you will get the status of the sent document to eReporting system.

Types of responses:

  • Success
    • User can deliver document in any form to the customer (papier via post office, PDF inside e-mail attachment, directly to the customer via MER system)
    • Implement an option to check the status of the sent document to eReporting system
  • Error
    • Process the error message, check the data inside XML and give a user an option to resubmit document to eReporting system via API eReporting

 

Retrieving statuses of the sent document to the customer / Tax Authority / eReporting via MER

To track if electronic documentshave reached customers access point, whether they have beed successfully fiscalized, or in case the document has been sent to an eReporting channel, to track what the status of eReporting is, you need to implement APIs that allow you to track statuses of documents.

There will be 3 types of statuses in use: (UPDATE 2025-09-24)

  • Basic MER status – describes if the document in MER system has been processed and delivered to the customer / other Access points / Tax Authority. Possible options:
    • 20 (In process/ U obradi)- in process for digitaly signing XML, generating PDF of the invoice in case XML doesn’t have one, checking weather we are able to send document to other Access point
    • 30 (Sent / Poslan) – succesfully processed document, fiscalized and sent to the MER customer who needs to download document via MER platform
    • 40 (Delivered / Preuzet) – document has been successfuly downloaded via MER or it was sent to the customer who is user of another Access point. This is a final basic MER status.
    • 45 (Canceled/ Povućeno preuzimanje) – user has canceled sending document to the customer. Customer won’t be able to download document. This is also a final basic MER status.
    • 50 (Unsucessful / Neuspjelo)- document has failed to be delivered to the customer, another Access point or to the Tax Authority system. Status Unsucessful defines that sender needs to do action towards delivering document to the customer (resending e-mail notification, fixing XML structure or send document to eReporting,etc).

 

  •  Document business status – Document process status is used to update the status of the received incoming invoice. Document business statuses are not mandatory to exchange between Access points.
    • 0 (Approved / Prihvaćeno) – Document is successfully approved by the recipient
    • 1 (Rejected / Odbijeno) – Document is rejected by the recipient
    • 2 ( Payment_fulfilled / Plaćeno u potpunosti) – Document is fully paid
    • 3 (Payment_partially_fullfilled / Djelomično plaćeno) – Document is partially paid
    • 4 (Receiving_confirmed / Potvrda zaprimanja) – Document successfully downloaded by the recipient. Can’t be modified via API. Main reason why this isn’t possible is that changes in these statuses must be monitored by the service provider.
    • 99 (Received / Zaprimljen) – Document received in the inbox of the recipient (e.g. FINA service). Can’t be modified via API. Main reason why this isn’t possible is that changes in these statuses must be monitored by the service provider

 

  • Fiscalization / eReporting status – Status if registering electonic document to the Tax Authority systems has been successful (UPDATE 2025-09-24)
    • isSuccess: True
    • isSuccess: False

 

Basic MER statuses will be always linked to the sending of the electronic document via MER but document business statuses and fiscalization statuses can miss out in certain scenarios so integration of multiple APIs can give you whole picture of the exchange of the electronic documents.

APIs for checking statuses of the sent document:

  1. QueryOutbox gives you the basic MER statuses.
  2. QueryDocumentProcessStatusOutbox give su business document statuses of the send document. They can be linked to the sent invoice but they are not mandatory to be used or filled.
  3. Fiscalization/Status gives you the status of fiscalization of the sent document.

 

Possible combination of the statuses for a sent electronic document: (UPDATE 2025-09-24)

NOTE: character (->) in cases bellow indicates status change.

Case 1. MER sender, MER customer, fiscalization is successful, document is not rejected

  • Basic MER status 20 -> 30 -> 40
  • Business status 99 -> 4
  • Fiscalization true

Case 2. MER sender, MER customer, fiscalization is not successful

  • Basic MER status 20 -> 50
  • Business status /
  • Fiscalization false

Case 3. MER sender, MER customer, fiscalization is successful, document is rejected

  • Basic MER status 20 -> 30 -> 40
  • Business status 99 -> 4 -> 1
  • Fiscalization true

Case 4. MER sender, MER customer, fiscalization is successful, document is accepted

  • Basic MER status 20 -> 30 -> 40
  • Business status 99 -> 4 -> 0
  • Fiscalization true

Case 5. MER sender, another Access point customer, fiscalization is sucessful, document  is not rejected

  • Basic MER status 20 -> 40
  • Business status 99 -> 4 -> 0 (Not applicable in all scenarios because not all Access point exchange business document statuses)
  • Fiscalization true

Case 6. MER sender, another Access point customer, fiscalization is not successful

  • Basic MER status 20 -> 50
  • Business status /
  • Fiscalization false

Case 7. MER sender, fiscalization is not possible, eReporting successful

  • Basic MER status /
  • Business status /
  • eReporting true

Case 8. MER sender, fiscalization is not possible, eReporting unsuccessful

  • Basic MER status /
  • Business status /
  • eReporting false

Case 9. MER Sender, fiscalization is not possible, eReporting successful but customer is registered in MER database and MER has their e-mail address for receiving electronic documents. This case can be uses only if MER has customer registered and have their e-mail address for receiving electronic documents. This case will be introduced soon!

  • Basic MER status  30 ->40
  • Business status /
  • eReporting true

 

Downloading electronic document (UPDATE 2025-09-24)

Receiving information of the incoming electronic documents should be implemented for automation of the downloading, processing and booking directly into ERP system.

There are two options for downloading electronic documents:

  1. Downloading outgoing documents. As a response to the receive metgod you will get digitaly signed XML documents. These can be used for internal archiving.
  2. Donwloading incoming documents.You can download documents that MER received in the name of the user as their registered Access point which are digitally signed.

Downloading sent electronic document is done using combination of API method QueryOutbox and API method Receive. After sending documents using API method Send and eReporting you get the  ElectronicIDs from MER server response so you already have the list of ElectronicIDs. Now you can download digitaly signed XMLs for the internal e-archive.

There can also be an option that electronic documents has been send via another ERP system and you need to get the list of the sent documents inside your ERP, then you can send API method QueryOutbox to get the list of the sent electronic documents and download them into another ERP via API Receive.

Using ElectronicID, you need to create request for Receive API where you will download one-by-one XML of the electronic document. Inside the XML, you will  have base64 encoded PDF as visual representation of the data (Invoice, CreditNote) and also can be found other attachments that were added inside XML. All attachments can be found inside cbc:EmbeddedDocumentBinaryObject. Attribute mimeCode defines the type of document that is encoded inside base64.

This scenario can be used in case of accounting office (knjigovodstveni servis) that is outsourced or when end user have different ERP systems then the one used in their accounting office.

NOTE: Downloading digitaly signed XML of users sent documents with the API Receive doesn’t effect basic MER status.

Receiving of the incoming electronic document is done using combination of API method QueryInbox and API method Receive. First you need to send request to QueryInbox for receiving the list of incoming invoices and write all ElectronicIDs which you got from the list. We can suggest to filter documents by electronic ID in case you already have downloaded them.

Using ElectronicID, you need to create request for Receive API where you will download one-by-one XML of the electronic document. Inside the XML, you will  have base64 encoded PDF as visual representation of the data (Invoice, CreditNote) and also can be found other attachments that were added inside XML. All attachments can be found inside cbc:EmbeddedDocumentBinaryObject. Attribute mimeCode defines the type of document that is encoded inside base64.

One document can be downloaded multiple times even if they are in basic MER statuses 30 or 40.

NOTE: Receiving incoming electronic document via API Receive will change basic MER status from 30 to 40. It is not possible to update basic MER status from 40 back to 30 from ERP.

 

Sending status update and information

For fiscalization 2.0 , users have the obligation to inform Tax Authority about rejecting of the incoming electronic document and to inform them regarding payment of the sent document. Both information are backed by our APIs:

  • MarkPaid / MarkPaidWithoutElectronicID
  • Reject / RejectWithoutElectronicID

MarkPaid API is API used for sending payment information for the electronic document that has been sent via MER SEND API method and you have electronicID document of that document.

In case you need to send information for received payment for the electronic document that wasn’t sent via MER and you don’t have ElectronicID, then you need to use API method MarkPaidWithoutElectronicID

The same goes for the rejecting of the incoming electronic documents – use Reject method in case you have the ElectronicID because ERP has downloaded electronic document directly via MER system or RejectWithoutElectronicID when ERP system didn’t download electronic document directly via MER system so you don’t have ElectronicID of the document you want to reject.

There is option to use API UpdateDocumentProcessStatus to set electronic documents business status to APPROVED for the accounting office (knjigovodstveni servis). Usecase for this method means that end user who has another ERP system in which user sends and receives electronic documents, can update document business status so his account office (knjigovodstveni servis) can via their ERP system connect to the users MER account and download sent and received electronic documents. In case end user accepts document and wants it to be paid, they can update business process status to APPROVED so accounting office can pull that status of the end users incoming electronic document and do the payment process if they are allowed to do it in the name of the end user.

 

 

Troubleshooting the responses from APIs

It is important to go through usecases of APIs and thre responses you can be able to handle errors that are the responses to certain requests. Managing to configure most usecases and responses produces quality user experience and helps informing user how to hendle using the integration module for e-invoicing via MER. More can be found on our site https://manual.moj-eracun.hr/documentation/api-specification/error-codes/.

 

Contact us

If you have any questions, feel free to contact us by sending e-mail to integracije@moj-eracun.hr or by asking question to our MERI L2 AI assistant.

Newsletter subscription