API Dokumentacija

API Dokumentacija


API DOKUMENTACIJA

 

Required request fields:

 

Username – E-mail ili ID dodijeljen od strane MER-a

Password – Lozinka za prijavu

CompanyId – Identifikacijski broj pošiljatelja (OIB ili PDV ID / VAT broj ako pošiljatelj nije hrvatska tvrtka)

CompanyBu – Poslovna jedinica pošiljatelja (samo ako je registrirana u MER-u)

SoftwareID – ERP identifikator dodijeljen od strane MER-a

Svih ovih pet podataka interpretira se kao tekstualni podatak. Korisnik može voditi više tvrtki pod istim računom i obrnuto, stoga treba uzeti u obzir odnos “više-na-više” (many-to-many). Polje poslovne jedinice treba ostati prazno ako korisniku nije potrebno ili ako ne zna što je to. Poslovna jedinica može se opisati kao trgovina, prodavaonica ili izdvojeni pogon koji je u vlasništvu jedne tvrtke ili gdje ona obavlja određene poslovne aktivnosti.

 

PING

– Provjerava da li je servis aktivan.

– Može se koristiti za osnovne provjere povezivosti i dostupnosti.

REQUEST

 

GET https://www.moj-eracun.hr/apis/v2/Ping/

RESPONSE
{
  "Status": "ok",
  "Message": "Service is up"
}

 

SEND

– Učitava i šalje elektronički račun/dokument na platformu moj-eRačun.

– Izvršava validaciju i obradu.

–  XML treba biti u Json escaped formatu

– Koristite QUERY INBOX/OUTBOX za provjeru uspješnosti slanja i zaprimanja

REQUEST

 

Header: content-type: application/json; charset: utf-8

Live – POST https://www.moj-eracun.hr/apis/v2/send
Demo – POST https://demo.moj-eracun.hr/apis/v2/send

{
  "Username": {
    "description": "Sender Username",
    "type": "string",
    "mandatory": true
  },
  "Password": {
    "description": "Sender Password",
    "type": "string",
    "mandatory": true
  },
  "CompanyId": {
    "description": "Sender Company Id (Oib)",
    "type": "string",
    "mandatory": true
  },
  "CompanyBu": {
    "description": "Sender Business Unit (PJ)",
    "type": "string",
    "mandatory": false
  },
  "SoftwareId": {
    "description": "Business Software (Erp) Id",
    "type": "string",
    "mandatory": true
  },
  "File": {
    "description": "Utf-8 encoded and JSON escaped XML file",
    "type": "string",
    "mandatory": true
  }
}
{
  "Username": 1083,
  "Password": "test123",
  "CompanyId": "99999999927",
  "CompanyBu": "",
  "SoftwareId": "Test-002",
  "File": "<?xml version="1.0" encoding="UTF-8"?>..."
}
RESPONSE
{
    "ElectronicId": 3239400,
    "DocumentNr": "e26000007/1/2",
    "DocumentTypeId": 1,
    "DocumentTypeName": "Račun",
    "StatusId": 20,
    "StatusName": "Obrađen",
    "RecipientBusinessNumber": "99999999927",
    "RecipientBusinessUnit": "",
    "RecipientBusinessName": "Test Klising d.o.o.",
    "Created": "2026-02-11T11:32:43.8254386+01:00",
    "Sent": "2026-02-11T11:32:43.9174186+01:00",
    "Modified": "2026-02-11T11:32:43.9174186+01:00",
    "Delivered": null
}

 

RECEIVE

– Dohvaća dolazne dokumente/račune s platforme.

– Putem ovog API-ja moguće je preuzeti samo jedan dokument koristeći ElectronicID.

– Vraća dokument u XML formatu.

REQUEST

 

Header: “content-type:application/json; charset:utf-8”

Live – POST https://www.moj-eracun.hr/apis/v2/receive
Demo – POST https://demo.moj-eracun.hr/apis/v2/receive

{
  "Username": {
    "description": "Receiver Username",
    "type": "string",
    "mandatory": true
  },
  "Password": {
    "description": "Receiver Password",
    "type": "string",
    "mandatory": true
  },
  "CompanyId": {
    "description": "Receiver Company Id (Oib)",
    "type": "string",
    "mandatory": true
  },
  "CompanyBu": {
    "description": "Business Unit name (used only if it is registered in MER)",
    "type": "string",
    "mandatory": false
  },
  "SoftwareId": {
    "description": "Business Software (Erp) Id",
    "type": "string",
    "mandatory": true
  },
  "ElectronicId": {
    "description": "Electronic Document Id",
    "type": "int",
    "mandatory": true
  }
}
{
  "Username": "test@moj-eracun.hr",
  "Password": "test123",
  "CompanyId": "99999999927",
  "SoftwareId": "Test-002",
  "ElectronicId": "123456"
}

 

QUERY OUTBOX / INBOX

Outbox: Prikazuje sve poslane račune/dokumente s njihovim statusom.

Inbox: Prikazuje sve primljene račune/dokumente.

– Podržava filtriranje po datumu, Electronic ID-u ili statusu.

– Vraća popis (niz ili array) dokumenata.

– Praćenje da li je dokument uspješno: poslan, isporučen, primljen.

NE uključuje: Status plaćanja, razloge odbijanja, stanje poslovnog procesa.

REQUEST

 

Header: “content-type:application/json; charset:utf-8”

OUTBOX
Live – POST https://www.moj-eracun.hr/apis/v2/queryOutbox
Demo – POST https://demo.moj-eracun.hr/apis/v2/queryOutbox

INBOX
Live – POST https://www.moj-eracun.hr/apis/v2/queryInbox
Demo – POST https://demo.moj-eracun.hr/apis/v2/queryInbox

