API guidese-invoices via Peppol

e-invoices via Peppol

Create a draft eInvoice, attach attachments, finalize it and track delivery via Doklado Public API.

Doklado Public API allows you to create an eInvoice from your system data and send it via Peppol. This tutorial uses the API key in the api_key header. Access settings can be found in authentication.

Prepare environment and identifiers

The organization must have activated sending via Peppol.

The creation of a draft eInvoice also depends on the supported domestic type of issued invoice and the customer's participation in Peppol. If the organization requires approval, the invoice must be approved before sending.

Operations issuing eInvoices, finalizing, sending and working with attachments use internal Doklado organization ID, not company identification number (IČO). In the examples, replace INTERNAL_ORGANIZATION_ID with this internal ID. The description of the Invoicing section refers to getting the ID via POST /v3/organization/manage/list, but its output schema refers to organizationId as company identification number (IČO). For v2, use a verified internal ID. If you don't have it, verify it with support Doklado.

IdentifierWhat is it for?
organizationIdInternal ID of the organization when issuing via v2, finalizing, sending and working with attachments.
documentIdInvoice ID returned when issuing via v2.
deliveryIdSubmission ID returned when sending via Peppol. It serves to check the status.
uploadPathThe path of the uploaded file returned when the signed URL is obtained.

The following examples are standalone cURL commands for the sandbox. In each example, replace YOUR_SANDBOX_API_KEY with your sandbox API key and sample identifiers with custom values.

For production, use the production base address from API overview and API key for production.

Select the issuing mode

data.invoiceCreationModeDesired result
PDFClassic numbered invoice without Peppol document. You can get the PDF by a separate call.
EINVOICE_DRAFTdraft eInvoice without an assigned number. You complete the attachments before finalization.
EINVOICE_FINALIZE_AND_SENDCreation of draft eInvoice, finalization and attempt to send in one call.

If you skip the mode, the organization settings will decide. The description of the current API states that as of 1. 1. 2027 the mandatory branch of the eInvoice is used and the choice of mode is ignored.

Always evaluate the actual result: data.issueMode is classic, einvoice_draft, or einvoice_sent. When requesting both creation and sending, data.peppolSendSkipped: true can mean that a classic invoice was created without sending via Peppol. Also check for possible bisValidationErrors.

1. Create a draft eInvoice

Call POST /v2/documents/invoice-issue. The following example assumes a VAT payer supplier, the relevant rate for the sample service and a customer capable of receiving eInvoices. company identification number (IČO), replace both the rate and item data with your own data.

curl --request POST \
  --url https://doklado-einvoice-sandbox-cga5r5w8.ew.gateway.dev/v2/documents/invoice-issue \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --header 'api_key: API_KEY' \
  --data '{
  "data": {
    "organizationId": "ORGANIZATION_ID",
    "type": "issued_invoice",
    "issueDate": "2026-11-18",
    "dueDate": "2026-11-30",
    "accountingSettings": {
      "numericCodeId": "OF"
    },
    "customer": {
      "name": "Songoroo s.r.o.",
      "ico": "50797905",
      "taxIdentificationNumber": "2120495817",
      "icDph": "SK2120495817",
      "vatPayer": true,
      "streetName": "Testovacia",
      "buildingNumber": "1",
      "postalCode": "81101",
      "municipality": "Bratislava",
      "countryCode": "sk"
    },
    "paymentInfo": {
      "iban": "SK4481800000007000458734"
    },
    "items": [
      {
        "name": "Testovacia polozka 1",
        "quantity": 1577.33,
        "unitPriceWithVat": 1.0479,
        "vatRate": 23,
        "unit": "ks"
      },
      {
        "name": "Testovacia polozka 2",
        "quantity": 13.37,
        "unitPriceWithVat": 0.1479,
        "vatRate": 0,
        "unit": "ks",
        "taxCategoryCode": "AE",
        "vatexCode": "VATEX-EU-AE",
        "taxRuleReason": "Prenos danovej povinnosti",
        "additionalProperties": {
          "XXX": "YYY" 
        }
      }
    ],
    "noteAboveItems": "test eInvoice",
    "invoiceCreationMode": "EINVOICE_FINALIZE_AND_SEND"
  }
}'

Check the HTTP status and success. Save data.documentId. For draft eInvoice, invoiceNumber is empty. If you need specific number sequences, set data.accountingSettings.numericCodeId according to the configuration of the organization.

