Knowledge Base Logo Knowledge Base

Invoice Webhook API

With the Webhook API, you can automatically create invoices in your own environment. Once the invoices are created, you can easily send them via email, Peppol or by post.

This functionality allows you to set up a custom integration to send Peppol invoices.

⚠️ Note: This feature is exclusively available for Trilly users.

Request headers

Request body

Invoice

Client

Invoice line

Example request payload

[
  {
    "language": "nl",
    "invoice_date": "2025-01-10",
    "expire_days": 14,
    "reference": "Webshop #111",
    "intro": "",
    "remarks": "",
    "private_notes": "Webshop #111",
    "vat_shifted": 0,
    "client": {
      "company_type": "bedrijf",
      "type": "onbekend",
      "title": "TestCompany",
      "email": "info@numnum.be",
      "vat_country_code": null,
      "vat_id": null,
      "first_name": "Wim",
      "last_name": "De Bakker",
      "address": "Markt 1",
      "address_zip": "8000",
      "address_city": "Brugge",
      "address_country": "BE",
      "telephone": ""
    },
    "invoice_lines": [
      {
        "description": "Line 1",
        "unit_price": 10.00,
        "amount": 2.5,
        "vat_percentage": 21.00
      },
      {
        "description": "Line 2",
        "unit_price": 20.00,
        "amount": 5,
        "vat_percentage": 21.00
      },
      {
        "description": "Shipping",
        "unit_price": 20.00,
        "amount": 5,
        "vat_percentage": 21.00
      }
    ]
  }
]

Result

The API will return HTTP 201 if the resource was successfully created; treat all other status codes (200, 403, 500, …) as a failure and place the invoice in a queue for retry later.

HTTP 201 - Invoice created

Returns a list of IDs of the created invoice(s)

[10232,10233]

HTTP 403 - Forbidden

Problem with validation of the Authorization token in the request header

{exception: "Information..."}

HTTP 406 - Failed, validation problem

Returned when there is a problem with the payload validation

{exception: "Information..."}

HTTP 500 - Unexpected problem

HTTP 200 - Unexpected problem

Regular HTTP code. However, this should be treated as “retry” because the API only returns HTTP 201 upon actual creation

Postman

📥 Download via this link a Postman example of the webhook.

Other topics

Getting started
Peppol - General
Peppol - Practical
Invoicing
Account and security
Integrations and export