{
  "Username": {
    "description": "Sender Username",
    "type": "string",
    "mandatory": true
  },
  "Password": {
    "description": "Sender Password",
    "type": "string",
    "mandatory": true
  },
  "CompanyId": {
    "description": "Sender Company Id (Oib)",
    "type": "string",
    "mandatory": true
  },
  "CompanyBu": {
    "description": "Sender Business Unit (PJ)",
    "type": "string",
    "mandatory": false
  },
  "SoftwareId": {
    "description": "Business Software (Erp) Id",
    "type": "string",
    "mandatory": true
  },
  "ElectronicId": {
    "description": "Filters single document",
    "type": "int",
    "mandatory": false
  },
  "StatusId": {
    "description": "Filters status based on the status code.",
    "type": "int",
    "mandatory": false
  },
  "From": {
    "description": "YYYY-MM-DDThh:mm:ss or YYYY-MM-DD",
    "type": "ISO datetime",
    "mandatory": false
  },
  "To": {
    "description": "YYYY-MM-DDThh:mm:ss or YYYY-MM-DD",
    "type": "ISO datetime",
    "mandatory": false
  }
}
{
  "Username": "test@moj-eracun.hr",
  "Password": "test123",
  "CompanyId": "99999999927",
  "SoftwareId": "Test-002",
  "StatusId": "30"
}
RESPONSE
Outbox Response
{
  "ElectronicId": 394167,
  "DocumentNr": "20156256",
  "DocumentTypeId": 1,
  "DocumentTypeName": "Račun",
  "StatusId": 20,
  "StatusName": "Obrađen",
  "RecipientBusinessNumber": "99999999927",
  "RecipientBusinessUnit": "",
  "RecipientBusinessName": "Test Klising d.o.o.",
  "Created": "2026-01-28T15:18:54.5458301",
  "Updated": "2026-01-29T08:03:20.0566665",
  "Sent": "2026-01-28T15:18:56.4864434",
  "Delivered": "2026-01-29T07:06:38.1786133",
  "Issued": "2026-01-28T00:00:00",
  "Imported": false
}
Inbox Response
{
  "ElectronicId": 394167,
  "DocumentNr": "20156256",
  "DocumentTypeId": 1,
  "DocumentTypeName": "Račun",
  "StatusId": 20,
  "StatusName": "Obrađen",
  "SenderBusinessNumber": "99999999927",
  "SenderBusinessUnit": "",
  "SenderBusinessName": "Test Klising d.o.o.",
  "Updated": "2026-01-29T08:03:20.0566665",
  "Sent": "2026-01-28T15:18:56.4864434",
  "Delivered": "2026-01-29T07:06:38.1786133",
  "Imported": false
}
STATUS CODES
  • 20 – In Validation / U obradi: Document uploaded, pending validation.
  • 30 – Sent / Poslan: Document uploaded, signed, time-stamped; waiting for recipient to download.
  • 40 – Delivered / Preuzet: Recipient accepted and downloaded document.
  • 50 – Unsuccessful / Neuspjelo: Error occurred during processing or delivery.
  • 70 – eReporting / Preuzet (eIzvještavanje): Invoice sent to eReporting; could not be delivered to recipient – sender must send PDF/physical copy separately to the recipient.

Document Type ID table

FISCALIZATION STATUS

– Dohvaća odgovore Porezne uprave vezane uz akcije koje je pokrenuo pozivatelj (na temelju parametara username pozivatelja i OIB-a tvrtke).

– API vraća odgovore samo za zahtjeve koje je poslao isti korisnik/tvrtka, uključujući: fiscalization, eReporting, markPaid i reject.

– Za određeni račun, pozivatelj će vidjeti samo odgovore Porezne uprave na akcije koje je sam pokrenuo:
– korisnik koji je poslao zahtjev za markPaid vidjet će odgovor Porezne uprave za markPaid
– korisnik koji je poslao zahtjev za reject vidjet će odgovor Porezne uprave za reject,
– korisnik koji je pokrenuo fiscalization ili eReporting vidjet će pripadajuće odgovore za fiscalization / eReporting.

– API ne vraća odgovore vezane uz akcije koje je pokrenula druga strana

– Status fiskalizacije može se provjeriti korištenjem odgovarajućeg parametra messageType (pošiljatelj/primatelj), ali rezultati su ograničeni na vlastite zahtjeve pozivatelja.

– Vraćaju se svi odgovori Porezne uprave, s obzirom na to da ista strana može više puta poslati istu akciju (fiscalization, eReporting, markPaid, reject).

– Parametar channel type označava odnosi li se odgovor na fiscalization ili eReporting.

– Oznaka success prisutna je za svaki odgovor Porezne uprave, bez obzira na vrstu akcije, i označava je li obrada tog specifičnog zahtjeva od strane Porezne uprave bila uspješna.

– Moguće je filtrirati po parametru success kako bi se prikazali samo uspješni odgovori Porezne uprave nakon kojih se više neće pokušavati daljnja obrada za taj specifični zahtjev.

– Greške koje vrati Porezna uprava prikazuju se u poruci odgovora i unutar Encoded XML-a.

– Statusi poput reject i markPaid koje je pokrenula druga strana moraju se dohvatiti putem DocumentProcessStatus API-ja, a ne putem ovog API-ja.

 

REQUEST

 

Header: “content-type:application/json; charset:utf-8”

OUTBOX
Live – POST https://www.moj-eracun.hr/api/fiscalization/statusOutbox
Demo – POST https://demo.moj-eracun.hr/api/fiscalization/statusOutbox

INBOX
Live – POST https://www.moj-eracun.hr/api/fiscalization/statusInbox
Demo – POST https://demo.moj-eracun.hr/api/fiscalization/statusInbox

