跳到主要内容

在 Power Automate 中创建 ZUGFeRD 发票

创建 ZUGFeRD 发票 是一个 Power Automate 采取行动 PDF4me 生成符合 ZUGFeRD 标准的混合电子发票,单个 PDF/A-3 文件结构化 XML 内置于系统中。可用于满足德国B2B电子发票要求,并可与任何系统交换符合EN 16931标准的电子发票。 ERP或者将一个文件存档,该文件既可供人类读取,也可供机器读取。

此操作的作用

PDF4me 创建 ZUGFeRD 发票 构建 符合 ZUGFeRD 标准的混合电子发票单个 PDF/A-3 档案 PDF 带有结构化发票 XML 嵌入内部,直接嵌入 Power Automate 流程。人类解读 PDFERPs 和清算平台解析 XML该行为满足了 德国的B2B电子发票强制令 (自2025年1月1日起生效,2028年之前全部寄出)以及相关内容 16931年 欧洲标准。将发票数据映射为 XMLJSON, 或者 CSVSharePointOneDriveOutlook或者 Dataverse,并将混合输出路由到您的归档,您的 ERP或者一步到位地满足您的客户需求。

相关博客文章(2)
如何在 Power Automate 中创建 ZUGFeRD 发票?Dropbox + JSON 分步工作流程。
使用 PDF4me 从 Dropbox PDF + JSON 创建 ZUGFeRD/Factur-X 发票的 Power Automate 工作流。创建 ZUGFeRD 发票,然后将输出保存回 Dropbox。
阅读帖子
使用 Power Automate 从 Dropbox PDF + XML 创建 ZUGFeRD 发票:5 个步骤的工作流程
五步 Power Automate 流程:手动触发,从 Dropbox 获取基础 PDF 文件内容(/pdf4metest/sample/10 page.pdf),获取 ZUGFeRD XML 文件内容(/pdf4metest/zugfred invoice/version2.xml),PDF4me 创建 ZUGFeRD 发票(2.0-XML,XmlWithPdf,BASIC,启用渲染,语言为德语),从 Dropbox 创建文件到 /pdf4meoutput。将符合 EN 16931 标准的 XML 嵌入到 PDF/A-3 混合格式中,满足 2025 年德国 B2B 文档规范的要求。提供真实屏幕截图和精确字段值。
阅读帖子

如何验证我的 Power Automate 流程?

致电 PDF4me 通过 Power Automate流程需要一个有效的 PDF4me API 关键在于 PDF4me 连接 连接器。身份验证可确保通信安全,并验证您的身份是否为授权用户。您可以从开发者控制面板获取或轮换密钥。

您不容错过的重要事实

ZUGFeRD 是一种混合型 PDF/A-3 + 嵌入式 XML并非纯粹的 XML 格式
默认值 XmlWithPdf 输出结果为一个文件:一个归档文件 PDF/A-3 具有结构化的 ZUGFeRD XML 附着在里面。人类打开 PDFAP系统解析 XML。 放 XmlOnly 只有当接收系统消耗纯净物时 XML
2025 年德国 B2B 指令要求采用 ZUGFeRD 2.0 或更高版本。
德国的《增长机会法》规定,电子发票收据必须从……开始使用。 2025年1月1日,并分阶段全面履行发送义务 2028ZUGFeRD 2.0 及以上版本(符合 EN 16931 标准)满足要求;旧版 1.0 不符合要求。请选择您的连接器支持的最高版本(ZUGFeRD 版本 + 输入格式下拉列表会列出该版本)。
映射一个发票数据字段,绝不映射两个。
行动表明 发票 XML 数据发票 JSON 数据, 或者 发票 CSV 数据 根据组合下拉菜单的格式部分进行匹配。仅映射匹配项。在同一次运行中填充两个数据字段是导致验证失败的最常见原因。
在 Power Automate 中创建 ZUGFeRD 发票操作,显示主参数选项卡,其中 ZUGFeRD 版本和输入格式设置为 2.0-XML,输出模式为 XmlWithPdf,发票 XML 数据映射自文件内容,一致性级别为 BASIC,在 PDF 上呈现发票为“是”,文件内容映射自先前的操作,文件名为 abc.pdf。

主要的 参数 标签。 ZUGFeRD 版本和输入格式 是一个组合下拉菜单(此处)。 2.0-XML)。