Prices and VAT of items

When issuing via v2, send one price input. It has priority for several totalPriceWithVat, then unitPriceWithVat, then unitPriceWithoutVat. Prices with VAT require vatRate. It is the default when issuing quantity: 1. Pri modification of an existing invoice specify the quantity.

taxCategoryCodeMeaning
SStandard rate
AETransfer of tax liability
EExemption
KIntra-community supply
ZZero rate
GExport outside the EU
OOutside the scope of VAT

The category of the item takes precedence over the category of the entire invoice. In the eInvoice of the VAT payer, the item with a 0% rate must have an explicit category. vatRate: 0 alone is not sufficient to determine the mode.

taxRuleReason has a limit of 100 characters. Category E requires it, S and Z must not contain it. Optional vatexCode must match the category. For AE you can also use data.customVatReverseChargeText up to 200 characters.

Item additionalProperties is a map name → text, maximum 50 properties. The name can have a maximum of 128 characters and a value of 1 to 1024 characters. During finalization, they are transferred to BIS XML. You can complete the buyer via customerReference (BT-10), the order via orderReference (BT-13).

2. Attach attachments

If the attachment is to be part of the resulting XML, attach it before finalization. The procedure has three separate steps.

Get the upload URL

Call POST /v2/documents/invoice-attachments/upload-url for each file:

curl --request POST --fail-with-body --silent --show-error \
  'https://doklado-einvoice-sandbox-cga5r5w8.ew.gateway.dev/v2/documents/invoice-attachments/upload-url' \
  --header 'api_key: YOUR_SANDBOX_API_KEY' \
  --header 'Content-Type: application/json' \
  --header 'Accept: application/json' \
  --data-raw '{
  "data": {
    "organizationId": "INTERNAL_ORGANIZATION_ID",
    "documentId": "DOCUMENT_ID_FROM_ISSUE_RESPONSE",
    "fileName": "priloha.pdf"
  }
}'

From data, take uploadUrl, uploadPath, bucket and expiresAt. Use documentId to identify the target. The scheme also supports the alternative organizationFileId, with documentId taking precedence.

Upload the file to the repository

In the following command, replace FULL_DATA_UPLOAD_URL_VALUE with the full value of data.uploadUrl without modification and send the file before expiresAt expires:

curl --request PUT --fail-with-body --silent --show-error \
  --upload-file './priloha.pdf' \
  'FULL_DATA_UPLOAD_URL_VALUE'

Do not send the api_key header on this call. The signed URL contains the authorization. A successful upload returns HTTP 200 with an empty body. No JSON or Base64 is sent. Do not create the URL manually.

Attach the uploaded file to the invoice

Only after successful upload call POST /v2/documents/invoice-attachments/add. Replace the values bucket and fileNames with the data from the obtained URL:

curl --request POST --fail-with-body --silent --show-error \
  'https://doklado-einvoice-sandbox-cga5r5w8.ew.gateway.dev/v2/documents/invoice-attachments/add' \
  --header 'api_key: YOUR_SANDBOX_API_KEY' \
  --header 'Content-Type: application/json' \
  --header 'Accept: application/json' \
  --data-raw '{
  "data": {
    "organizationId": "INTERNAL_ORGANIZATION_ID",
    "documentId": "DOCUMENT_ID_FROM_ISSUE_RESPONSE",
    "bucket": "BUCKET_FROM_UPLOAD_URL_RESPONSE",
    "fileNames": ["UPLOAD_PATH_FROM_UPLOAD_URL_RESPONSE"]
  }
}'

fileNames contains the returned paths uploadPath, not the original filenames or signed URLs. Multiple uploaded files can be attached at once. Endpoint also supports a finalized invoice, but the already created eInvoice XML attachment cannot be replaced.

3. Finalize the draft eInvoice

POST /v2/documents/invoice-finalize assigns a number, sets the actual issuing date, creates and saves the final Peppol BIS 3.0 XML and makes the invoice available for export:

curl --request POST --fail-with-body --silent --show-error \
  'https://doklado-einvoice-sandbox-cga5r5w8.ew.gateway.dev/v2/documents/invoice-finalize' \
  --header 'api_key: YOUR_SANDBOX_API_KEY' \
  --header 'Content-Type: application/json' \
  --header 'Accept: application/json' \
  --data-raw '{
  "data": {
    "organizationId": "INTERNAL_ORGANIZATION_ID",
    "documentId": "DOCUMENT_ID_FROM_ISSUE_RESPONSE",
    "includeAllAttachments": true
  }
}'