{
  "Username": {
    "description": "Sender Username",
    "type": "string",
    "mandatory": true
  },
  "Password": {
    "description": "Sender Password",
    "type": "string",
    "mandatory": true
  },
  "CompanyId": {
    "description": "Sender Company Id (Oib)",
    "type": "string",
    "mandatory": true
  },
  "CompanyBu": {
    "description": "Sender Business Unit (PJ)",
    "type": "string",
    "mandatory": false
  },
  "SoftwareId": {
    "description": "Business Software (Erp) Id",
    "type": "string",
    "mandatory": true
  },
  "ElectronicId": {
    "description": "Filters single document",
    "type": "int",
    "mandatory": false
  },
  "MessageType": {
    "description": "Filters by MessageType in the table below",
    "type": "string",
    "mandatory": false
  },
  "DateFrom": {
    "description": "YYYY-MM-DDThh:mm:ss or YYYY-MM-DD",
    "type": "ISO datetime",
    "mandatory": false
  },
  "DateTo": {
    "description": "YYYY-MM-DDThh:mm:ss or YYYY-MM-DD",
    "type": "ISO datetime",
    "mandatory": false
  },
 "ByUpdateDate": {
    "description": "If true, filters by document update date; otherwise filters by insert date",
    "type": "boolean",
    "mandatory": false
  },
  "FiscalizationRequestID": {
    "description": "Filters single document based on FiscalizationRequestID",
    "type": "string",
    "mandatory": false
  },
  "Status": {
    "description": "Filters by Status in the table below",
    "type": "int",
    "mandatory": false
  }
}
{
  "username": "user@mail.com",
  "password": "mystrongpass",
  "companyId": "22222222222",
  "softwareId": "Test-002",
  "messageType": 1,
  "dateFrom": "2025-10-20",
  "dateTo": "2025-10-25",
  "ByUpdateDate": true,
  "electronicId": 11221122,
  "fiscalizationRequestId": "d290f1ee-6c54-4b01-90e6-d701748f0851",
  "Status": 1
}
RESPONSE
[
  {
    "electronicID": "100",
    "recipientIdentificationValue": "11111111111",
    "recipientName": "Kompanija d.o.o.",
    "channelType": 0,
    "channelTypeDescription": "Fiskalizacija",
    "businessStatusReason": "Some reason",
    "messages": {
      "Status": 2,
      "StatusDescription": "Na čekanju",
      "fiscalizationRequestId": "d290f1ee-6c54-4b01-90e6-d701748f0851",
      "dateOfFiscalization": "2025-06-20T16:45:30Z",
      "encodedXml": "PD94bWwgdmVyc2lvbj0iMS4wIiB…",
      "errorCode": "S001",
      "errorCodeDescription": "Sistemska greška prilikom obrade zahtjeva",
      "messageType": 0,
      "messageTypeDescription": "Kao POŠILJATELJ dohvati status fiskalizacijske poruke"
    }
  }
]
MessageType
  • 0 – Dohvati status fiskalizacije kao POŠILJATELJ
  • 1 – Dohvati status fiskalizacije kao PRIMATELJ
  • 2 – Dohvati status odbijanja
  • 3 – Dohvati status plaćanja
  • 4 – Dohvati status za eReporting
Status
  • 0 – Uspješno
  • 1 – Neuspješno
  • 2 – Na čekanju
ChannelType
  • 0 – Fiscalization
  • 1 – eReporting
Kodovi greške
  • None – Nema greške.
  • S001 – Sistemska greška prilikom obrade zahtjeva.
  • S002 – Lokacija potpisa nije ispravna.
  • S003 – Certifikat nije izdan od davatelja usluga s pouzdanog potpisa, ili je istekao ili je ukinut.
  • S004 – Neispravan potpis zahtjeva.
  • S005 – Poruka nije u skladu s XML shemom: element ili lista elemenata nisu ispravni prema shemi.
  • S006 – Pristupna točka nije ovlaštena za dostavu podataka.
  • S007 – OIB iz zahtjeva nije formalno ispravan.
  • S008 – Već postoji zabilježen eRačun s istim identifikatorom.
  • S009 – Ne postoji zabilježen eRačun.
  • S010 – Već postoji zabilježen status odbijanja eRačuna s istim identifikatorom.
  • S011 – Nepoznata greška.
  • S012 – Ne postoji evidentiran originalni eRačun za koji je dostavljen ispravljeni eRačun.

 

MARK PAID

– Koristi samo pošiljatelj.

– Ukoliko imate ElectronicID, uvijek koristite API koji ima ElectronicID kao parametar

– API bez ElectronicID-a će biti zabilježen u poreznom sustavu, ali neće biti vidljiv u Mer servisu

– Nakon primitka uplate za račun, pošiljatelj putem API-ja obavještava Poreznu upravu da je račun plaćen.

Ponašanje pri skupnoj obradi (Bulk processing):

– Jedan skupni zahtjev (bulk request) može sadržavati do 100 računa.

– Ako obrada bilo kojeg računa u skupnom zahtjevu ne uspije, Porezna uprava odbija cijeli zahtjev i nijedan račun se ne označava kao plaćen.

– Porezna uprava ne pruža detalje o tome koji je račun uzrokovao neuspjeh skupne operacije.

REQUEST – with ElectronicId

 

Header: “content-type:application/json; charset:utf-8”

Live – POST https://www.moj-eracun.hr/api/fiscalization/markPaid
Demo – POST https://demo.moj-eracun.hr/api/fiscalization/markPaid

{
  "Username": {
    "description": "Sender Username",
    "type": "string",
    "mandatory": true
  },
  "Password": {
    "description": "Sender Password",
    "type": "string",
    "mandatory": true
  },
  "CompanyId": {
    "description": "Sender Company Id (Oib)",
    "type": "string",
    "mandatory": true
  },
  "CompanyBu": {
    "description": "Sender Business Unit (PJ)",
    "type": "string",
    "mandatory": false
  },
  "SoftwareId": {
    "description": "Business Software (Erp) Id",
    "type": "string",
    "mandatory": true
  },
  "ElectronicId": {
    "description": "Electronic Document Id",
    "type": "int",
    "mandatory": true
  },
  "PaymentDate": {
    "description": "Payment date",
    "type": "date",
    "mandatory": true
  },
  "PaymentAmount": {
    "description": "Payment amount",
    "type": "decimal",
    "mandatory": true
  },
  "PaymentMethod": {
    "description": "Filters by PaymentMethod in the table below",
    "type": "string",
    "mandatory": true
  }
}
{
  "username": "user@mail.com",
  "password": "mystrongpass",
  "companyId": "11111111111",
  "companyBU": null,
  "softwareId": "software-123",
  "electronicId": 101,
  "paymentDate": "2024-06-01T00:00:00",
  "paymentAmount": 500.00,
  "paymentMethod": "T"
}
REQUEST – Bulk Mark Paid with ElectronicId Updated (18-12-2025)

 

