Main.Invoicing.invoice-service.invoice-service-apis.Invoice layout - Invoicing & Distribution 
Page of - last modified by Karl Holmbom on 2024/04/15 13:40 
Invoicing & Distribution 

Karl Holmbom

2024/04/15 13:40
Table of Contents
Introduction
Editing the invoice content
Invoice documents
Invoice
Reminder
Collection claim
Logotype
Logo used for print
Logo used for digital distribution
Payment info
E-mail invoice (html)
EDI (B2B)
Invoice attachment (enclosure)

Introduction
This section covers the invoicing process and invoice layout functions.
You can tailor you invoice content and managing the distribution according to your business needs - from adding your company logo to editing invoice columns, or choosing distribution methods.
Editing the invoice content
Much of the Invoice Service API properties are optional. I.e. you can choose whether or not most of the invoice order line columns and references are to be presented on the invoice or not.
�	InvoiceService-API for Invoice Specification reference is found here.
�	Detailed mapping of the Specification reference against all invoice elements is found here.
Invoice documents
Invoice
�	Invoice examples:
�	Invoice SE
�	E-invoice SE
�	E-invoice NO
�	Direct Debit SE
�	Direct Debit NO
�	E-invoice and Direct Debit combined SE
�	E-invoice and Direct Debit combined NO
�	Distribution methods according to PayEx Standard distribution order of priority or set by preferred "distribution" in Invoice-service API.
�	Dependency to legalEntity in Customer resource:
�	If distributed by e-mail: When legalEntity is set to "consumer" the e-mail message will include a link to PayEx Invoice Portal where the invoice/claim is available, otherwise a copy of the invoice/claim will be attached in the e-mail message as a pdf-file.
Reminder
�	Reminders and Collection claim always refers to the original invoice and a copy of the invoice is attached on the back of the claim document.
�	Digital or postal distribution depending on ledger configuration.
�	Example
�	Dependency to legalEntity in Customer resource:
�	Late fee will be added instead of reminder fee or collection claim fee when legalEntity is set to "business" (if specially contracted with PayEx and configured in ledger)
�	If distributed by e-mail: When legalEntity is set to "consumer" the e-mail message will include a link to PayEx Invoice Portal where the invoice/claim is available, otherwise a copy of the invoice/claim will be attached in the e-mail message as a pdf-file.
�	Finland only: Different claim processes will be used depending on "consumer" or "business"
Collection claim
�	Reminders and Collection claim always refers to the original invoice and a copy of the invoice is attached on the back of the claim document.
�	Postal distribution
�	Example
Logotype
Logo used for print
To use your own logotype for invoices generated by PayEx Invoice Service you need to send a logotype image to setup.invoice@payex.com together with customer identification.
Property	Description	
Format	.png	
Resolution	300 DPI or higher	
Max Height	1,7 cm	
Max Width	8 cm	
Logo used for digital distribution
To use your own logotype for digital invoices generated by PayEx Invoice Service you need to send a logotype image to setup.invoice@payex.com together with customer identification.
Property	Description	
Format	.png (compatible to dark mode)	
Max Height	100px	
Max Width	300px	
Payment info
�	PayEx creates invoice reference number (KID/OCR)
�	BIC/IBAN is only shown if invoice receiver address is abroad
�	Admin text is set by PayEx
�	Supported language for invoice admin text and claims: ledger default country config + english
E-mail invoice (html)
�	In general invoice is distributed as an html based e-mail with invoice document attached as a file, if "distribution" is set to Email.
�	e-mail layout adapts to receivers device and settings.
�	Logo for digital distribution is used.  
�	Example of e-mail layout using iPhone 11 Pro Max, iOS 14 is found here
�	Sweden only:
�	The e-mail message will include a link to PayEx Invoice Portal landing page where the user can fetch their invoice/claim as a .pdf, instead of receiving it as an e-mail attachment.
�	If certain users / invoice receivers (business / private) needs the .pdf directly in the email message it is mandatory to use legalEntity  to distinguish whether to include a .pdf in the email message or not.
�	When legalEntity is set to "consumer" the e-mail message will only include a link to PayEx Invoice Portal where the invoice/claim is available, otherwise a copy of the invoice/claim will be added in the e-mail message as a pdf-file.
�	Link to PayEx Invoice Portal may also be generated via Invoice API to be used i.e. as a part of My Pages or as an invoice/payment link in a communication channel of your choice.
EDI (B2B)
PayEx Invoice Service is designed to support distribution of invoices business to business (B2B) e.g as Peppol, EHF, EDI or Svefaktura.
Detailed mapping of the Specification reference against all invoice elements is found here.
Properties need to be set according to the following, in accordance with the recipient's (your customer) preferences:

