Skip to main content

Sending an Invoice

EHF Billing 3.0

EHF (Elektronisk Handelsformat) is the Norwegian format for electronic invoicing, maintained by the Norwegian Digitalisation Agency (Digdir).

EHF Billing 3.0 is a national extension of the Peppol BIS Billing 3.0: every EHF document is also a valid Peppol BIS Billing 3.0 document, with some additional Norwegian rules on top. Take a look here to get information on the Norwegian rules.

Check out the official documentation to get more information about the structure

To send a document, you can choose to build a standard XML UBL 2.1 document or a JSON payload.

In both cases the endpoints are:

  • POST /invoices for invoices
  • POST /credit-notes for credit notes

If the platform cannot manage the document, you will get a response with a body describing the error in JSON and a status code:

  • HTTP 422 in case the validation fails.
  • HTTP 403 in case your account is not enabled for Norway.
  • HTTP 500 in case of a general error server side.

If everything is fine and the validation passes, you will receive an HTTP 202 status and the document resource (with its own unique identifier uuid) as the response. The document has been accepted and prepared for the dispatching through the Peppol network.

The JSON response you will receive contains some useful information:

{
"uuid": "9a163ebe-fb45-4b10-aac3-d5bad66acf40",
"direction": "outgoing",
"format": "UBL 2.1 XML",
"number": "0997462625",
"date": "2019-04-01",
"sender": {
"name": "Havblikk Nett AS",
"identifier": "811143758"
},
"recipient": {
"name": "Buyer AS",
"identifier": "hn0073648"
},
"createdAt": "2026-10-02T14:22:32+00:00",
"downloaded": false,
"peppolMessage": {
"uuid": "282c6c79-9306-421a-8210-2453f03bf52d",
"createdAt": "2026-10-02T14:22:32+00:00",
"requestSentAt": null,
"responseReceivedAt": null,
"success": null,
"errorCode": null,
"errorMessage": null
}
}

Within a short period of time it will be traveling towards the document recipient. Once delivered, you will get notified to your configured webhook.

You can also monitor and download metadata information about the document with GET /invoices/{uuid} (or GET /credit-notes/{uuid}). The original document can be downloaded with GET /invoices/{uuid}/source and a printed version with GET /invoices/{uuid}/print.

Check the recipient​

Before sending a document, you can check if the recipient is registered into the Peppol Network with GET /smpquery/{participantId}, where {participantId} is the recipient Peppol identifier (i.e., 0192:987654325).

You will receive an HTTP 200 with the list of the document types the recipient can receive, or an HTTP 404 if the recipient is not registered.

The validation process​

The validation is performed real-time during the API HTTP request.

The Norwegian endpoints accept only EHF Billing 3.0 documents, so you must use the following values within your document:

<cbc:CustomizationID>urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0#conformant#urn:fdc:anskaffelser.no:2019:ehf:forward-billing:3.0</cbc:CustomizationID>
<cbc:ProfileID>urn:fdc:anskaffelser.no:2019:ehf:postaward:g3:08:1.0</cbc:ProfileID>

If you send a document with a different customization (i.e., a plain Peppol BIS Billing 3.0 document), it will be refused with an HTTP 422 and the message The document is of a type different than what is specified for this endpoint.

The document is then validated against the EHF Billing 3.0 ruleset. It follows an example of validation error response.

{
"status": 422,
"violations": [
{
"propertyPath": "/:Invoice[1]/cac:LegalMonetaryTotal[1]",
"message": "Amount due for payment (BT-115) = Invoice total amount with VAT (BT-112) -Paid amount (BT-113) +Rounding amount (BT-114).",
"code": "BR-CO-16"
}
],
"detail": "/:Invoice[1]/cac:LegalMonetaryTotal[1]: Amount due for payment (BT-115) = Invoice total amount with VAT (BT-112) -Paid amount (BT-113) +Rounding amount (BT-114).",
"type": "/validation_errors/BR-CO-16",
"title": "An error occurred"
}

The propertyPath indicates the XML node where the error has been found, the message describes the error and the code is the specific validation rule that has been violated.

XML UBL 2.1​

In this case you must send the HTTP header Content-Type: application/xml and the request body must contains the raw XML.