Header: “content-type:application/json; charset:utf-8”

Live – POST https://www.moj-eracun.hr/api/fiscalization/bulkMarkPaid
Demo – POST https://demo.moj-eracun.hr/api/fiscalization/bulkMarkPaid

{
  "username": "user@mail.com",
  "password": "mystrongpass",
  "companyId": "11111111111",
  "companyBU": null,
  "softwareId": "software-123",
  "invoices": [
    {
      "electronicId": 101,
      "paymentDate": "2024-06-01T00:00:00",
      "paymentAmount": 500.00,
      "paymentMethod": "T"
    },
    {
      "electronicId": 102,
      "paymentDate": "2024-06-02T00:00:00",
      "paymentAmount": 250.50,
      "paymentMethod": "O"
    },
    {
      "electronicId": 103,
      "paymentDate": "2024-06-03T00:00:00",
      "paymentAmount": 100.99,
      "paymentMethod": "Z"
    }
  ]
}
REQUEST – without ElectronicID

 

Header: “content-type:application/json; charset:utf-8”

Live – POST https://www.moj-eracun.hr/api/fiscalization/markPaidWithoutElectronicID
Demo – POST https://demo.moj-eracun.hr/api/fiscalization/markPaidWithoutElectronicID

{
  "Username": {
    "description": "Sender Username",
    "type": "string",
    "mandatory": true
  },
  "Password": {
    "description": "Sender Password",
    "type": "string",
    "mandatory": true
  },
  "CompanyId": {
    "description": "Sender Company Id (Oib)",
    "type": "string",
    "mandatory": true
  },
  "CompanyBu": {
    "description": "Sender Business Unit (PJ)",
    "type": "string",
    "mandatory": false
  },
  "SoftwareId": {
    "description": "Business Software (Erp) Id",
    "type": "string",
    "mandatory": true
  },
  "DateOfFiscalization": {
    "description": "Date when the fiscalization was done for the eInvoice",
    "type": "date",
    "mandatory": false
  },
  "InternalMark": {
    "description": "Fiscaliscal invoice number",
    "type": "string",
    "mandatory": true
  },
  "IssueDate": {
    "description": "Issue date of the document from XML file (not date of sending the document to MER)",
    "type": "date",
    "mandatory": true
  },
  "SenderIdentifierValue": {
    "description": "Sender identification number (OIB or GLN)",
    "type": "string",
    "mandatory": true
  },
  "RecipientIdentifierValue": {
    "description": "Recipient identification number (OIB or GLN)",
    "type": "string",
    "mandatory": true
  },
  "PaymentDate": {
    "description": "Payment date",
    "type": "date",
    "mandatory": true
  },
  "PaymentAmount": {
    "description": "Payment amount",
    "type": "decimal",
    "mandatory": true
  },
  "PaymentMethod": {
    "description": "Filters by PaymentMethod in the table below",
    "type": "string",
    "mandatory": true
  }
}
{
  "username": "user@mail.com",
  "password": "mystrongpass",
  "companyId": "11111111111",
  "companyBU": null,
  "softwareId": "software-123",
  "dateOfFiscalization": "2024-06-01",
  "internalMark": "INV-001",
  "issueDate": "2024-05-30",
  "senderIdentifierValue": "12345678901",
  "recipientIdentifierValue": "10987654321",
  "paymentDate": "2024-06-01",
  "paymentAmount": 500.00,
  "paymentMethod": "T"
}
REQUEST – Bulk Mark Paid without ElectronicId Updated (18-12-2025)

 

Header: “content-type:application/json; charset:utf-8”

Live – POST https://www.moj-eracun.hr/api/fiscalization/bulkMarkPaidWithoutElectronicId
Demo – POST https://demo.moj-eracun.hr/api/fiscalization/bulkMarkPaidWithoutElectronicId

{
  "username": "user@mail.com",
  "password": "mystrongpass",
  "companyId": "11111111111",
  "companyBU": null,
  "softwareId": "software-123",
  "invoices": [
    {
      "dateOfFiscalization": "2024-06-01T10:00:00",
      "internalMark": "INV-001",
      "issueDate": "2024-05-30T00:00:00",
      "senderIdentifierValue": "12345678901",
      "recipientIdentifierValue": "10987654321",
      "paymentDate": "2024-06-01T10:00:00",
      "paymentAmount": 500.00,
      "paymentMethod": "T"
    },
    {
      "dateOfFiscalization": "2024-06-02T11:00:00",
      "internalMark": "INV-002",
      "issueDate": "2024-05-31T00:00:00",
      "senderIdentifierValue": "12345678901",
      "recipientIdentifierValue": "10987654321",
      "paymentDate": "2024-06-02T11:00:00",
      "paymentAmount": 250.50,
      "paymentMethod": "O"
    },
    {
      "dateOfFiscalization": "2024-06-03T12:00:00",
      "internalMark": "INV-003",
      "issueDate": "2024-06-01T00:00:00",
      "senderIdentifierValue": "12345678901",
      "recipientIdentifierValue": "10987654321",
      "paymentDate": "2024-06-03T12:00:00",
      "paymentAmount": 100.99,
      "paymentMethod": "Z"
    }
  ]
}
RESPONSE
{
  "fiscalizationTimestamp": "2025-06-15T14:30:25Z",
  "encodedXml": "PD94bWwgdmVyc2lvbj0iMS4wIiB …",
  "fiscalizationRequestId": "d290f1ee-6c54-4b01-90e6-d701748f0851"
}
PaymentMethod
  • “T” – Transakcijski račun
  • “O” – Periodično plaćanje
  • “Z” – Ostalo

 

REJECT

– Koristi samo primatelj.

– Ukoliko imate ElectronicID, uvijek koristite API koji ima ElectronicID kao parametar

– API bez ElectronicID-a će biti zabilježen u poreznom sustavu, ali neće biti vidljiv u Mer servisu

– Primatelj može odbiti račun/dokument i navesti razlog.

Ponašanje pri skupnoj obradi (Bulk processing):