在 Power Automate 中创建 ZUGFeRD 发票操作,显示“高级参数”部分,并显示“1/1”,且“语言”字段设置为“de”。

高级参数语言 默认值 也接受 英语、法语、意大利语、西班牙语、荷兰语、波兰语、葡萄牙语、捷克语

ZUGFeRD、Factur-X 和 XRechnung:选择合适的配置文件

格式它的使用场景输出类型何时选择
ZUGFeRDGermany, EU B2B, supplier-to-buyer invoicingHybrid PDF/A-3 + embedded XMLGeneral B2B; you want one file for humans and machines.
Factur-XFrance (sister format, technically identical to ZUGFeRD 2.x)Hybrid PDF/A-3 + embedded XMLCross-border FR<>DE invoicing; the same hybrid file works on both sides.
XRechnungGerman public sector (federal, state, municipal)Strict pure XML profileYou invoice a German public-sector authority; switch to an XRechnung-aligned profile when the receiver demands pure XML.

参数

操作中需要: ZUGFeRD 版本和输入格式、输出模式的匹配 发票 XML / JSON / CSV 数据 字段和一致性级别。 PDF 文件内容文件名 仅当输出模式为 XmlWithPdf输出文件名 设置生成的混合文件的文件名。 开具发票 PDF 默认值为真。 语言 生活在 高级参数 并默认为

范围必需的它的作用例子
ZUGFeRD version and Input FormatRequiredCombined dropdown that picks both the ZUGFeRD specification version (1.0, 2.0, etc.) and the shape of your invoice data (XML, JSON, CSV) in a single setting. The value drives which Invoice Data field appears below and which Conformance Level set is offered.2.0-XML
Output ModeRequiredXmlWithPdf returns the canonical hybrid PDF/A-3 file with the XML embedded inside. XmlOnly returns the XML invoice file alone. PDF File Content and File Name are only required for XmlWithPdf.XmlWithPdf
Invoice XML DataConditionalRequired when the Input Format part of the combined dropdown is XML. Map your ZUGFeRD XML payload from a previous action (Get file content, Compose, etc.).File Content
Invoice JSON DataConditionalRequired when the Input Format part is JSON. Map a structured invoice JSON object that PDF4me converts to the ZUGFeRD XML schema before embedding.File Content
Invoice CSV DataConditionalRequired when the Input Format part is CSV. Map a tabular CSV row that PDF4me converts to the ZUGFeRD XML schema before embedding.File Content
Conformance LevelRequiredProfile that controls how rich the invoice data must be. BASIC is the entry-level profile with line items, suitable for most B2B receivers. COMFORT adds additional fields for richer content. EXTENDED is the largest set, used for industry-specific scenarios beyond the EN 16931 baseline.BASIC
Render Invoice on PDFRequiredWhen set to Yes (default), PDF4me visually renders the invoice content on the PDF pages using your invoice data. Set to No when you supply a pre-designed background PDF and only need the XML embedded without redrawing the content.Yes
PDF File ContentConditionalRequired when Output Mode is XmlWithPdf. Map the background PDF bytes from a previous action (Get file content from SharePoint / OneDrive / Outlook / Dataverse). Skip for XmlOnly.File Content
File NameConditionalRequired when Output Mode is XmlWithPdf. The source PDF filename with extension. Used for trace and naming context.abc.pdf
Output File NameOptionalFilename of the generated hybrid file or XML. Use .pdf for XmlWithPdf and .xml for XmlOnly. Helps when the downstream Create file action expects an explicit name.Zugferd-output.pdf
LanguageOptionalAdvanced parameter. Locale used for invoice labels in the rendered PDF. Default de. Accepted codes: de, en, fr, it, es, nl, pl, pt, cs. The XML data itself stays language-neutral.de

输出模式选项

XmlWithPdf默认的规范 ZUGFeRD 混合文件
PDF包含结构化发票的 A-3 文件 XML 附于其内。用于向客户开具发票,存档。 SharePoint附着于 Outlook 电子邮件,或者任何需要单个文档同时服务于人类和机器读者的场合。
XmlOnly独立版 XML 发票
返回 ZUGFeRD 发票 XML 单独使用。接收时使用。 ERP清算所或中间件摄取 XML 直接和视觉 PDF 生成于其他地方或不需要。 PDF 文件内容/文件名并非必填项。

符合性等级阶梯

