Receive an invoice via the API

Receive incoming invoices: configure webhooks, download documents and manage retention.

When an invoice for your organisation arrives via Peppol or another network, the PSB stores the document and sends a notification to your webhook. This article explains how to receive that notification, download the document and set up status management.

Receiving flow

Receiving an invoice involves four steps:

  1. Notification: the PSB sends an InvoiceReceived webhook event to your endpoint
  2. Download: you retrieve the document via the PurchaseInvoice endpoint
  3. Processing: you process the invoice in your own system
  4. Cleanup (optional): you delete the document from the PSB
Configure your webhook

To receive invoices, you need a webhook listening on the InvoiceReceived topic. Register it via the Hook API:

POST /api/v1/hook
{
  "action": "https://mijn-systeem.nl/webhook/invoices#mijnSecretKey",
  "topics": ["InvoiceReceived"]
}

As soon as an invoice arrives, your endpoint receives a POST request with a JSON payload. This payload includes the documentId and the partyId you need to retrieve the document.

Tip: Also set up a webhook on the InvoiceReceivedError topic to receive notifications when something goes wrong during reception.

Download the document

Use the documentId from the webhook payload to retrieve the invoice:

GET /api/v1/{partyId}/purchaseInvoice/{documentId}/download HTTP/1.1
Host: psb.econnect.eu
Authorization: Bearer {access_token}

The response contains the XML document (by default in the original format). Want to receive the document in a different format? Use the targetDocumentTypeId parameter:

GET /api/v1/{partyId}/purchaseInvoice/{documentId}/download?targetDocumentTypeId={URN}

The PSB automatically transforms the document to the specified format before returning it.

Retention policy

The PSB retains received documents according to this schedule:

SituationRetention periodDocument received, not yet downloaded90 daysDocument downloaded7 days after downloadManually deletedDeleted immediately

We recommend retrieving documents immediately after reception and storing them in your own system. Do not rely on the PSB for long-term storage.

Delete a document

After processing, you can manually delete the document:

DELETE /api/v1/{partyId}/purchaseInvoice/{documentId} HTTP/1.1
Host: psb.econnect.eu
Authorization: Bearer {access_token}

This permanently deletes the document from the PSB. The audit trail remains available.

Status management

After reception, you can update the processing status of a purchase invoice. This is particularly relevant if you want to send Invoice Responses (status messages) to the sender. Read the article Send an Invoice Response for more information.

Message Level Status (MLS)

The PSB automatically sends an MLS message (Message Level Status) back to the sending party after receiving a document. This confirms that the document has been received and delivered. As an integrator you don't need to configure anything for this: the PSB handles this completely. If you send documents yourself, you receive MLS feedback via the webhook topic MessageLevelStatusReceived. See Configure webhooks for the configuration.

Polling as an alternative

If you cannot configure webhooks (for example in an on-premise environment without inbound internet traffic), you can also retrieve invoices via polling:

GET /api/v1/{partyId}/purchaseInvoice HTTP/1.1
Host: psb.econnect.eu
Authorization: Bearer {access_token}

This endpoint returns a list of available purchase invoices. However, webhooks are always the preferred method due to real-time processing and lower load on the API.

Note: For on-premise integrations, also consider the reverse webhook (HTTPS inbound hook), which allows the PSB to push documents without your system needing to be directly reachable from the internet.

Best practices
  • Process idempotently: in exceptional cases, the PSB may deliver an event multiple times. Check on your end whether you have already processed a document before importing it again.
  • Download immediately: retrieve documents as soon as possible after the webhook notification. The 90-day retention is a safety net, not a storage strategy.
  • Log the documentId: store the PSB documentId in your own system for tracing and potential troubleshooting.
  • Convert formats: if you need a specific XML format, use targetDocumentTypeId when downloading rather than converting yourself.
  • Webhook retries: if your endpoint is temporarily unreachable, the PSB retries delivery of the notification for up to 5 days. Extended downtime? Use batch hooks as a fallback to retrieve missed documents.
Frequently asked questions
How do I know when an invoice arrives and how do I retrieve the XML?

Register a webhook on the topic InvoiceReceived; the payload includes documentId and partyId among other fields. With those values, call GET /api/v1/{partyId}/purchaseInvoice/{documentId}/download to retrieve the XML document. Optionally, you can use targetDocumentTypeId to receive a transformed format.

What are the retention periods for incoming invoices in the PSB?

A received document that you have not yet downloaded remains available for up to 90 days. After download, it is kept for another 7 days; manual deletion removes the document immediately from the PSB. Store copies in your own system, as the PSB is not a long-term archive.

Can I retrieve invoices without webhooks?

Yes, by polling via GET /api/v1/{partyId}/purchaseInvoice you get a list of available purchase invoices. Webhooks remain the preferred method for real-time processing and less load on the API; for on-premise setups without inbound internet, you can also consider a reverse webhook.


View the full PurchaseInvoice endpoints and response models at psb.econnect.eu.

Open the API reference