– Jedan skupni zahtjev (bulk request) može sadržavati do 100 računa.

– Ako obrada bilo kojeg računa u skupnom zahtjevu ne uspije, Porezna uprava odbija cijeli zahtjev i nijedan račun se ne odbija.

– Porezna uprava ne pruža detalje o tome koji je račun uzrokovao neuspjeh skupne operacije.

REQUEST – with ElectronicID

 

Header: “content-type:application/json; charset:utf-8”

Live – POST https://www.moj-eracun.hr/api/fiscalization/reject
Demo – POST https://demo.moj-eracun.hr/api/fiscalization/reject

{
  "Username": {
    "description": "Receiver Username",
    "type": "string",
    "mandatory": true
  },
  "Password": {
    "description": "Receiver Password",
    "type": "string",
    "mandatory": true
  },
  "CompanyId": {
    "description": "Receiver Company Id (Oib)",
    "type": "string",
    "mandatory": true
  },
  "CompanyBu": {
    "description": "Receiver Business Unit (PJ)",
    "type": "string",
    "mandatory": false
  },
  "SoftwareId": {
    "description": "Business Software (Erp) Id",
    "type": "string",
    "mandatory": true
  },
  "ElectronicId": {
    "description": "Electronic Document Id",
    "type": "int",
    "mandatory": true
  },
  "RejectionDate": {
    "description": "Date when rejection of the electronic document is performed",
    "type": "date",
    "mandatory": true
  },
  "RejectionReasonType": {
    "description": "Type of rejection, see table 5.2.",
    "type": "string",
    "mandatory": true
  },
  "RejectionReasonDescription": {
    "description": "Text description with rejection note",
    "type": "string",
    "mandatory": true
  }
}
{
  "username": "user@mail.com",
  "password": "mystrongpass",
  "companyId": "11111111111",
  "companyBU": null,
  "softwareId": "software-123",
  "electronicId": 201,
  "rejectionDate": "2024-06-01T10:05:00",
  "rejectionReasonType": "N",
  "rejectionReasonDescription": "Data mismatch without tax impact"
}
REQUEST – Bulk Reject with ElectronicId Updated (18-12-2025)

 

Header: “content-type:application/json; charset:utf-8”

Live – POST https://www.moj-eracun.hr/api/fiscalization/bulkReject
Demo – POST https://demo.moj-eracun.hr/api/fiscalization/bulkReject

{
  "username": "user@mail.com",
  "password": "mystrongpass",
  "companyId": "11111111111",
  "companyBU": null,
  "softwareId": "software-123",
  "invoices": [
    {
      "electronicId": 201,
      "rejectionDate": "2024-06-01T10:00:00",
      "rejectionReasonType": "N",
      "rejectionDescription": "Data mismatch without tax impact"
    },
    {
      "electronicId": 202,
      "rejectionDate": "2024-06-02T11:00:00",
      "rejectionReasonType": "U",
      "rejectionDescription": "Data mismatch with tax impact"
    },
    {
      "electronicId": 203,
      "rejectionDate": "2024-06-03T12:00:00",
      "rejectionReasonType": "O",
      "rejectionDescription": "Other reason"
    }
  ]
}
REQUEST – without ElectronicID

 

Header: “content-type:application/json; charset:utf-8”

Live – POST https://www.moj-eracun.hr/api/fiscalization/rejectWithoutElectronicID
Demo – POST https://demo.moj-eracun.hr/api/fiscalization/rejectWithoutElectronicID

{
  "Username": {
    "description": "Receiver Username",
    "type": "string",
    "mandatory": true
  },
  "Password": {
    "description": "Receiver Password",
    "type": "string",
    "mandatory": true
  },
  "CompanyId": {
    "description": "Receiver Company Id (Oib)",
    "type": "string",
    "mandatory": true
  },
  "CompanyBu": {
    "description": "Receiver Business Unit (PJ)",
    "type": "string",
    "mandatory": false
  },
  "SoftwareId": {
    "description": "Business Software (Erp) Id",
    "type": "string",
    "mandatory": true
  },
  "DateOfFiscalization": {
    "description": "Date when the fiscalization was done for the eInvoice",
    "type": "date",
    "mandatory": false
  },
  "InternalMark": {
    "description": "Fiscaliscal invoice number",
    "type": "string",
    "mandatory": true
  },
  "IssueDate": {
    "description": "Issue date of the document from XML file (not date of sending the document to MER)",
    "type": "date",
    "mandatory": true
  },
  "SenderIdentifierValue": {
    "description": "Sender identification number (OIB or GLN)",
    "type": "string",
    "mandatory": true
  },
  "RecipientIdentifierValue": {
    "description": "Recipient identification number (OIB or GLN)",
    "type": "string",
    "mandatory": true
  },
  "RejectionDate": {
    "description": "Date when rejection of the electronic document is performed",
    "type": "date",
    "mandatory": true
  },
  "RejectionReasonType": {
    "description": "Filter by RejectionReasonType in the table below",
    "type": "string",
    "mandatory": true
  },
  "RejectionReasonDescription": {
    "description": "Text description with rejection note",
    "type": "string",
    "mandatory": true
  }
}
REQUEST – Bulk Reject without ElectronicId Updated (18-12-2025)

 

Header: “content-type:application/json; charset:utf-8”

Live – POST https://www.moj-eracun.hr/api/fiscalization/bulkRejectWithoutElectronicId
Demo – POST https://demo.moj-eracun.hr/api/fiscalization/bulkRejectWithoutElectronicId

