API V2
API Version 2 - Integrators Manual
Send
Send electronic document to recipient.
Send action will upload a document to moj-eracun.rs server, validate it, digitally sign it, timestamp the document, register it on SEF and then send an email notification to the customer.
Send Parameters
Send Example Request
Send Example response
Send Example response Xml
394162 3-1-1 1 Invoice 30 Sent 110712050 Docloop doo 2016-04-18T08:13:03.177
Example error responses
This error indicates that either Username and/or Password are not correct:
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 - The document was not successfully registered in the SEF.
Query Inbox
Query inbox is used to discover new documents addressed to your company or business unit.
Query Inbox Parameters
Query Inbox Example
Query inbox is used to monitor received documents statuses.
Query Inbox Example Response Xml
394162 99144 83824 3-1-1 1 Invoice 30 Sent 110712050 Docloop doo 2016-04-18T08:13:03.177 394163 99145 83825 3-1-1 1 Invoice 30 Sent 110712050 Docloop doo 2016-04-18T08:17:22.937 394166 99146 83826 20156256 1 Invoice 30 Sent 110712050 Docloop doo 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 XML
394162 99144 83824 3-1-1 1 Invoice 30 Sent 110712050 Docloop doo 2016-04-18T08:13:01.693 2016-04-18T08:13:05.007 2016-04-18T08:13:03.177 394163 99145 83825 3-1-1 1 Invoice 30 Sent 110712050 Docloop doo 2016-04-18T08:17:20.657 2016-04-18T08:17:24.89 2016-04-18T08:17:22.937 394166 99146 83826 20156256 1 Invoice 30 Sent 110712050 Docloop doo 2016-04-18T08:18:45.94 2016-04-18T08:18:47.357 2016-04-18T08:18:47.33
Query Outbox Example Json
Example error responses
This error indicates that StatusId parameter is not correct:
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 the name of the Business Unit:
Receive Document Response Document
Receive Document Response 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
2 - PAYMENT_FULFILLED
3 - PAYMENT_PARTIALLY_FULLFILLED
4 - RECEIVING_CONFIRMED
5 - CANCELLED
6 - NEW
7 - DRAFT
8 - SENT
9 - MISTAKE
10 - OVERDUE
11 - ARCHIVED
12 - SENDING
13 - DELETED
14 - STORNO
15 - UNKNOWN
16 - SEEN
17 - REMINDED
18 - RENOTIFED
99 - RECEIVED
*Statuses do not yet have a description because it is not available by the authorities that define it.
Document process status is used to update the status of the recepients process of some incoming invoice.
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. The response to this method contains basic data and additional information about the process status of the received documents.
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 110712050 Docloop doo 2018-04-18T08:13:03.177 null DocumentProcessStatusName 394163 3-1-1 1 Invoice 30 110712050 Docloop doo 2018-04-18T08:17:22.937 2018-04-19T18:03:27.457 0 APPROVED 15 394166 20156256 1 Invoice 30 110712050 Docloop doo 2018-04-18T08:18:47.33 2018-04-18T09:38:33.47 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 110712050 Docloop doo 2016-04-18T08:13:01.693 2016-04-18T08:13:05.007 2016-04-18T08:13:03.177 null DocumentProcessStatusName 394163 3-1-1 1 Invoice 30 110712050 Docloop doo 2016-04-18T08:17:20.657 2016-04-18T08:17:24.89 2016-04-18T08:17:22.937 2018-04-19T18:03:27.457 0 APPROVED 15 Dokument uspešno dostavljen na SEF 394166 20156256 1 Invoice 30 110712050 Docloop doo 2016-04-18T08:18:45.94 2016-04-18T08:18:47.357 2016-04-18T08:18:47.33 2018-04-18T09:38:33.47 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:
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
Document Action
Apply resend, cancel, storno or delete 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.
Storno action will storno sent document. Storno action is able only when Sales document is in status Approved.
Delete action will delete sent document. Delete action will be possible only when Sales document is in status Draft or New.
Document Action Parameters
Document Action Example
Example error responses
This error indicates that Action can not be applied to this document:
Document Action Example
Example error responses
This error indicates that Action can not be applied to this document:
Individual Vat
Send individual VAT record
SendIndividualVat method used to send individual VAT records, to the Moj-eRačun service.
SendIndividualVat Parameters
SendIndividualVat Example
SendIndividualVat Response Example
SendIndividualVat Error Response Example
Cancel group VAT record
CancelIndividualVat method used to cancel all version of individual VAT records, to the Moj-eRačun service.
CancelIndividualVat Parameters
CancelIndividualVat Example
CancelIndividualVat Response Example
CancelIndividualVat Error Responses Example
Change individual VAT record
ChangeIndividualVat method used to change individual VAT records, to the Moj-eRačun service.
ChangeIndividualVat Parameters
ChangeIndividualVat Example
ChangeIndividualVat Response Example
ChangeIndividualVat Error Response Example
Group VAT
Send group VAT record
SendGroupVat method used to send group VAT records, to the Moj-eRačun service.
SendGroupVat Parameters
SendGroupVat Example
SendGroupVat Response Example
SendGroupVat Error Responses Example
Cancel group VAT record
CancelGroupVat method used to cancel all version of group VAT records, to the Moj-eRačun service.
CancelGroupVat Parameters
CancelGroupVat Example
CancelGroupVat Response Example
CancelGroupVat Error Responses Example
Change group VAT record
ChangeGroupVat method used to change group VAT records, to the Moj-eRačun service.