�	InvoiceService-API for Invoice Specification reference is found here.
�	In order to use EInvoiceB2B (EDI), the following information is mandatory in the invoiceSpecification:
- quantity
- unit
- unitPrice

�	Customer-API reference is found here.
�	In order to use EInvoiceB2B (EDI), the following information is  mandatory in the eDIAddressInfo:
- eDIAddressInfo.Van
- eDIAddressInfo.BuyerId
Invoice attachment (enclosure)
PayEx Invoice Service offers the possibility to add invoice attachments. The attachment will be produced as an extra page following the invoice document. Attachments can be distributed both electronically and by postal service.
To use Invoice attachment a pdf-document is required consisting of one or more pages.
Failed to execute the [display] macro. Cause: [Cannot find section [HStandardInvoicedistributionorderofpriority] in document [developer:Main.Invoicing.invoice-service.Implementation guide.Invoice columns.WebHome]]. Click on this message for details.
org.xwiki.rendering.macro.MacroExecutionException: Cannot find section [HStandardInvoicedistributionorderofpriority] in document [developer:Main.Invoicing.invoice-service.Implementation guide.Invoice columns.WebHome]
 at org.xwiki.rendering.internal.macro.display.DisplayMacro.execute(DisplayMacro.java:174)
 at org.xwiki.rendering.internal.macro.display.DisplayMacro.execute(DisplayMacro.java:53)
 at org.xwiki.rendering.internal.transformation.macro.MacroTransformation.transform(MacroTransformation.java:272)
 at org.xwiki.rendering.internal.transformation.DefaultRenderingContext.transformInContext(DefaultRenderingContext.java:183)
 at org.xwiki.rendering.internal.transformation.DefaultTransformationManager.performTransformations(DefaultTransformationManager.java:95)
 at org.xwiki.display.internal.DocumentContentDisplayer.display(DocumentContentDisplayer.java:263)
 at org.xwiki.display.internal.DocumentContentDisplayer.display(DocumentContentDisplayer.java:133)
 at org.xwiki.display.internal.DocumentContentDisplayer.display(DocumentContentDisplayer.java:58)
 at org.xwiki.display.internal.DefaultDocumentDisplayer.display(DefaultDocumentDisplayer.java:96)
 at org.xwiki.display.internal.DefaultDocumentDisplayer.display(DefaultDocumentDisplayer.java:39)
 at org.xwiki.sheet.internal.SheetDocumentDisplayer.display(SheetDocumentDisplayer.java:123)
 at org.xwiki.sheet.internal.SheetDocumentDisplayer.display(SheetDocumentDisplayer.java:52)
 at org.xwiki.display.internal.ConfiguredDocumentDisplayer.display(ConfiguredDocumentDisplayer.java:68)
 at org.xwiki.display.internal.ConfiguredDocumentDisplayer.display(ConfiguredDocumentDisplayer.java:42)
 at com.xpn.xwiki.doc.XWikiDocument.display(XWikiDocument.java:1146)
 at com.xpn.xwiki.doc.XWikiDocument.getRenderedContent(XWikiDocument.java:1187)
 at com.xpn.xwiki.doc.XWikiDocument.getRenderedContent(XWikiDocument.java:1164)
 at com.xpn.xwiki.doc.XWikiDocument.getRenderedContent(XWikiDocument.java:1195)
 at com.xpn.xwiki.api.Document.getRenderedContent(Document.java:701)
 at sun.reflect.GeneratedMethodAccessor508.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
 at java.lang.reflect.Method.invoke(Unknown Source)
 at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:395)
 at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:384)
 at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:173)
 at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:280)
 at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:369)
 at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
 at org.apache.velocity.runtime.directive.Foreach.render(Foreach.java:420)
 at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:207)
 at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342)
 at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluateInternal(DefaultVelocityEngine.java:259)
 at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:222)
 at com.xpn.xwiki.render.DefaultVelocityManager.evaluate(DefaultVelocityManager.java:361)
 at com.xpn.xwiki.internal.template.InternalTemplateManager.evaluateContent(InternalTemplateManager.java:810)
 at com.xpn.xwiki.internal.template.InternalTemplateManager.render(InternalTemplateManager.java:686)
 at com.xpn.xwiki.internal.template.InternalTemplateManager.lambda$renderFromSkin$0(InternalTemplateManager.java:661)
 at com.xpn.xwiki.internal.security.authorization.DefaultAuthorExecutor.call(DefaultAuthorExecutor.java:85)
 at com.xpn.xwiki.internal.template.InternalTemplateManager.renderFromSkin(InternalTemplateManager.java:660)
 at com.xpn.xwiki.internal.template.InternalTemplateManager.renderFromSkin(InternalTemplateManager.java:639)
 at com.xpn.xwiki.internal.template.InternalTemplateManager.render(InternalTemplateManager.java:625)
 at com.xpn.xwiki.internal.template.DefaultTemplateManager.render(DefaultTemplateManager.java:82)
 at com.xpn.xwiki.XWiki.evaluateTemplate(XWiki.java:2120)
 at com.xpn.xwiki.XWiki.parseTemplate(XWiki.java:2098)
 at com.xpn.xwiki.pdf.impl.PdfExportImpl.export(PdfExportImpl.java:261)
 at com.xpn.xwiki.web.ExportAction.export(ExportAction.java:255)
 at com.xpn.xwiki.web.ExportAction.render(ExportAction.java:87)
 at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:447)
 at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:210)
 at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:425)
 at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:228)
 at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
 at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:635)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
 at com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:112)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
 at org.xwiki.wysiwyg.filter.ConversionFilter.doFilter(ConversionFilter.java:127)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
 at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
 at org.xwiki.container.servlet.filters.internal.SetHTTPHeaderFilter.doFilter(SetHTTPHeaderFilter.java:63)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
 at org.xwiki.container.servlet.filters.internal.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:208)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
 at org.xwiki.container.servlet.filters.internal.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:111)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
 at org.xwiki.resource.servlet.RoutingFilter.doFilter(RoutingFilter.java:134)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
 at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478)
 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80)
 at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
 at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:799)
 at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
 at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
 at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1457)
 at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
 at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
 at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
 at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.RuntimeException: Cannot find section [HStandardInvoicedistributionorderofpriority] in document [developer:Main.Invoicing.invoice-service.Implementation guide.Invoice columns.WebHome]
 at org.xwiki.display.internal.DocumentContentDisplayer.displayInIsolatedExecutionContext(DocumentContentDisplayer.java:229)
 at org.xwiki.display.internal.DocumentContentDisplayer.display(DocumentContentDisplayer.java:132)
 at org.xwiki.display.internal.DocumentContentDisplayer.display(DocumentContentDisplayer.java:58)
 at org.xwiki.display.internal.DefaultDocumentDisplayer.display(DefaultDocumentDisplayer.java:96)
 at org.xwiki.display.internal.DefaultDocumentDisplayer.display(DefaultDocumentDisplayer.java:39)
 at org.xwiki.sheet.internal.SheetDocumentDisplayer.display(SheetDocumentDisplayer.java:123)
 at org.xwiki.sheet.internal.SheetDocumentDisplayer.display(SheetDocumentDisplayer.java:52)
 at org.xwiki.display.internal.ConfiguredDocumentDisplayer.display(ConfiguredDocumentDisplayer.java:68)
 at org.xwiki.display.internal.ConfiguredDocumentDisplayer.display(ConfiguredDocumentDisplayer.java:42)
 at org.xwiki.rendering.internal.macro.display.DisplayMacro.execute(DisplayMacro.java:172)
 ... 94 more
Caused by: java.lang.RuntimeException: Cannot find section [HStandardInvoicedistributionorderofpriority] in document [developer:Main.Invoicing.invoice-service.Implementation guide.Invoice columns.WebHome]
 at org.xwiki.display.internal.DocumentContentDisplayer.getContent(DocumentContentDisplayer.java:295)
 at org.xwiki.display.internal.DocumentContentDisplayer.display(DocumentContentDisplayer.java:248)
 at org.xwiki.display.internal.DocumentContentDisplayer.displayInIsolatedExecutionContext(DocumentContentDisplayer.java:227)
 ... 103 more