{
  "username": "user@mail.com",
  "password": "mystrongpass",
  "companyId": "11111111111",
  "companyBU": null,
  "softwareId": "software-123",
  "invoices": [
    {
      "dateOfFiscalization": "2024-06-01T10:00:00",
      "internalMark": "INV-001",
      "issueDate": "2024-05-30T00:00:00",
      "senderIdentifierValue": "HR12345678901",
      "recipientIdentifierValue": "HR10987654321",
      "rejectionDate": "2024-06-01T10:05:00",
      "rejectionReasonType": "N",
      "rejectionReasonDescription": "Data mismatch without tax impact"
    },
    {
      "dateOfFiscalization": "2024-06-02T11:00:00",
      "internalMark": "INV-002",
      "issueDate": "2024-05-31T00:00:00",
      "senderIdentifierValue": "HR12345678901",
      "recipientIdentifierValue": "HR10987654321",
      "rejectionDate": "2024-06-02T11:10:00",
      "rejectionReasonType": "U",
      "rejectionReasonDescription": "Data mismatch with tax impact"
    },
    {
      "dateOfFiscalization": "2024-06-03T12:00:00",
      "internalMark": "INV-003",
      "issueDate": "2024-06-01T00:00:00",
      "senderIdentifierValue": "HR12345678901",
      "recipientIdentifierValue": "HR10987654321",
      "rejectionDate": "2024-06-03T12:15:00",
      "rejectionReasonType": "O",
      "rejectionReasonDescription": "Other reason"
    }
  ]
}
RESPONSE
{
  "fiscalizationTimestamp": "2025-06-15T14:30:25Z",
  "encodedXml": "PD94bWwgdmVyc2lvbj0iMS4wIiB …",
  "fiscalizationRequestId": "d290f1ee-6c54-4b01-90e6-d701748f0851"
}
RejectionReasonType
  • “N” – Nepodudarnost podataka koja ne utječe na izračun poreza
  • “U” – Nepodudarnost podataka koja utječe na izračun poreza
  • “O” – Ostalo

 

AS4 EXCHANGE ERROR DETAILS

NOVI API (22-01-2026)

– Dohvaća detaljne poruke o greškama pri AS4 razmjeni kada se razmjena dokumenata obavlja između različitih pristupnih točaka.

– Ovaj API namijenjen je za korištenje isključivo za dokumente sa statusom 50 (Neuspješno).

– Vraća tehničke i poslovne poruke o greškama generirane tijekom AS4 razmjene poruka.

– API se pretražuje korištenjem parametara InternalMark (broj računa) i IssueDate, a ne preko ElectronicId-a.

– Korištenje parametra InternalMark omogućuje dohvaćanje statusa razmjene i detalja o greškama za sve pokušaje slanja istog računa, čak i kada je generirano više ElectronicId-eva zbog ponovljenog slanja.

– To omogućuje analizu cjelokupne povijesti razmjene bez potrebe za zasebnim pretraživanjem svakog pojedinog ElectronicId-a.

REQUEST

 

Header: “content-type:application/json; charset:utf-8”

LIVE – POST https://www.moj-eracun.hr/apis/as4details/queryexchangeErrorDetails

{
  "Username": {
    "description": "Sender Username",
    "type": "string",
    "mandatory": true
  },
  "Password": {
    "description": "Sender Password",
    "type": "string",
    "mandatory": true
  },
  "CompanyId": {
    "description": "Sender Company Id (OIB)",
    "type": "string",
    "mandatory": true
  },
  "SoftwareId": {
    "description": "Business Software (ERP) Id",
    "type": "string",
    "mandatory": true
  },
  "InternalMark": {
    "description": "Invoice number",
    "type": "string",
    "mandatory": true
  },
  "IssueDate": {
    "description": "Issue date of an invoice",
    "type": "date",
    "mandatory": true
  }
}
{
  "username": "user@mail.com",
  "password": "mystrongpass",
  "companyId": "22222222222",
  "SoftwareId": "Test-002",
  "InternalMark": "1/1/1",
  "IssueDate": "2026-01-22"
}
RESPONSE
{
  "items": [
    {
      "shortErrorDetail": "Greška od drugog informacijskog posrednika.",
      "errorCode": 6,
      "errorCodeDescription": "EBMS_0004",
      "errorDetail": "Document not valid: Element Invoice/AccountingSupplierParty/SellerContact/ID mora sadržavati ispravan OIB operatera",
      "role": 1,
      "roleDescription": "Zaprimanje",
      "timestamp": "2026-01-22T08:44:19",
      "recipientAccessPoint": "Recipient Access Point Name",
      "recipientFriendlyName": "Recipient Access Point Name",
      "ElectronicId": 1212121212
    },
    {
      "shortErrorDetail": "Neuspješno slanje prema pristupnoj točki 'Recipient Access Point Name'. Molimo Vas da ponovite slanje.",
      "errorCode": 7,
      "errorCodeDescription": "EBMS_0005",
      "errorDetail": "Error dispatching message to https://prod.as4.eposlovanje.hr/services/msh",
      "role": 0,
      "roleDescription": "Slanje",
      "timestamp": "2026-01-22T08:44:19",
      "recipientAccessPoint": "Recipient Access Point Name",
      "recipientFriendlyName": "Recipient Access Point Name",
      "ElectronicId": 1212121212
    }
  ]
}

 

eREPORTING

– Koristi se samo ako primatelj ne postoji u AMS-u.

– Isti dokument poslan putem SEND metode može se poslati u eReporting u JSON-escaped formatu.

– Prema zadanim postavkama, automatski eReporting je omogućen, pa kada primatelj nedostaje u AMS-u, dokument se automatski šalje u eReporting. U tom slučaju nije potreban zaseban API poziv.

– Status za eReporting može se dohvatiti putem FISCALIZATION STATUS-a.

REQUEST

 

Header: “content-type:application/json; charset:utf-8”

Live – POST https://www.moj-eracun.hr/api/fiscalization/eReporting
Demo – POST https://demo.moj-eracun.hr/api/fiscalization/eReporting

