API Flows

Outbound document flow

Within this flow, the client system interacts with the Marosa API to generate and issue a document to the customer or to the appropriate tax authority according to the provided country code.

The client system must implement a periodic mechanism to obtain document status updates. This may be accomplished either through the filtered and paginated listing endpoint (as shown in the diagram below) or by invoking the individual Get Document endpoint using the document ID returned during the processing request.

The Marosa API offers two distinct issuance flows, which are detailed below.

Onbound single document

The API supports single document issuance via the POST /document endpoint, which accepts documents in JSON or UBL 2.1 format.

Upon successful validation, the document is asynchronously routed to the Marosa system for processing and submission. The total processing time may vary according to the destination country, applicable status workflows, and other operational factors.

The diagram below outlines the document processing workflow, including client-side polling for documents ISSUED in Error or OK status and the optional download of the corresponding document file.

Document may be retrieved in various formats, including PDF and XML.

Customer Systeminvoicing-apiMarosa Core SystemLoop on regular scheduleLoop over OK status if pdf neededPOST /v1.1/documentjson / UBL2.1200 OK + document_iddocument-createGET /v1.1/documentsStatus:{OK,ERROR}, flow:ISSUEDretrieve list filteredlistList of documentsGET /v1.1/documentpdf requestget pdf filepdfdocument pdf

Onbound document batch

The API enables batch document processing via the POST /batch endpoint. Clients must submit a list of documents to be processed within the request payload.

Each document undergoes validation. Upon successful validation, the system generates a batch event and one document-create event per document, which are dispatched to the Marosa core system for asynchronous processing.

The diagram below outlines the document processing workflow, including client-side polling for documents ISSUED in Error or OK status, using the batch id and the optional download of the corresponding document file.

Document may be retrieved in various formats, including PDF and XML.

Customer Systeminvoicing-apiMarosa Core SystemLoop on regular scheduleLoop over OK status if pdf neededPOST /v1.1/batchjson200 OK + batch_iddocument-create + batch-createGET /v1.1/documentsStatus:{OK,ERROR}, flow:ISSUED, batchNumber: $batchIdretrieve list filteredlistList of documentsGET /v1.1/documentpdf requestget pdf filepdfdocument pdf

Inbound document flow

In the incoming (received) documents flow, documents addressed to the company are delivered via polling or webhook, depending on the integration model implemented for the respective country.

Once these invoices are registered in the Marosa system, the client must periodically retrieve invoices in Error or OK status within the RECEIVED flow, following the same polling mechanism described earlier for issued invoices.

Inbound document

The diagram below outlines the document processing workflow, including client-side polling for documents RECEIVED in Error or OK status and the optional download of the corresponding document file.

Document may be retrieved in various formats, including PDF and XML.

Customer Systeminvoicing-apiMarosa Core SystemConnectorCountryLoop on regular scheduleLoop over OK status if pdf neededpolling/webhookdocument-receiveGET /v1.1/documentsStatus:{OK,ERROR}, flow:RECEIVEDretrieve list filteredlistList of documentsGET /v1.1/documentpdf requestget pdf filepdfdocument pdf