includeAllAttachments overrides the organization setting for the given invoice. If you omit the field, the organization setting will decide.

The invoice number is selected in the following order: invoiceNumber explicitly entered during finalization → number entered when creating a draft eInvoice → number from the previous attempt at finalization → the next number of the saved number sequences. Optional variableSymbol overwrites the variable symbol. Otherwise, it is derived from the invoice number.

Save data.invoiceNumber and data.peppolStatus from the successful response. Finalization itself does not send the invoice.

4. Send the eInvoice

After successful completion use POST /v2/documents/invoice-send:

curl --request POST --fail-with-body --silent --show-error \
  'https://doklado-einvoice-sandbox-cga5r5w8.ew.gateway.dev/v2/documents/invoice-send' \
  --header 'api_key: YOUR_SANDBOX_API_KEY' \
  --header 'Content-Type: application/json' \
  --header 'Accept: application/json' \
  --data-raw '{
  "data": {
    "organizationId": "INTERNAL_ORGANIZATION_ID",
    "documentId": "DOCUMENT_ID_FROM_ISSUE_RESPONSE"
  }
}'

Save the returned data.deliveryId. This is the shipment identifier that you will use when tracking the status. HTTP 200 when sent does not yet confirm delivery to the participant.

If you do not need to add attachments or insert your own check between the steps, you can choose EINVOICE_FINALIZE_AND_SEND when issuing. Even then, verify the resulting issueMode, deliveryId, peppolSendSkipped and any errors.

5. Check delivery

POST /v2/documents/invoice-send-status only uses deliveryId. organizationId does not require:

curl --request POST --fail-with-body --silent --show-error \
  'https://doklado-einvoice-sandbox-cga5r5w8.ew.gateway.dev/v2/documents/invoice-send-status' \
  --header 'api_key: YOUR_SANDBOX_API_KEY' \
  --header 'Content-Type: application/json' \
  --header 'Accept: application/json' \
  --data-raw '{
  "data": {
    "deliveryId": "DELIVERY_ID_FROM_SEND_RESPONSE"
  }
}'

The answer separates the delivery of a business document from tax reporting:

Part of the answerWhat it tracks
data.delivery.statusThe overall invoice delivery status, for example QUEUED, PROCESSING, SENT, DELIVERED_CONFIRMED, DELIVERED_UNCONFIRMED, REJECTED or FAILED.
data.delivery.transportTransfer of the document and possible repetition. It contains, for example nextRetryAt and failure.
data.delivery.mlsMLS confirmation or rejection, possible reasons and receipts identifier.
data.taxReportingA separate result of tax reporting, for example ACCEPTED, ACCEPTED_UNCONFIRMED, REJECTED, FAILED or NOT_REQUIRED.

Confirmation of transmission is not identical to confirmation of delivery, and delivery of an invoice does not confirm the success of tax reporting. Evaluate both results and their nested errors. Full state values are in the reference.

Load the status with a reasonable distance and a limited number of repetitions. After the issuing or sending timeout, first check the status of the already created invoice. Do not automatically send a new request. For details, see Errors and Retry Requests.

6. Get the XML or other attachments

Use POST /v2/documents/invoice-attachments/get. Filter peppol_document selects stored BIS XML:

curl --request POST --fail-with-body --silent --show-error \
  'https://doklado-einvoice-sandbox-cga5r5w8.ew.gateway.dev/v2/documents/invoice-attachments/get' \
  --header 'api_key: YOUR_SANDBOX_API_KEY' \
  --header 'Content-Type: application/json' \
  --header 'Accept: application/json' \
  --data-raw '{
  "data": {
    "organizationId": "INTERNAL_ORGANIZATION_ID",
    "documentId": "DOCUMENT_ID_FROM_ISSUE_RESPONSE",
    "attachmentType": "peppol_document"
  }
}'

You load the available invoice attachments without a filter. For XML, the attachment contains downloadUrl pointing directly to the file. For PDF, use POST /v1/documents/get-invoice-pdf, which also supports deliveryId.

More information

  • Endpoint overview contains all current operations.
  • issued invoices also describe classic issuing, editing, PDF and sending by e-mail.
  • Pricing lists the consumption of individual operations and accounting rules.

Source of technical parameters: Doklado OpenAPI specification.