{
  "Username": {
    "description": "Sender Username",
    "type": "string",
    "mandatory": true
  },
  "Password": {
    "description": "Sender Password",
    "type": "string",
    "mandatory": true
  },
  "CompanyId": {
    "description": "Sender Company Id (Oib)",
    "type": "string",
    "mandatory": true
  },
  "CompanyBu": {
    "description": "Sender Business Unit (PJ)",
    "type": "string",
    "mandatory": false
  },
  "SoftwareId": {
    "description": "Business Software (Erp) Id",
    "type": "string",
    "mandatory": true
  },
  "File": {
    "description": "JSON escaped XML",
    "type": "string",
    "mandatory": true
  }
}
{
  "username": "user@mail.com",
  "password": "mystrongpass",
  "companyId": "22222222222",
  "companyBU": null,
  "file": "<?xml version="1.0" ...>"
}
RESPONSE
{
  "ElectronicId": 394167,
  "DocumentNr": "20156256",
  "DocumentTypeId": 1,
  "DocumentTypeName": "Račun",
  "StatusId": 20,
  "StatusName": "In validation",
  "RecipientBusinessNumber": "99999999927",
  "RecipientBusinessUnit": "",
  "RecipientBusinessName": "Test Klising d.o.o.",
  "Created": "2016-04-18T08:23:08.5879877+02:00",
  "Sent": "2016-04-18T08:23:09.6730491+02:00",
  "Modified": "2016-04-18T08:23:09.6840519+02:00",
  "Delivered": null
}


NAPOMENA: MER će prema zadanim postavkama uključiti značajku automatskog eReporting-a. To znači da kada je ova značajka uključena, nećete morati kreirati zahtjev i slati XML na eReporting API. Umjesto toga, koristit ćete samo SEND API metodu, a MER će provjeriti je li kupac registriran u AMS-u te na temelju odgovora generirati poruku za fiscalization ili eReporting i poslati je u odgovarajući sustav Porezne uprave. Kako biste provjerili je li dokument poslan u eReporting ili fiscalization, morat ćete koristiti API fiscalization/statusOutbox i očitati vrijednost parametra channelType.

DOCUMENT PROCESS STATUS

– Praćenje životnog ciklusa dokumenta nakon isporuke.

– Provjera je li dokument: plaćen, odbijen i fiskaliziran.

Update Document Process Status

– Koristi se za ažuriranje statusa obrade dolaznog dokumenta od strane primatelja.
– Putem API-ja mogu se postaviti samo statusi 0, 1, 2 i 3.

REQUEST

 

POST https://www.moj-eracun.hr/apis/v2/UpdateDokumentProcessStatus
Header: content-type: application/json; charset:utf-8

{
  "Username": {
    "description": "Recipient Username",
    "type": "string",
    "mandatory": true
  },
  "Password": {
    "description": "Recipient Password",
    "type": "string",
    "mandatory": true
  },
  "CompanyId": {
    "description": "Recipient Company Id (OIB)",
    "type": "string",
    "mandatory": true
  },
  "CompanyBu": {
    "description": "Recipient Business Unit (PJ)",
    "type": "string",
    "mandatory": false
  },
  "SoftwareId": {
    "description": "Business Software (ERP) Id",
    "type": "string",
    "mandatory": true
  },
  "ElectronicId": {
    "description": "Electronic ID of the document for which the process status is updated",
    "type": "int",
    "mandatory": true
  },
  "StatusId": {
    "description": "Document process status. Allowed values: 0, 1, 2, 3",
    "type": "int",
    "mandatory": true
  },
  "RejectReason": {
    "description": "Reason for rejection (required when StatusId = 1)",
    "type": "string",
    "mandatory": false
  }
}
{
  "Username": "test@moj-eracun.hr",
  "Password": "test123",
  "CompanyId": "99999999927",
  "SoftwareId": "Test-002",
  "ElectronicId": 4439122,
  "StatusId": 0
}
RESPONSE
{
  "ElectronicId": 4439122,
  "DokumentProcessStatus": 0,
  "UpdateDate": "2019-04-04T19:05:04.3818381+02:00"
}
Document Process Status Codes
  • 0 – APPROVED / Prihvaćen: Document is successfully approved by the recipient.
  • 1 – REJECTED / Odbijen: Document is rejected by the recipient.
  • 2 – PAYMENT_FULFILLED / Plaćeno u potpunosti: Document is fully paid.
  • 3 – PAYMENT_PARTIALLY_FULFILLED / Djelomično plaćeno: Document is partially paid.
  • 4 – RECEIVING_CONFIRMED / Potvrda zaprimanja: Document successfully downloaded by the recipient (read-only).
  • 99 – RECEIVED / Zaprimljen: Document received in recipient inbox (read-only).

Status codes 4 and 99 cannot be modified via API and are managed exclusively by the service provider.

 

Query Document Process Status – Inbox / Outbox

Returned information includes:

– Sve osnovne identifikacijske podatke dokumenta

DocumentProcessStatus (npr. Plaćen, Odbijen)

– Razlog odbijanja (ako je primjenjivo)

– Dodatne statuse dokumenta

REQUEST

 

Header: “content-type:application/json; charset:utf-8”

OUTBOX
Live – POST https://www.moj-eracun.hr/apis/v2/queryDocumentProcessStatusOutbox
Demo – POST https://demo.moj-eracun.hr/apis/v2/queryDocumentProcessStatusOutbox

INBOX
Live – POST https://www.moj-eracun.hr/apis/v2/queryDocumentProcessStatusInbox
Demo – POST https://demo.moj-eracun.hr/apis/v2/queryDocumentProcessStatusInbox