UBL (Universal Business Language) OASIS (ISO/IEC 19845) is an International Standard. UBL defines a royalty-free library of standard electronic XML business documents such as purchase orders and invoices.

JSON UBL 2.1​

In case you do not want to manage the XML format, you can send documents in JSON. In this case you must send the HTTP header Content-Type: application/json. The structure and the naming are the same of the official XML, except for the case of XML attributes which is a concept that is not applicable to JSON documents A-Cube have chosen to manage XML attributes within object structures in JSON, so to specify the node value there is a naming convention, the key is __value.

In example, if you have this XML tag with an attribute

<cbc:PayableAmount currencyID="NOK">100.00</cbc:PayableAmount>

The JSON translation is

"PayableAmount": {
"__value": 100.0,
"currencyID": "NOK"
}

Example​

EHF invoice examples in different formats:

<?xml version="1.0" encoding="UTF-8"?>
<Invoice xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2"
xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">
<cbc:CustomizationID>urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0#conformant#urn:fdc:anskaffelser.no:2019:ehf:forward-billing:3.0</cbc:CustomizationID>
<cbc:ProfileID>urn:fdc:anskaffelser.no:2019:ehf:postaward:g3:08:1.0</cbc:ProfileID>
<cbc:ID>0997462625</cbc:ID>
<cbc:IssueDate>2019-04-01</cbc:IssueDate>
<cbc:DueDate>2019-05-12</cbc:DueDate>
<cbc:InvoiceTypeCode>82</cbc:InvoiceTypeCode>
<cbc:DocumentCurrencyCode>NOK</cbc:DocumentCurrencyCode>
<cbc:BuyerReference>NA</cbc:BuyerReference>
<cac:AdditionalDocumentReference>
<cbc:ID schemeID="AVE">008003762</cbc:ID>
<cbc:DocumentTypeCode>130</cbc:DocumentTypeCode>
</cac:AdditionalDocumentReference>
<cac:AccountingSupplierParty>
<cac:Party>
<cbc:EndpointID schemeID="0192">811143758</cbc:EndpointID>
<cac:PartyIdentification>
<cbc:ID schemeID="0192">811143758</cbc:ID>
</cac:PartyIdentification>
<cac:PartyName>
<cbc:Name>Havblikk Nett AS</cbc:Name>
</cac:PartyName>
<cac:PostalAddress>
<cbc:StreetName>Storoveien 4</cbc:StreetName>
<cbc:CityName>Oslo</cbc:CityName>
<cbc:PostalZone>0542</cbc:PostalZone>
<cac:Country>
<cbc:IdentificationCode>NO</cbc:IdentificationCode>
</cac:Country>
</cac:PostalAddress>
<cac:PartyTaxScheme>
<cbc:CompanyID>NO811143758MVA</cbc:CompanyID>
<cac:TaxScheme>
<cbc:ID>VAT</cbc:ID>
</cac:TaxScheme>
</cac:PartyTaxScheme>
<cac:PartyTaxScheme>
<cbc:CompanyID>Foretaksregisteret</cbc:CompanyID>
<cac:TaxScheme>
<cbc:ID>TAX</cbc:ID>
</cac:TaxScheme>
</cac:PartyTaxScheme>
<cac:PartyLegalEntity>
<cbc:RegistrationName>Havblikk Nett AS</cbc:RegistrationName>
<cbc:CompanyID>811143758</cbc:CompanyID>
</cac:PartyLegalEntity>
</cac:Party>
</cac:AccountingSupplierParty>
<cac:AccountingCustomerParty>
<cac:Party>
<cbc:EndpointID schemeID="0192">987654325</cbc:EndpointID>
<cac:PartyIdentification>
<cbc:ID>hn0073648</cbc:ID>
</cac:PartyIdentification>
<cac:PartyName>
<cbc:Name>Buyer AS</cbc:Name>
</cac:PartyName>
<cac:PostalAddress>
<cbc:StreetName>Storoveien 4</cbc:StreetName>
<cbc:CityName>Oslo</cbc:CityName>
<cbc:PostalZone>0542</cbc:PostalZone>
<cac:Country>
<cbc:IdentificationCode>NO</cbc:IdentificationCode>
</cac:Country>
</cac:PostalAddress>
<cac:PartyLegalEntity>
<cbc:RegistrationName>Buyer AS</cbc:RegistrationName>
<cbc:CompanyID schemeID="0192">877734641</cbc:CompanyID>
</cac:PartyLegalEntity>
</cac:Party>
</cac:AccountingCustomerParty>
<cac:PaymentMeans>
<cbc:PaymentMeansCode name="Credit transfer">30</cbc:PaymentMeansCode>
<cbc:PaymentID>0003434323213231</cbc:PaymentID>
<cac:PayeeFinancialAccount>
<cbc:ID>NO9386011117947</cbc:ID>
<cac:FinancialInstitutionBranch>
<cbc:ID>DNBANOKK</cbc:ID>
</cac:FinancialInstitutionBranch>
</cac:PayeeFinancialAccount>
</cac:PaymentMeans>
<cac:TaxTotal>
<cbc:TaxAmount currencyID="NOK">308.63</cbc:TaxAmount>
<cac:TaxSubtotal>
<cbc:TaxableAmount currencyID="NOK">1234.71</cbc:TaxableAmount>
<cbc:TaxAmount currencyID="NOK">308.63</cbc:TaxAmount>
<cac:TaxCategory>
<cbc:ID>S</cbc:ID>
<cbc:Percent>25</cbc:Percent>
<cac:TaxScheme>
<cbc:ID>VAT</cbc:ID>
</cac:TaxScheme>
</cac:TaxCategory>
</cac:TaxSubtotal>
</cac:TaxTotal>
<cac:LegalMonetaryTotal>
<cbc:LineExtensionAmount currencyID="NOK">1234.71</cbc:LineExtensionAmount>
<cbc:TaxExclusiveAmount currencyID="NOK">1234.71</cbc:TaxExclusiveAmount>
<cbc:TaxInclusiveAmount currencyID="NOK">1543.34</cbc:TaxInclusiveAmount>
<cbc:PayableAmount currencyID="NOK">1543.34</cbc:PayableAmount>
</cac:LegalMonetaryTotal>
<cac:InvoiceLine>
<cbc:ID>1</cbc:ID>
<cbc:InvoicedQuantity unitCode="DAY">61</cbc:InvoicedQuantity>
<cbc:LineExtensionAmount currencyID="NOK">171.13</cbc:LineExtensionAmount>
<cac:InvoicePeriod>
<cbc:StartDate>2019-05-01</cbc:StartDate>
<cbc:EndDate>2019-07-01</cbc:EndDate>
</cac:InvoicePeriod>
<cac:Item>
<cbc:Name>Fastbeløp, nettleie</cbc:Name>
<cac:ClassifiedTaxCategory>
<cbc:ID>S</cbc:ID>
<cbc:Percent>25</cbc:Percent>
<cac:TaxScheme>
<cbc:ID>VAT</cbc:ID>
</cac:TaxScheme>
</cac:ClassifiedTaxCategory>
</cac:Item>
<cac:Price>
<cbc:PriceAmount currencyID="NOK">1024</cbc:PriceAmount>
<cbc:BaseQuantity unitCode="DAY">365</cbc:BaseQuantity>
</cac:Price>
</cac:InvoiceLine>
<cac:InvoiceLine>
<cbc:ID>2</cbc:ID>
<cbc:InvoicedQuantity unitCode="KWH">2561.00</cbc:InvoicedQuantity>
<cbc:LineExtensionAmount currencyID="NOK">1063.58</cbc:LineExtensionAmount>
<cac:InvoicePeriod>
<cbc:StartDate>2019-03-01</cbc:StartDate>
<cbc:EndDate>2019-05-01</cbc:EndDate>
</cac:InvoicePeriod>
<cac:Item>
<cbc:Name>Energiledd, nettleie</cbc:Name>
<cac:ClassifiedTaxCategory>
<cbc:ID>S</cbc:ID>
<cbc:Percent>25</cbc:Percent>
<cac:TaxScheme>
<cbc:ID>VAT</cbc:ID>
</cac:TaxScheme>
</cac:ClassifiedTaxCategory>
</cac:Item>
<cac:Price>
<cbc:PriceAmount currencyID="NOK">0.4153</cbc:PriceAmount>
</cac:Price>
</cac:InvoiceLine>
</Invoice>