ERP Tax Integration Flow
A robust ERP integration must track statuses of outbound documents and mark all inbound documents as having been processed (business documents, as well as response documents)
Inbound documents (billing documents or response documents) are fetched in the usual way: when a deliveryNotified webhook event arrives for direct integration, or through the eB2B protocol for service providers. See Receiving inbound messages. Polling is the legacy alternative, see Polling (legacy).
The message's action (data.action in the webhook event) tells the documents apart and decides how to fetch them:
SubmitInvoicefor the inbound invoice. UseGET /transactions/submit-invoice?messageId={messageId}to fetch.CorrectWithCreditfor the inbound credit note. UseGET /transactions/correct-with-credit?messageId={messageId}to fetch.SubmitMessageResponsefor the MLR and eMLR documents (extended MLRs). UseGET /messages/{messageId}/documents/coreto fetch.
Supplier flow
ERP system on supplier side must, after submitting the invoice, be aware of the tax administration's response for the reporting of that invoice. A taxReportingStatusChanged webhook event tells you when the reporting status of the invoice changes.
Later on, when payment is received, they must register the payment of the invoice and be aware of the tax administration's response related to that registration.
In FiskApplicajia, they should have full overview of what has been reported.
More details are provided in the sequence diagrams below.
flowchart LR A(Submit invoice/credit note) --> B(Process tax response) B --> C(Register payment) C --> D(Process payment response)
Customer flow
ERP system on customer side must, after importing the invoice, be aware of the tax administration's response for the reporting of that invoice.
If customer wants to reject an invoice, they must register the rejection of the invoice and be aware of the tax administration's response related to that registration.
In FiskApplicajia, they should have full overview of what has been reported and if there are any misalignments between what seller and buyer report.
More details are provided in the sequence diagrams below.
flowchart LR
A(Import invoice/credit note) --> B(Process tax response)
B -.-> C(Register rejection )
C -.-> D(Process rejection response)
style C opacity:0.5, stroke-dasharray: 5 5
style D opacity:0.5, stroke-dasharray: 5 5
Sending e-invoices (supplier)
Flow between ERP system and Unimaze for outbound flow using MLR response messages.
Processing the content of MLR and *eMLR documents is optional before marking them as delivered (imported), but at least pay attention to the final statuses AP (accept) and RE (reject):
Submitting the tax report only happens after the e-invoice has been delivered.
The type of report is determined by:
- Fiscalization report if the receiving party is able to to receive the HR-UBL invoice or credit note syntax. (Evidentiraj eRačun)
- Taxable delivery report otherwise e.g. when delivered as an e-mail. (Evidentiraj podatke za isporuke za koje nije izdan eRačun).
Marking inbound messages as received (mark as delivered) is left out of this diagram and all the following ones for clarity. Every inbound message, including MLRs and eMLRs, must still be marked as delivered.
sequenceDiagram
autonumber
participant E
participant U
participant C
participant TA
box Invoice issuer
participant E as ERP (Supplier)
end
box Access Point & External systems
participant U as UNIMAZE
participant C as ERP (Customer)
participant TA as Tax Admin
end
activate E
E->>U: POST /submit-invoice, POST correct-with-credit
U-->>E: Fetch MLR (acknowledgment)
deactivate E
activate U
U->>C: Deliver e-invoice
U-->>E: Fetch MLR (accept/reject)
deactivate U
activate E
deactivate E
activate U
U-->U: Generate e-action docment (MLA)
U->>TA: Deliver e-tax report
TA->>U: Receive e-tax report result
deactivate U
activate E
U->>E: Fetch inbound eMLR (signed accept/reject from Tax Admin)
U-->>E: Fetch MLA (unsigned e-action)
deactivate E
Receiving invoices (customer)
Flow between ERP system and Unimaze for inbound flow using MLR response messages.
Processing the content of MLR and eMLR documents is optional before marking them as delivered (imported), but at least pay attention to the final statuses AP (accept) and RE (reject).
sequenceDiagram
autonumber
participant E
participant U
participant C
participant TA
box Invoice receiver
participant E as ERP (Customer)
end
box Access Point & External systems
participant U as UNIMAZE
participant C as ERP (Supplier)
participant TA as Tax Admin
end
activate U
C->>U: Receive e-invoice
U->>E: Fetch Invoice/Credit Note (acknowledgment)
deactivate U
activate E
deactivate E
activate U
U-->U: Generate e-action docment (MLA)
U->>TA: Deliver e-tax report
TA->>U: Receive e-tax report result
U->>E: Fetch inbound eMLR (signed accept/reject from Tax Admin)
deactivate U
activate E
U-->>E: Fetch MLA (unsigned e-action)
deactivate E
Register a payment (supplier)
The supplier must register the payment of an invoice, full or partial payments, once received.
The flow between ERP system and Unimaze is as described below.
sequenceDiagram
autonumber
participant E
participant U
participant TA
box Invoice issuer
participant E as ERP (Supplier)
end
box Access Point & External systems
participant U as UNIMAZE
participant TA as Tax Admin
end
activate E
E->>U: POST /register-payment
deactivate E
activate U
U-->U: Generate e-action docment (MLA)
U->>TA: Deliver e-tax payment registration
TA->>U: Receive e-tax payment registration result
deactivate U
activate E
U->>E: Fetch inbound eMLR (signed accept/reject from Tax Admin)
U-->>E: Fetch MLA (unsigned e-action)
deactivate E
Register a rejection (customer)
The customer must report to the Tax Administration any invoices that are rejected.
The supplier learns about the rejection: it arrives as an inbound billing response, and the invoice's
lifecycleStatusbecomesrejected. See On the supplier side.
The flow between ERP system and Unimaze is as described below.
sequenceDiagram
autonumber
participant E
participant U
participant TA
box Invoice receiver
participant E as ERP (Customer)
end
box Access Point & External systems
participant U as UNIMAZE
participant TA as Tax Admin
end
activate E
E->>U: POST /register-rejection
deactivate E
activate U
U-->U: Generate e-action docment (MLA)
U->>TA: Deliver e-tax rejection registration
TA->>U: Receive e-tax rejection registration result
deactivate U
activate E
U->>E: Fetch inbound eMLR (signed accept/reject from Tax Admin)
U-->>E: Fetch MLA (unsigned e-action)
deactivate EUpdated 8 days ago