{
  "Username": {
    "description": "Sender or Recipient Username",
    "type": "string",
    "mandatory": true
  },
  "Password": {
    "description": "Login password",
    "type": "string",
    "mandatory": true
  },
  "CompanyId": {
    "description": "Company Id (OIB)",
    "type": "string",
    "mandatory": true
  },
  "CompanyBu": {
    "description": "Business Unit (PJ)",
    "type": "string",
    "mandatory": false
  },
  "SoftwareId": {
    "description": "Business Software (ERP) Id",
    "type": "string",
    "mandatory": true
  },
  "ElectronicId": {
    "description": "Filters a single document",
    "type": "int",
    "mandatory": false
  },
  "StatusId": {
    "description": "Filters by document process status",
    "type": "int",
    "mandatory": false
  },
  "InvoiceYear": {
    "description": "Filters by invoice year",
    "type": "int",
    "mandatory": false
  },
  "InvoiceNumber": {
    "description": "Filters by invoice number",
    "type": "string",
    "mandatory": false
  },
  "DateFrom": {
    "description": "YYYY-MM-DDThh:mm:ss or YYYY-MM-DD",
    "type": "ISO datetime",
    "mandatory": false
  },
  "DateTo": {
    "description": "YYYY-MM-DDThh:mm:ss or YYYY-MM-DD",
    "type": "ISO datetime",
    "mandatory": false
  },
  "ByUpdateDate": {
    "description": "If true, filters by document update date; otherwise by insert date",
    "type": "boolean",
    "mandatory": false
  }
}
{
  "username": "user@mail.com",
  "password": "mystrongpass",
  "companyId": "22222222222",
  "softwareId": "Test-002",
  "dateFrom": "2025-10-20",
  "dateTo": "2025-10-25",
  "byUpdateDate": true,
  "electronicId": 11221122
}
RESPONSE
{    
“ElectronicId“: 394162,
“DocumentNr“: “3-1-1”,
“DocumentTypeId“: 1,
“DocumentTypeName“: “Račun”,
“StatusId“: 30,
“StatusName“: “Poslano”,
“IssueDate“: “2016-04-18T08:13:03.177”,
“SenderBusinessNumber“: “99999999927”,
“SenderBusinessUnit“: “”,
“SenderBusinessName“: “Test Klising d.o.o.”,
“Sent“: “2016-04-18T08:13:03.177”,
“Delivered“: null,
“IssueDate“: “2016-04-18T00:00:00”,
“DocumentProcessStatusId“: 99,
“DocumentProcessStatusName“: “Zaprimljen”,
“AdditionalDokumentStatusId“: null,
“RejectReason“: null,
"OutboundFiscalizationStatus": 2
}

 

CHECK IDENTIFIER

– Checks whether a given identifier is registered in the AMS system.
– If the identifier is found, the API returns a 200 OK status.
– If the identifier is not found or an error occurs, an appropriate 4xx or 5xx status is returned.
– This endpoint is typically used to verify recipient registration before sending documents but it is not necessary.

REQUEST

 

Header: “content-type:application/json; charset:utf-8”

POST https://www.moj-eracun.hr/api/mps/check

{
  "Username": {
    "description": "Sender Username",
    "type": "string",
    "mandatory": true
  },
  "Password": {
    "description": "Sender Password",
    "type": "string",
    "mandatory": true
  },
  "CompanyId": {
    "description": "Sender Company Id (Oib)",
    "type": "string",
    "mandatory": true
  },
  "CompanyBu": {
    "description": "Sender Business Unit (PJ)",
    "type": "string",
    "mandatory": false
  },
  "SoftwareId": {
    "description": "Business Software (Erp) Id",
    "type": "string",
    "mandatory": true
  },
  "IdentifierType": {
    "description": "For possible values of identifier type, check below",
    "type": "string",
    "mandatory": true
  },
  "IdentifierValue": {
    "description": "Identifier under which the organization is registered in AMS",
    "type": "string",
    "mandatory": true
  }
}
{
  "username": "user@mail.com",
  "password": "mystrongpass",
  "companyId": "22222222222",
  "companyBU": null,
  "softwareId": "Test-002",
  "identifierValue": "99999999927"
}
IDENTIFIER TYPE
  • 0 – OIB – Croatian personal identification number
  • 1 – GLN – Global location number
RESPONSE
200 OK

No response body is returned when the identifier is registered.
{
  "traceId": "b5feb4c7-5c58-49a9-84fe-891f4f76e659",
  "message": "Some error message"
}

 

NOTIFY IMPORT

– Used by ERP systems to notify Moj-eRačun that a document has been successfully imported.
– This endpoint does not change the document status or content.
– It is intended to prevent duplicate imports and to improve traceability.
– Usage of this endpoint is optional.

REQUEST

 

Header: “content-type:application/json; charset:utf-8”

POST https://www.moj-eracun.hr/apis/v2/notifyimport/{DocumentId}
Example https://www.moj-eracun.hr/apis/v2/notifyimport/189919

{
  "Username": {
    "description": "Receiver Username",
    "type": "integer",
    "mandatory": true
  },
  "Password": {
    "description": "Receiver Password",
    "type": "string",
    "mandatory": true
  },
  "CompanyId": {
    "description": "Receiver Company Id (OIB)",
    "type": "string",
    "mandatory": true
  },
  "CompanyBu": {
    "description": "Receiver GLN Code / Moj-eRačun Subject ID / Business Unit (PJ)",
    "type": "string",
    "mandatory": false
  },
  "SoftwareId": {
    "description": "Receiver software Id",
    "type": "string",
    "mandatory": true
  }
}
{
  "Username": 1083,
  "Password": "test123",
  "CompanyId": "99999999927",
  "CompanyBu": "",
  "SoftwareId": "Test-001"
}

 

SEARCH CLASSIFICATION

– Allows searching classification data by a specific code or by a descriptive keyword.
– Search can be performed using a full or partial classification code (e.g. 01.45).
– Search can also be performed using a keyword (e.g. ovce).

Authentication:
– All requests must include the X-API-KEY header.
– Contact Moj-eRačun support to request an API key.

Request parameters:
searchString – value used for searching (code or keyword)

REQUEST – Search by code

 

GET https://www.moj-eracun.hr/api/Fiscalization/GetKpdData?searchString=01.45.1

Header:
X-API-KEY: <your-api-key>

RESPONSE – Search by code
{
  "status": "success",
  "results": [
    {
      "code": "01.45.1",
      "name": "Ovce i koze, žive"
    },
    {
      "code": "01.45.11",
      "name": "Ovce, žive"
    },
    {
      "code": "01.45.12",
      "name": "Koze, žive"
    }
  ]
}
REQUEST – Search by keyword

 

GET https://www.moj-eracun.hr/api/Fiscalization/GetKpdData?searchString=ovce

Header:
X-API-KEY: <your-api-key>

RESPONSE – Search by keyword
[
  {
    "code": "01.45",
    "name": "Ovce i koze, žive; sirovo ovčje i kozje mlijeko i šišana ovčja i kozja vuna"
  },
  {
    "code": "01.45.1",
    "name": "Ovce i koze, žive"
  },
  {
    "code": "01.45.11",
    "name": "Ovce, žive"
  }
]

Newsletter subscription