基本的默认值。最广泛的接收器兼容性
入门级电子发票模板,包含明细项目、税务明细和交易方信息。符合欧盟电子发票最低指令要求,并被大多数B2B收款方接受。从这里开始进行兼容性测试。
舒适更丰富的发票内容
在基本字段的基础上添加了更多结构化字段。当您的买家或 ERP 需要比最低要求更完整的发票信息。从基本模式切换到此模式前,请确认是否支持。
扩展规模最大的行业特定套装
在 EN 16931 标准基线之外,增加了行业特定字段。仅当接收方明确要求时才使用;否则,更丰富的有效载荷会增加验证阻力。

语言选项(高级)

“高级参数”部分仅显示一个字段, 语言它仅控制绘制在视觉元素上的标签所使用的语言环境。 PDF; 这 XML 数据保持语言中立。默认值为 de

代码语言典型用途
deGermanDefault. German domestic invoicing.
enEnglishCross-border B2B in English-speaking markets.
frFrenchFrance or French-speaking Switzerland (also pairs with Factur-X workflows).
itItalianItaly or Italian-speaking Switzerland.
esSpanishSpain and Spanish-speaking partners.
nlDutchNetherlands and Flemish Belgium.
plPolishPoland.
ptPortuguesePortugal and Portuguese-speaking partners.
csCzechCzechia.

发票样本文件

在连接实际数据源之前,请使用这些工具测试每种输入格式的流程。对于符合 2025 年要求的德国 B2B 生产工作流程,请从以下方面开始: JSON 2.0 EN16931 样本。

手铐 XML 样本
ZUGFeRD 1.0 基本版 XML。 挑选 1.0-XML 在组合下拉菜单中,然后将其映射到 发票 XML 数据
ZUGFeRD-invoice-sample.xml
ZUGFeRD 2.0
ZUGFeRD 2.0 XML 样品(EN16931)
ZUGFeRD 2.0 EN16931 XML 包含买卖双方信息、明细项目、增值税和金额汇总,采用跨行业发票格式。 2.0-XML
ZUGFeRD-invoice-sample-2.0.xml
受到推崇的
JSON 2.0 EN16931 样品
完整结构化发票 ZUGFeRD 2.0 EN16931。 挑选 2.0-JSON然后映射到 发票 JSON 数据
sample-invoice-zugferd-2.0-en16931.json
JSON 发票样本(基本版)
更简单 JSON 用于烟雾测试 ZUGFeRD 1.0基本的 符合性。
示例发票.json
CSV 发票样本
平坦的 CSV 用于批量测试的行。选择 1.0-CSV然后映射到 发票 CSV 数据
测试发票.csv
ZUGFeRD 2.0
CSV 2.0 发票样本
扩展的 22 列 CSV:发票编号、开票日期、卖家/买家地址字段、卖家增值税号、产品编号、货币、付款参考号 IBAN,BIC。选择 2.0-CSV
zugferd-invoice-2.0.csv

输入输出决策矩阵

如果您选择然后地图你得到
ZUGFeRD version and Input Format = 2.0-XMLInvoice XML DataZUGFeRD 2.0 hybrid output (or XML-only) from your existing XML payload
ZUGFeRD version and Input Format = 2.0-JSONInvoice JSON DataZUGFeRD 2.0 hybrid from a structured JSON object converted to the schema
ZUGFeRD version and Input Format = 2.0-CSVInvoice CSV DataZUGFeRD 2.0 hybrid from a flat CSV row converted to the schema
Output Mode = XmlWithPdfPDF File Content + File Name (background PDF)PDF/A-3 hybrid file with embedded XML
Output Mode = XmlOnlyInvoice data only (no PDF bytes needed)Standalone ZUGFeRD XML invoice

