Working with e-invoicesReceiving e-invoices

Receiving e-invoices

Polling, paging, XML download and acknowledge.

This section describes the SAPI-compliant way in which the client system retrieves eInvoices received via the Doklado SAPI+ API. Receiving documents is designed as a polling workflow: the client first obtains a list of available documents, then downloads the details of the selected document and, after successful processing, confirms the download via acknowledge.

The listing of documents does not mean their processing or acceptance in the client system. The document is considered processed only after a successful call to acknowledge.

When processing, follow the cursor nextPageToken; do not use document order as a substitute for a cursor.

Basic rules:

  • the client reads documents in the organizational context of the X-Peppol-Participant-Id header,
  • list endpoint returns only metadata and pagination,
  • The XML content of the document is downloaded separately via the detail endpoint,
  • acknowledge is called only after the document has been successfully saved or processed in the client system,
  • polling remains a mandatory fallback even when using webhooks.

Endpoint - List of received documents

Status: Implemented, Deployed: Sandbox

GET /v1/sapi/document/receive
Authorization: Bearer <access_token>
X-Peppol-Participant-Id: <participant_id>

The endpoint returns a paged list of received documents available for the given participant_id.

Query parameters:

ParameterMandatoryDescription
pageTokennoA cursor token for the next page. The value is taken from nextPageToken previous answer.
limitnoNumber of results per page. The default value is 20, the maximum value is 100.
statusnoFilter by document status. Supported values: RECEIVED, ACKNOWLEDGED.

Successful response: HTTP 200

{
  "documents": [
    {
      "documentId": "doc_01HX0000000000000000000000",
      "clientDocumentId": "INV-2026-0001",
      "documentTypeId": "urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::Invoice##urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0::2.1",
      "processId": "urn:fdc:peppol.eu:2017:poacc:billing:01:1.0",
      "senderParticipantId": "0245:1234567890",
      "receiverParticipantId": "0245:9876543210",
      "receivedAt": "2026-05-11T12:00:05Z",
      "status": "RECEIVED",
      "payloadFormat": "XML"
    }
  ],
  "nextPageToken": "eyJjdXJzb3IiOiJuZXh0In0"
}

Response body:

FieldTypeDescription
documentsarrayList of objects DocumentMetadata.
nextPageTokenstringA cursor token for the next page. The field is missing or present null, if there is no next page.

The definition of the DocumentMetadata object is common to both sending and receiving documents.

Paging:

  • the client processes all items from the current response,
  • if the response contains nextPageToken, it will be used as pageToken in the next call,
  • if nextPageToken is not present, the current polling cycle is terminated.

Endpoint - Detail of the received document

Status: Implemented, Deployed: Sandbox

GET /v1/sapi/document/receive/{documentId}
Authorization: Bearer <access_token>
X-Peppol-Participant-Id: <participant_id>

The endpoint returns the metadata and XML content of one received document.

Path parameters:

ParameterMandatoryDescription
documentIdyesThe document identifier from the field documents[].documentId.

Successful response: HTTP 200

{
  "metadata": {
    "documentId": "doc_01HX0000000000000000000000",
    "clientDocumentId": "INV-2026-0001",
    "documentTypeId": "urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::Invoice##urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0::2.1",
    "processId": "urn:fdc:peppol.eu:2017:poacc:billing:01:1.0",
    "senderParticipantId": "0245:1234567890",
    "receiverParticipantId": "0245:9876543210",
    "receivedAt": "2026-05-11T12:00:05Z",
    "status": "RECEIVED",
    "payloadFormat": "XML"
  },
  "payload": "<?xml version="1.0" encoding="UTF-8"?><Invoice>...</Invoice>",
  "payloadFormat": "XML",
  "payloadEncoding": "UTF-8",
  "checksum": "5f70bf18a086007016aaf1828a0972a2c1f8eec3e7c891944dfb2f7f3f4f1b55"
}

Response body:

FieldTypeDescription
metadataobjectObject DocumentMetadata with document metadata.
payloadstringDocument content as UTF-8 XML. The payload is returned in the form in which it is intended for delivery to the client.
payloadFormatstringFor the SAPI-compatible layer, the value XML.
payloadEncodingstringPayload encoding, by default UTF-8.

Downloading a detail by itself does not change the status of the document to ACKNOWLEDGED. The client can download the detail repeatedly until the document is confirmed via acknowledge.

Endpoint - Confirmation of receipt

Status: Implemented, Deployed: Sandbox

POST /v1/sapi/document/receive/{documentId}/acknowledge
Authorization: Bearer <access_token>
X-Peppol-Participant-Id: <participant_id>

Operation acknowledge will confirm that the client system has successfully received and processed the document into its own storage or workflow. After successful confirmation, the document is set to the state ACKNOWLEDGED.

The operation is idempotent. Calling acknowledge again for an already confirmed document will return a successful response with a status of ACKNOWLEDGED.

Path parameters:

ParameterMandatoryDescription
documentIdyesThe document identifier from the field documents[].documentId.

Successful response: HTTP 200

{
  "documentId": "doc_01HX0000000000000000000000",
  "status": "ACKNOWLEDGED",
  "acknowledgedDateTime": "2026-05-11T12:05:30Z"
}

Response body:

FieldTypeDescription
documentIdstringIdentifier of the confirmed document.
statusstringAfter successful confirmation, the value ACKNOWLEDGED.
acknowledgedDateTimedatetimeConfirmation time in ISO 8601.

The client should not call acknowledge if the document could not be saved, validated or submitted for internal processing. In that case, the document remains available in state RECEIVED and the client can process it in the next polling cycle.

Received document statuses

StatusDescription
RECEIVEDThe document has been received by Doklado and is available to the client. The client has not yet confirmed it via acknowledge.
ACKNOWLEDGEDThe client confirmed the successful download of the document. By default, the document is not returned when filtering status=RECEIVED.

Recommended client behavior:

  1. Call GET /v1/sapi/document/receive?status=RECEIVED.
  2. Call GET /v1/sapi/document/receive/{documentId} for each document from the list.
  3. Save or process the XML payload in your own system.
  4. Call POST /v1/sapi/document/receive/{documentId}/acknowledge only after successful processing.
  5. Continue to the next page using nextPageToken until there are no more pages.

Receiving error states

HTTPCause and solution
400Invalid request, invalid pageToken, invalid value limit or an unsupported value status.
401Invalid or expired token. The client must renew the token or obtain a new one.
403The client is not authorized to read documents for the specified X-Peppol-Participant-Id.
404Document according to documentId does not exist or does not belong to the client's organizational context.
409The document is not in a state that allows the requested operation.
429Call limit exceeded. Look rate limits according to endpoints.
500Internal error Doklado.
503Temporary unavailability of dependent service or receiving infrastructure.

Repeated processing

Identify the document by documentId assigned by Doklado and recognize already saved documents. When notifying document.received, take it from data.documentId; it can be a document ID (expense) or a company file (organizationFile). Consider the identifier as an opaque string and use it without modification in the detail as well as acknowledge. If the save succeeds but the confirmation fails, on the next receipt, do not create a duplicate and repeat the confirmation. Do not use another company's cursor when changing the organizational context.

The current Swagger lists the order by time of acceptance in ascending order, from the oldest documents. Build the integration on cursor pagination: for the next page, always pass an unchanged nextPageToken in the pageToken parameter, not a date or custom order guess.