Send and receive e-invoice
This section explains how e-invoices are sent and received within the Peppol Connect API.
The actual sending and receiving of e-invoices within the Peppol Network take place between C2 and C3, as shown in the diagram below.
Since an Access Point can function as both a Sender and a Receiver, this section provides a general explanation for both sending and receiving.
The first step in sending is to identify which SMP the receiver's endpoint is registered with.
1. Constructing the URL
To identify the SMP where the receiver's endpoint is registered, a URL is constructed as follows. For example, ID-VALUE, ID-SCHEME, and SML-ZONE-NAME can be represented as 0188:[corporate number], iso6523-actorid-upis, and acc.edelivery.tech.ec.europa.eu, respectively.
"http://B-" + hexstring(md5(lowercase(ID-VALUE))) + "." + ID-SCHEME + "." + SML-ZONE-NAME
The constructed URL is resolved to an IP address through DNS, which points to the SMP where the receiver’s endpoint is registered(e.g http://smp.e-invoice.moneyforward.com ).
2. Retrieving Document Types
By appending the Peppol ID (/iso6523-actorid-upis::0188:[法人番号]
) to the above URL, a list of supported document types can be retrieved:
"http://B-" + hexstring(md5(lowercase(ID-VALUE))) + "." + ID-SCHEME + "." + SML-ZONE-NAME + "/" + "iso6523-actorid-upis::0188:[法人番号]"
3. Retrieving the Invoice Destination
Finally, by appending services/documentTypeID
to the URL, the endpoint for the document receiver can be retrieved. The Access Point completes the invoice sending process by transmitting the document to this endpoint:
"http://B-" + hexstring(md5(lowercase(ID-VALUE))) + "." + ID-SCHEME + "." + SML-ZONE-NAME + "/" + "iso6523-actorid-upis::0188:[法人番号]" + "/" + "services/" + "[documentTypeID]"
4. Storing Received Invoices
In Peppol Connect, received documents in XML format are not stored directly on the Access Point. Instead, they are stored by another microservice. These can be retrieved via the Peppol Connect API or through a registered Webhook URL using Peppol Connect Webhooks.