如何在 Power Automate 中设置创建 ZUGFeRD 发票?

  1. 添加 创建 ZUGFeRD 发票 将你的工作流程增加一个新的步骤。
  2. 登录 PDF4me 与您的 API 钥匙。
  3. 挑选 ZUGFeRD 版本和输入格式 (例如 2.0-XML2.0-JSON, 或者 2.0-CSV)。
  4. 输出模式XmlWithPdf 对于混合文件或 XmlOnly 纯粹 XML
  5. 地图 仅有的 匹配的发票数据字段(XMLJSON, 或者 CSV)来自之前的操作。
  6. 符合性级别基本的 用于兼容性测试, 舒适 或者 扩展 当您的接收器确认支持时)。
  7. 离开 以 PDF 格式渲染发票 作为 是的 除非你提供预先设计好的背景。 PDF
  8. 为了 XmlWithPdf, 地图 PDF 文件内容文件名 来自之前的操作(获取文件内容)。
  9. 输出文件名Zugferd-output.pdf 或者 Zugferd-output.xml)。
  10. 在下面 高级参数, 放 语言 如果您需要非德语语言环境下的标签。
  11. 路线 文件内容 输出到 SharePoint 创建文件, OneDrive 创建文件, Outlook 发送电子邮件或 Dataverse 记录。可选择链接 证实 PDF/一个 存档之前。

输出

该操作会返回生成的文件内容以及您的流程可以向下游传递的元数据。

场地类型描述
File ContentBinaryThe generated PDF/A-3 hybrid file (XmlWithPdf) or the standalone XML invoice (XmlOnly).
FileName (header)StringSuggested output filename returned in the response headers.
PageCount (header)StringPage count of the generated PDF, returned when Output Mode is XmlWithPdf.

故障排除

发票数据映射到了错误的格式字段

如果组合下拉菜单中的“输入格式”部分是 CSV仅地图 发票 CSV 数据不要填写 XML / JSON 同一运行中的字段。每次调用选择一种格式。

PDF 当输出模式为 XmlWithPdf 时出现输出错误

PDF 文件内容 必须来自返回完整文件字节的步骤(从……获取文件内容) SharePoint / OneDrive / Outlook 附件),而不是仅包含元数据的引用,例如缺少文件有效负载的 GET 请求。

接收方拒绝了一致性级别。

首先 基本的 进行兼容性测试后,只有在接收系统确认支持后才能升级。 扩展 特别是对于针对 EN 16931 基线调谐的接收器,可能无法通过验证。

选择 Legacy 1.0 是为了符合强制性流程。

ZUGFeRD 1.0 不符合 2025 年德国 B2B 指令的要求。请选择 2.0 对于任何对强制性要求敏感的工作流程,请在 ZUGFeRD 版本和输入格式下拉菜单中选择 family(或更高版本)。

工作流程示例

工作流程示例Open by default. Four common ZUGFeRD automation patterns in a 2x2 grid.
数据宇宙到混合 PDF 档案
  1. 当 Dataverse 中发票行被标记为“已批准”时触发(或 ERP)。
  2. 撰写发票 JSON 从行列和子行项目表中。
  3. 获取布局 PDF 一个 SharePoint 文档库模板。
  4. 跑步 创建 ZUGFeRD 发票2.0-JSONXmlWithPdf16931年对齐一致性。
  5. 将返回的文件内容保存到记录库中;链 证实 PDF/一个 保留前。

影响: 一个文件,既适用于人也适用于机器,非常适合审计和长期存储。

CSV 来自批次 SharePoint
  1. 触发新文件到达 SharePoint 舞台 文件夹。
  2. 阅读 CSV 发票行文件内容。
  3. 挑选 2.0-CSV 在组合下拉菜单中;地图 发票 CSV 数据
  4. XmlWithPdf将结果路由到 已批准的发票 图书馆。

影响: 无需手动桌面工具即可重复批量生成。

XmlOnly 到 SAP 或中间件
  1. 上游系统生成发票 JSON
  2. 运行该操作 XmlOnly; 跳过 PDF 文件内容。
  3. POST 返回 XML 发送至 SAP、EDI 经纪商或电子发票清算机构。
  4. 用于支持追溯的日志关联 ID。

影响: 交接顺利进行 PDF shell 是在其他地方生成的。

Outlook 发送和 SharePoint 档案
  1. 在您的计费系统中完成发票的生成。
  2. 生成 ZUGFeRD 混合文件(XmlWithPdf)。
  3. Outlook 发送一封包含以下内容的电子邮件 PDF/A-3 附在客户身上。
  4. SharePoint 在记录库中创建包含元数据列(发票编号、金额、到期日)的文件。

影响: 客户自助服务,减少“格式错误”的支持工单。

行业应用案例及应用

行业应用案例及应用Expand to see manufacturing, finance, public sector, and SaaS scenarios.
制造业和B2B
  • 供应商发票适用于有严格应付账款规定的买家的混合 PDF/A-3 + XML 格式
  • 订单到收款. 从 ERP 事件自动生成发票包
  • 审计跟踪每次发货或里程碑交付一件产品
