Skip to main content

Overview

In a self-billing arrangement, the buyer issues the invoice in the name of the supplier. This guide shows how to create and receive self-billing invoices and self-billing credit notes, and how to create debit notes.

Document types

The document_type field accepts five values. The guides for invoices and credit notes cover the first two. This guide covers the other three.

What self-billing is

In a self-billing arrangement, the buyer issues the invoice on behalf of the supplier. The supplier and the buyer agree on this arrangement before the first document is issued. The roles in the document do not change. The supplier is still the seller, and the buyer is still the party that pays. Only the issuer changes.
Do not swap the parties to make the document look like a normal invoice. In a self-billing document, your company is in the customer_* fields and the supplier is in the vendor_* fields.

Ownership rule

The API derives two Peppol IDs from each document: one from the vendor_* identifiers and one from the customer_* identifiers. It then checks that your company owns one of them. The Peppol IDs of your company are in the peppol_ids field of GET /api/me/. The comparison ignores letter case and surrounding spaces. If the check fails for a self-billing document, POST /api/documents/ returns 406 Not Acceptable:
POST /api/documents/{document_id}/send does the same check and returns 409 Conflict with the same detail text.
The word “receiver” in this message refers to the party in the customer_* fields. The message means that the customer in your self-billing document is not your company. The most frequent cause is that the vendor and the customer are in the usual invoice order.
For the other three document types, the message is Derived sender '<scheme>:<id>' is not in tenant peppol_ids, and it refers to the party in the vendor_* fields.

Create a self-billing invoice

In this example, E-INVOICE BV (BE1018265814) is the buyer and issues the invoice. OpenPeppol VZW (BE0848934496) is the supplier. Save the payload as self-billing-invoice.json:
self-billing-invoice.json
The payment details in a self-billing invoice are those of the supplier, because the supplier receives the payment.
1

Validate the JSON

Validation is not a separate mandatory call. POST /api/documents/ rejects a payload that does not pass the same rules. Use POST /api/validate/json while you develop, because it returns all rule failures and the generated UBL.
The API returns 201 Created:
The API validates self-billing documents against a dedicated rule set, the Peppol BIS Self-Billing 3.0 schematron (PEPPOL-EN16931-UBL-SB), in place of the Peppol BIS Billing 3.0 schematron. The schematron field of each entry in issues shows the rule set that reported the issue.This endpoint does not apply the ownership rule. A payload can pass validation here and still get a 406 response when you create the document.
2

Create the document

The customer_tax_id must resolve to a Peppol ID of the company that owns the API key.
cURL
Response (201 Created, shortened):
3

Send the document

cURL
Response (200 OK, shortened):
Develop and test with a sandbox company. A sandbox company runs in test mode: the API sends each document as UBL XML to the contact email address of the company, and nothing goes to the Peppol network. The API host and the endpoints are the same as for a production company. See Test mode and sandbox companies.
Before you send self-billing documents from a production company, contact support@e-invoice.be to confirm the delivery route to your supplier. The API derives the Peppol sender from the vendor_* fields and the Peppol receiver from the customer_* fields for all document types.

Use the example in a sandbox company

The example uses the identity of E-INVOICE BV as the customer. In your own company, the create call returns 406 until the customer is your company. Replace the customer_* fields with the details of your company:
cURL
Response (shortened):
Set customer_tax_id to a tax number that resolves to one of the peppol_ids values. For a Belgian company, the Peppol ID 0208:0123456789 corresponds to the tax number BE0123456789. See Test mode and sandbox companies.

Generated UBL identifiers

For both self-billing types, the generated UBL contains these identifiers: The supplier stays in cac:AccountingSupplierParty and your company stays in cac:AccountingCustomerParty.
Create self-billing documents from JSON. POST /api/documents/ubl stores an uploaded UBL file as INVOICE or CREDIT_NOTE and does not read the CustomizationID to set a self-billing type.

Check that the supplier can receive self-billing documents

A Peppol participant registers each document type that it can receive. Registration for Peppol BIS Billing 3.0 invoices does not include self-billing documents. Before you send, check the supplier with GET /api/validate/peppol-id:
cURL
Response:
Look in supported_document_types for these entries: If the entries are absent, the supplier cannot receive self-billing documents through Peppol. Ask the supplier to have the self-billing document types registered by its access point.
The response above is an illustration of the response shape. The document types of a real participant can be different.

Self-billing credit notes

Use SELFBILLING_CREDIT_NOTE to correct or cancel a self-billing invoice that your company issued. The parties are the same as in the self-billing invoice: the supplier is the vendor and your company is the customer. The ownership rule is also the same. The differences from the self-billing invoice example are:
Amounts are positive, as in a standard credit note. See Create credit notes for the general rules.

Receive self-billing documents

When your company is the supplier, your buyer can send you self-billing documents. A company that is registered on Peppol through e-invoice.be is registered for the self-billing invoice and the self-billing credit note document types, together with the standard billing document types. The API reads the CustomizationID of each inbound UBL document. If the identifier is a self-billing identifier, the document gets the type SELFBILLING_INVOICE or SELFBILLING_CREDIT_NOTE. In an inbound self-billing document, your company is in the vendor_* fields and the buyer that issued the document is in the customer_* fields. Use the type filter on the inbox to list these documents:
cURL
Response (shortened):
The type filter on GET /api/inbox/, GET /api/outbox/ and GET /api/drafts/ accepts all five document types. In a sandbox company, Simulate inbound applies the same detection: a UBL file with a self-billing CustomizationID appears in the inbox with a self-billing type. See Receive documents for the complete inbound flow.

Debit notes

Set document_type to DEBIT_NOTE to create a debit note. The API handles a debit note in the same way as an invoice, with one difference in the generated UBL: All JSON fields, the totals calculation and the create and send calls are the same as for an invoice. A debit note increases the amount that the customer owes, so the amounts are positive.
Before you create this debit note, replace the vendor fields with the data of your company. Because a debit note is a UBL Invoice in the standard billing profile, a participant that can receive Peppol BIS Billing 3.0 invoices needs no additional registration to receive it.
An inbound UBL invoice with type code 383 appears in the inbox as INVOICE. The API does not derive the DEBIT_NOTE type from the type code of an inbound UBL document.

Frequently asked questions

The party in the customer_* fields of your self-billing document is not your company. In a self-billing document, put your company in the customer_* fields and the supplier in the vendor_* fields. Compare the ID in the message with the peppol_ids field of GET /api/me/.
POST /api/validate/json checks the document content only. The ownership rule applies when you create and when you send the document.
POST /api/documents/ubl stores the document as INVOICE or CREDIT_NOTE. Create self-billing documents from JSON to get a self-billing document type.
Your company. The buyer issued the document, but your company is the supplier, and the supplier is always in the vendor_* fields.

Next Steps

Create credit notes

Correct or cancel a standard invoice.

Receive documents

Process inbound documents, self-billing documents included.

Validation during development

Read validation issues and correct your JSON.

Look up Peppol participants

Check the document types that a participant can receive.