API V1

API Version 1 - Integrators Manual

Send

Send Electronic Document to recipient.

POST /exchange/send
Header: contentType="application/json; charset=utf-8"

Send Parameters

Send Example Request

Send Example response

If document is valid, it gets saved, signed and email notification is sent to customer. API returns DocumentId

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 this errors should be parsed in order for user to be able to read the error description.

Query

Query document status

Status description

10 In preparation - Document is successfully uploaded, but pending validation and sending
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 - Customer didn't accept invoice, so digital invoicing process is canceled. Customer can no longer download document.
50 Unsuccessful – Customer did not accept (download) invoice in 5 days – from this point usual flow is to resend document

Query Single

POST /exchange/getstatus/DocumentId
Header: contentType="application/json; charset=utf-8"

Query Single Parameters

Query Single Example

POST /exchange/getstatus/189919
Header: contentType="application/json; charset=utf-8"

Query Single Example Response


<?xml version="1.0" encoding="utf-8" ?>



<arrayofmerracunstatus xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <merracunstatus>
        <id>189919</id>
        <internibroj>966/1/1</internibroj>
        <suppliername>Tvrtka d.o.o.</suppliername>
        <supplierid>015185234370</supplierid>
        <status>40</status>
        <type>1</type>
        <parentdocumentid>0966/1/1</parentdocumentid>
        <issuedate>2015-09-30T00:00:00</issuedate>
        <updatedate>2015-10-01T07:18:14.117</updatedate>
        <imported>false</imported>
    </merracunstatus>
</arrayofmerracunstatus>

Query Inbox

POST /exchange/getstatus
Header: contentType="application/json; charset=utf-8"

Query Inbox Parameters

Query Inbox Example

POST /exchange/getstatus
Header: contentType="application/json; charset=utf-8"

Query Inbox Example response


<?xml version="1.0" encoding="utf-8" ?>



<arrayofmerracunstatus xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <merracunstatus>
        <id>38077</id>
        <internibroj>4-01-91</internibroj>
        <suppliername>Test Klising 2</suppliername>
        <supplierid>01234554321</supplierid>
        <status>40</status>
        <type>1</type>
        <parentdocumentid>4</parentdocumentid>
        <issuedate>2014-03-24T00:00:00</issuedate>
        <updatedate>2015-08-27T11:30:29.66</updatedate>
        <imported>false</imported>
    </merracunstatus>
        <merracunstatus>
        <id>46938</id>
        <internibroj>7-01-91</internibroj>
        <suppliername>Test Klising 2</suppliername>
        <supplierid>01234554321</supplierid>
        <status>40</status>
        <type>1</type>
        <parentdocumentid>7</parentdocumentid>
        <issuedate>2014-03-24T00:00:00</issuedate>
        <updatedate>2014-09-23T13:15:01.783</updatedate>
        <imported>false</imported>
    </merracunstatus>
        <merracunstatus>
        <id>35642</id>
        <internibroj>13-01-91</internibroj>
        <suppliername>Test Klising 2</suppliername>
        <supplierid>01234554321</supplierid>
        <status>40</status>
        <type>1</type>
        <parentdocumentid>13</parentdocumentid>
        <issuedate>2014-07-14T00:00:00</issuedate>
        <updatedate>2015-08-27T11:30:14.297</updatedate>
        <imported>false</imported>
    </merracunstatus>
</arrayofmerracunstatus>

Query Outbox

POST /exchange/getstatus
Header: contentType="application/json; charset=utf-8"

Query Outbox Parameters

Query Outbox Example

POST /exchange/getstatus
Header: contentType="application/json; charset=utf-8"

Query Outbox Example response


<?xml version="1.0" encoding="utf-8" ?>



<arrayofmerracunstatus xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <merracunstatus>
        <id>38077</id>
        <internibroj>4-01-91</internibroj>
        <suppliername>Test Klising 2</suppliername>
        <supplierid>01234554321</supplierid>
        <status>40</status>
        <type>1</type>
        <parentdocumentid>4</parentdocumentid>
        <issuedate>2014-03-24T00:00:00</issuedate>
        <updatedate>2015-08-27T11:30:29.66</updatedate>
        <imported>false</imported>
    </merracunstatus>
        <merracunstatus>
        <id>46938</id>
        <internibroj>7-01-91</internibroj>
        <suppliername>Test Klising 2</suppliername>
        <supplierid>01234554321</supplierid>
        <status>40</status>
        <type>1</type>
        <parentdocumentid>7</parentdocumentid>
        <issuedate>2014-03-24T00:00:00</issuedate>
        <updatedate>2014-09-23T13:15:01.783</updatedate>
        <imported>false</imported>
    </merracunstatus>
        <merracunstatus>
        <id>35642</id>
        <internibroj>13-01-91</internibroj>
        <suppliername>Test Klising 2</suppliername>
        <supplierid>01234554321</supplierid>
        <status>40</status>
        <type>1</type>
        <parentdocumentid>13</parentdocumentid>
        <issuedate>2014-07-14T00:00:00</issuedate>
        <updatedate>2015-08-27T11:30:14.297</updatedate>
        <imported>false</imported>
    </merracunstatus>
</arrayofmerracunstatus>

Receive

Receive method is used for downloading documents. Both sent and incoming, eg. Inbox and Outbox documents.

Receive Document

POST /exchange/receive/DocumentId
Header: contentType="application/json; charset=utf-8"

Receive Parameters

Receive Document Example

Following examples show how to POST a receive request using all possible values for CompanyBu parameter.

POST /exchange/receive/189919
Header: contentType="application/json; charset=utf-8"

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.

            
<?xml version="1.0" encoding="utf-8" ?>



<OutgoingInvoicesData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                      xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://fina.hr/eracun/erp/OutgoingInvoicesData/v3.2">
...
    </AttachedDocumentEnvelope>
  </OutgoingInvoice>
</OutgoingInvoicesData>
            
            

Error responses for this method are the same as the error responses for the send method.

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

POST /exchange/notifyimport/DocumentId
Header: contentType="application/json; charset=utf-8"

NotifyImport Parameters

NotifyImport Example

POST /exchange/notifyimport/189919
Header: contentType="application/json; charset=utf-8"

MarkPaid

Mark Paid method is used for sending an information that an invoice is paid, to the Moj-eRačun service.

POST /exchange/markPaid/DocumentId
Header: contentType="application/json; charset=utf-8"

MarkPaid Parameters

MarkPaid Example

POST /exchange/markPaid/189919
Header: contentType="application/json; charset=utf-8"

MarkPaid Response Example

Resend

Resend method will resend notification email to customer.

POST /exchange/resend/DocumentId
Header: contentType="application/json; charset=utf-8"

Query Single Parameters

Resend Example

POST /exchange/resend/189919
Header: contentType="application/json; charset=utf-8"

Cancel

Cancel method will stop Electronic Document delivery.

After cancel method, customer can no longer download document and no further processing can be implemented.

POST /exchange/ispisi/DocumentId
Header: contentType="application/json; charset=utf-8"

Cancel Parameters

Cancel Example

POST /exchange/ispisi/189919
Header: contentType="application/json; charset=utf-8"