财务与会计
  • 应收账款符合2025年要求的合规出境电子发票
  • 月末从合并发票数据批量输出混合输出
  • 存档在记录保留之前,请配合 PDF/A 验证。
公共部门及受监管部门
  • 结构化交易所.XmlOnly 仅用于强制清算通道
  • 透明度嵌入式 XML 支持自动验证
  • 保留符合内部记录政策
SaaS 和平台
  • 账单导出从您已发布的 JSON/CSV 文件生成 ZUGFeRD
  • 多租户在您的流程中,为每个客户单独生成 JSON/XML/CSV 格式或模板的发票。
  • 客户成功减少手动“再次发送发票”的循环

常见问题解答

What is ZUGFeRD and how does it differ from XRechnung and Factur-X?+
ZUGFeRD is the German hybrid e-invoicing format: a PDF/A-3 archival PDF with structured XML invoice data embedded inside it. Humans read the PDF; machines parse the XML. XRechnung is the German public sector profile, a stricter pure-XML profile required when invoicing federal, state, or municipal authorities. Factur-X is the French sister format that uses the same hybrid PDF/A-3 + XML structure as ZUGFeRD 2.x and is fully compatible. Pick ZUGFeRD with EN 16931 alignment for general B2B; switch to XRechnung when invoicing a German public-sector buyer. The format is maintained by <a href="https://www.ferd-net.de/" target="_blank" rel="noopener noreferrer">FeRD, the Forum elektronische Rechnung Deutschland</a>.
Does ZUGFeRD satisfy the German B2B e-invoicing mandate that began in 2025?+
Yes, when generated as ZUGFeRD 2.0 or higher with EN 16931 alignment. Germany's Wachstumschancengesetz (Growth Opportunities Act) made e-invoice receipt mandatory for B2B transactions from 1 January 2025 and phases in full sending obligations by 2028. Legacy ZUGFeRD 1.0 does not satisfy the mandate; use the 2.0 family or higher. See the <a href="https://www.e-rechnung-bund.de/" target="_blank" rel="noopener noreferrer">German federal e-invoicing information portal</a> for the official rollout timeline.
When should I use XmlWithPdf versus XmlOnly?+
XmlWithPdf returns a single PDF/A-3 file with the ZUGFeRD XML attached inside it: the canonical hybrid output you send to customers, archive in SharePoint, or attach to email. XmlOnly returns the XML invoice alone, useful when the receiving ERP or clearing platform consumes XML directly and the PDF shell is generated elsewhere or not needed at all.
What is the difference between BASIC, COMFORT, and EXTENDED conformance?+
BASIC is the entry-level profile with the minimum line items and tax breakdown needed for a valid invoice; it offers the broadest receiver compatibility. COMFORT adds further structured fields for richer invoice content. EXTENDED includes the largest set, designed for industry-specific scenarios beyond the EN 16931 baseline. Start with BASIC for compatibility, then move to COMFORT or EXTENDED only after the receiver confirms support.
Do I need to map the background PDF when using XmlOnly?+
No. PDF File Content and File Name are only required when Output Mode is XmlWithPdf. With XmlOnly the action generates a standalone XML file from your invoice data and the PDF input fields can be left empty.
What does Render Invoice on PDF actually do?+
When set to Yes (default), PDF4me draws the invoice content (header, line items, totals) visually on the PDF pages using your invoice data. Set to No when you already provide a pre-designed background PDF that already shows the invoice content and you only need the structured XML embedded inside it.
Which language codes does the Language field accept?+
Nine codes: de (default, German), en (English), fr (French), it (Italian), es (Spanish), nl (Dutch), pl (Polish), pt (Portuguese), and cs (Czech). The setting affects only the labels drawn on the visual PDF; the XML data itself stays language-neutral.
How do I move the generated file into SharePoint, Outlook, or Dataverse?+
Add a follow-up action after Create ZUGFeRD Invoice and map the File Content output. For SharePoint use Create file under the document library; for OneDrive use Create file; for Outlook use Send an email with attachment and map File Content as the attachment content with Output File Name as the attachment name; for Dataverse use Add a new row or Upload a file to an existing row.

相关操作

在其他平台上执行相同任务

获取帮助