API V2
API Version 2 - Integrators Manual
Ping
Checks if service is up.
Ping Example
Ping Response
Send
Send Electronic Document to recipient.
Send action will upload document to moj-eracun.hr server, validate, digitally sign and timestamp document and then send notification emails to customers.
Send Parameters
Send Example Request
Send Example Request with HighImportanceReceive
Send Example response
If document is valid, it gets saved, signed and email notification is sent to customer. API returns ElectronicId
Example error responses
This error indicates that either Username and/or Password are not correct:
This error indicates that Company which is sending the eInvoice is not registered on Moj-eRačun service:
This error indicates that a user doesn't have privileges in Company for which it wants to send eInvoice:
This error indicates that a user doesn't have sufficient privileges to send eInvoice:
This error indicates that there is an error with SoftwareId parameter:
All of these errors should be parsed in order for user to be able to read the error description.
Query
Query document status
Status description
20 In validation - Document is successfully uploaded, pending recipient company data validation
30 Sent - Document is successfully uploaded, digitally signed and time stamped. Notification email is sent to customer.
40 Delivered – Customer accepted and downloaded digital invoice
45 Canceled - Sender canceled digital invoicing process, as customer didn't accept invoice. Customer can no longer download document.
50 Unsuccessful – Customer did not download invoice in 5 days – from this point usual flow is to resend document
Query Inbox
Query inbox is used to discover new documents addressed to your company or business unit. For this method, the API returns 10.000 results.
Query Inbox Parameters
Query Inbox Example
Query outbox is used to monitor sent documents statuses.
Query Inbox Example Xml
394162 3-1-1 1 Invoice 30 Sent 99999999927 Test Klising d.o.o. 2016-04-18T08:13:03.177 394163 3-1-1 1 Invoice 30 Sent 99999999927 Test Klising d.o.o. 2016-04-18T08:17:22.937 394166 20156256 1 Invoice 30 Sent 99999999927 Test Klising d.o.o. 2016-04-18T08:18:47.33
Query Inbox Example Json
Example error responses
This error indicates that StatusId parameter is not correct:
Query Outbox
Query outbox is used to discover new statuses of sent documents. For this method, the API returns 10.000 results.
Query Outbox Parameters
Query Outbox Example
Query Outbox Example response
394162 3-1-1 1 Invoice 30 Sent 99999999927 Test Klising d.o.o. 2016-04-18T08:13:01.693 2016-04-18T08:13:05.007 2016-04-18T08:13:03.177 394163 3-1-1 1 Invoice 30 Sent 99999999927 Test Klising d.o.o. 2016-04-18T08:17:20.657 2016-04-18T08:17:24.89 2016-04-18T08:17:22.937 394166 20156256 1 Invoice 30 Sent 99999999927 Test Klising d.o.o. 2016-04-18T08:18:45.94 2016-04-18T08:18:47.357 2016-04-18T08:18:47.33
Example error responses
This error indicates that StatusId parameter is not correct:
General error responses
This error indicates that Get HTTP verb was used instead of POST:
Receive
Receive method is used for downloading documents. Both sent and incoming, eg. Inbox and Outbox documents.
Receive Parameters
Receive Document Example
Following examples show how to POST a receive request using all possible values for CompanyBu parameter.
Example with no Business Unit:
Example with GLN Code:
Example with Moj-eRačun Subject ID:
Example with the name of the Business Unit:
Receive Document Response Document
Receive Document Respnse contains XML document containing electronic Invoice.
...
Example error responses
This error indicates that ElectronicId parameter is not found:
This error indicates that the document is archived and is no longer accessible via API, i.e. it can not be received via API:
Document process
Document process status
Status description
1 - REJECTED - Document is rejected by the recipient
2 - PAYMENT_FULFILLED - Document is fully paid
3 - PAYMENT_PARTIALLY_FULLFILLED – Document is partially paid
4 - RECEIVING_CONFIRMED – Document successfully downloaded by the recipient
99 - RECEIVED – Document received in the inbox of the recipient (e.g. FINA service)
Document process status is used to update the status of the recipients process of some incoming invoice.
Statuses 4 (RECEIVING_CONFIRMED) and 99 (RECEIVED) 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.
Header: "content-type:application/json; charset:utf-8" //for json requests
Document Process Status Parameters
Document Process Status Example
Response Example (JSON)
Query Document Process
Query document process status
Query Document Process Status - Inbox
Query inbox is used to discover new documents addressed to your company or business unit. For this method, the API returns 20.000 results.
Header: "content-type:application/json; charset:utf-8" //for json requests
Parameters
Example
Header: "content-type:application/json; charset:utf-8"
Response Example (XML)
394162 3-1-1 1 Invoice 30 Sent 99999999927 Test Klising d.o.o. 2018-04-18T08:13:03.177 2016-04-17T08:13:08.148 null DocumentProcessStatusName 394163 3-1-1 1 Invoice 30 Sent 99999999927 Test Klising d.o.o. 2018-04-18T08:17:22.937 2018-04-19T18:03:27.457 2016-04-17T08:13:08.148 0 APPROVED 15 394166 20156256 1 Invoice 30 Sent 99999999927 Test Klising d.o.o. 2018-04-18T08:18:47.33 2018-04-18T09:38:33.47 2016-04-17T08:13:08.148 2 PAYMENT_FULFILLED
Response Example (JSON)
Header: "content-type:application/json; charset:utf-8"
Example error responses
This error indicates that StatusId parameter is not correct:
Query Document Process Status - Outbox
Query outbox is used to discover new statuses of sent documents. For this method, the API returns 20.000 results.
Header: "content-type:application/json; charset:utf-8"
Parameters
Example
Header: "content-type:application/json; charset:utf-8"
Response Example (XML)
394162 3-1-1 1 Invoice 30 Sent 99999999927 Test Klising d.o.o. 2016-04-18T08:13:01.693 2016-04-18T08:13:05.007 2016-04-17T08:13:08.148 2016-04-18T08:13:03.177 null DocumentProcessStatusName 394163 3-1-1 1 Invoice 30 Sent 99999999927 Test Klising d.o.o. 2016-04-18T08:17:20.657 2016-04-18T08:17:24.89 2016-04-17T08:13:08.148 2016-04-18T08:17:22.937 2018-04-19T18:03:27.457 0 APPROVED 15 394166 20156256 1 Invoice 30 Sent 99999999927 Test Klising d.o.o. 2016-04-18T08:18:45.94 2016-04-18T08:18:47.357 2016-04-17T08:13:08.148 2016-04-18T08:18:47.33 2018-04-18T09:38:33.47 2 PAYMENT_FULFILLED
Example error responses
This error indicates that StatusId parameter is not correct:
NotifyImport
Notify import method is used for sending an information that an invoice is imported into an ERP solution, to the Moj-eRačun service.
NotifyImport
NotifyImport Parameters
NotifyImport Example
MarkPaid
Mark Paid method is used for sending an information that an invoice is paid, to the Moj-eRačun service.
MarkPaid Parameters
MarkPaid Example
MarkPaid Response Example
Document Action
Apply resend or cancel action to document.
Resend action will send email notification to customer.
Cancel action cancels digital invoicing process, as customer didn't accept invoice. Customer can no longer download document.
Document Action Parameters
Document Action Example
Example error responses
This error indicates that Action can not be applied to this document:
GetSubjectBIDetails
This API method is used to check full details for VAT number of organization.
GetSubjectBIDetails Parameters
GetSubjectBIDetails Example
GetSubjectBIDetails Success Response Example
GetSubjectBIDetails Error Response Example
IsSubjectBlocked
This API method is used to check whether a customer is blocked.
IsSubjectBlocked Parameters
IsSubjectBlocked Example
IsSubjectBlocked Success Response Example
IsSubjectBlocked Error Response Example
GetSubjectGeneralInformation
This API method is used to get general information for some Subject.
GetSubjectGeneralInformation Parameters
GetSubjectGeneralInformation Example
GetSubjectGeneralInformation Response Examples
GetSubjectReceivingInformation
This API method is used to check whether a subject is receiver in moj-eracun.hr. As result it returns Email or Emails delimited with ';' and bool isReceiver.
GetSubjectReceivingInformation Parameters
GetSubjectReceivingInformation Example
GetSubjectReceivingInformation Response Examples
GetSubjectsReceivingInformation
This API method retrieves data for all companies that are receivers.
Header: "content-type:application/json; charset:utf-8"
GetSubjectsReceivingInformation Parameters
GetSubjectsReceivingInformation Example
Header: "content-type:application/json; charset:utf-8"
GetSubjectsReceivingInformation Response Example
GetAdditionalDocumentStatuses
This API method retrieves data for all additional document statuses provided by other service providers. This status represents state of document in another system.