Deliver your eBills today with the help of our powerful API.

The Dibito REST API allows full integration into your accounting system. Follow this tutorial to get an insight into the possibilities.

Prerequisites

    • You have installed curl or a similar tool locally.
    • You have successfully verified your organization as a biller with Dibito.

You can find programming examples for other programming languages such as Python, Java, C#, Go etc. in the API documentation.

Generate API key

In your Dibito account, go to Dibito -> API key and click on "Generate key".

Generate API key

Give the key a name and make a note of the generated key. This is required for all API requests.

You can generate new keys or delete existing ones at any time.

Create sample calculation

Caution: These test invoices are delivered in the productive eBill portal. Transaction fees will be charged. Use yourself or a person who is informed about the tests as the eBill recipient.

As a first step, you need a sample invoice to test the API. You can generate a suitable test invoice for any eBill recipient directly in Dibito under the "Examples" menu item. Each of the three document variants works with the API:

Generate sample calculations in Dibito

Alternatively, you can also create any invoice with our QR invoice generator. Use the QR-IBAN of your account, set a QR reference number and a valid eBill recipient.

Save the generated QR-bill as a PDF on your computer.

Note: Each reference number can only be submitted once to the eBill portal. You must generate new invoices for further attempts.

Submit invoice as eBill

To submit an invoice in PDF format to the eBill portal, simply use the following curl command:

curl -i -X POST \
  'https://app.dibito.ch/api/v1/business-cases?processingMode=STAGE' \
  -H 'Content-Type: application/pdf' \
  -H 'X-API-Key: YOUR_API_KEY_HERE' \
  -H 'x-filename: qr-invoice.pdf' \
  --data-binary '@/path/to/your/qr-invoice.pdf'

Note: For curl, in this case the @ before the file path is important in order to send the file as binary data.

If successful, your invoice can now be found in Dibito under the business cases provided.

If you wish to submit the invoice directly to the eBill portal after validation by Dibito, change the parameter processingMode to DELIVER:

curl -i -X POST \
  'https://app.dibito.ch/api/v1/business-cases?processingMode=DELIVER' \
  -H 'Content-Type: application/pdf' \
  -H 'X-API-Key: YOUR_API_KEY_HERE' \
  -H 'x-filename: qr-invoice.pdf' \
  --data-binary '@/path/to/your/qr-invoice.pdf'

In this case, a manual activation step is no longer necessary.

Search for invoice recipient

In order to be able to send an invoice to a recipient, the recipient must be validly registered in the system. You can check a registration with an e-mail address as follows:

curl -i -X POST \
https://app.dibito.ch/api/v1/bill-recipients/search \
-H 'Content-Type: application/json' \
-H 'X-API-Key: YOUR_API_KEY_HERE' \
-d '{
  "items": [
    {
      "emailAddress": "hans.muster@example.org"
    }
  ]
}'

The answer in JSON format:

{
  "items": [
    {
      "emailAddress": "hans.muster@example.org",
      "billRecipientSixId": "41234567890123456",
      "activeSubscription": true,
      "enterpriseIdentificationNumber": null,
      "submissionStatus": "ALLOWED"
    }
  ]
}

Explanation: The recipient was found and returned with all available information (in this case their e-mail address and their unique fixed ebillRecipientId).

The flag activeSubscription is true, i.e. this recipient has already registered with your biller.

The submissionStatus is ALLOWED. You can send eBills to this recipient. This status can also be set without logging in to ALLOWED if the recipient allows general delivery of eBills and has set this up in their eBill portal.

Further options

The Dibito API has additional functions:

Do you have any further questions? Please contact us.