Skip to content

Create e-invoice (ZUGFeRD)

The “Create e-invoice (ZUGFeRD standard)” service task combines a PDF file with structured invoice data to produce an electronic invoice in the ZUGFeRD format. The resulting e-invoice includes an embedded XML document containing all relevant information.

Input parameters

Provide the following fields as task input:

{
  "invoiceData": {
    "invoiceNumber": "12345",
    "invoiceDate": "2024-12-22",
    "totalAmount": 500.00,
    "customer": {
      "name": "Jane Doe",
      "address": "Main Street 1, 12345 Sample City"
    }
  },
  "invoicePDFDocument": "fileReference"
}

Explanation:

  • invoiceData: JSON object with invoice number, date, amount, and customer details.
  • invoicePDFDocument: Reference to the PDF file that should contain the embedded invoice information.

Output

The task returns a reference to the generated e-invoice.

{
  "status": 200,
  "response": {
    "fileReference": "s3://bucket-name/invoice12345.pdf"
  }
}

Explanation:

  • status: Operation status (200 indicates success).
  • fileReference: File reference of the generated ZUGFeRD-compliant e-invoice.

JSONata examples

{
  "invoiceData": {
    "invoiceNumber": $.orderDetails.orderId,
    "invoiceDate": $substring($now(), 0, 10),
    "totalAmount": $.orderDetails.totalAmount,
    "customer": {
      "name": $.customer.name,
      "address": $join([$.customer.street, $.customer.city], ", ")
    }
  },
  "invoicePDFDocument": $.pdfFileReference
}

Notes

  • Supports the ZUGFeRD standard, which combines structured data with a visual PDF.
  • Ensure the invoiceData payload is complete and correctly formatted.
  • If the creation fails, the task returns a corresponding status code.

Tip

Use JSONata to build invoiceData dynamically from API results or existing data objects.