# Tutorial: Receiving Invoices

This page describes the steps necessary to receive invoices using the PurchaseInvoice endpoint.

ReceiveInvoiceDiagram

# Prerequisite

  • Your partyId is registered by us in Peppol with Invoices support. If you have the sufficient rights you could use the Peppol endpoint the register the partyId in Peppol. Otherwise contact us.

# Step 1: Register hook

In order to receive a document, you'll need to subscribe to the "InvoiceReceived" webhook. For this example, we are going to use a mailhook. Use the PUT hook API call as shown below. In topics you can specify for which events you wish to receive a webhook.

WebhookParameters

Example body:

{
  "id": "1",
  "name": "mail hook",
  "action": "mailto:example@econnect.eu",
  "topics": [
    "InvoiceReceived"
  ],
  "isActive": true
}

If you want to use a webhook instead, you can use something like "action": "https://user:pass@webhook.site/a81a0be5-8aad-4110-a40c-aa41a2c6e9ac#secureKey" instead. More information regarding webhooks can be found on the hooks page

# Step 2: Ping

An easy way to test the 'InvoiceReceived' hook is to use GET /api/v1/{partyId}/hook/ping. Calling this endpoint will send a dummy invoice to the specified partyId and trigger the 'InvoiceReceived' hook.

# Step 3: Download the invoice

We are going to use the mailhook for now. When you receive an invoice, you should receive something like the text below in your email inbox from either noreply@everbinding.nl or noreply@econnect.eu.

InvoiceReceived for NL:KVK:12345678
Message: 'Invoice' received.
DocumentId: 0d0167cb-72f1-4656-801b-17ff3a6ddb59
NotificationId: 2c25778f-2560-49bf-aac2-882c6fcb2fc4
EventId: 56b97522-7e9e-45d6-9b98-43634ee06a9b

With the DocumentId you got from the mailhook, call the purchaceInvoice/download API. Let's use the DocumentId and our partyId to download our invoice.

DownloadParameters

In the response you'll find the invoice document:

# Example of a webhook request

© 2024 eConnect International B.V.