Skip to content

Add ZUGFeRD endpoint examples - #135

Merged
datalogics-cgreen merged 6 commits into
pdfrest:mainfrom
datalogics-erics:codex/zugferd-api-samples
Sep 18, 2026
Merged

datalogics-cgreen merged 6 commits into
pdfrest:mainfrom
datalogics-erics:codex/zugferd-api-samples

Conversation

@datalogics-erics

@datalogics-erics datalogics-erics commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Why this change

pdfRest now supports creating and validating ZUGFeRD and Factur-X hybrid invoices. These examples give developers a clear, runnable starting point for both endpoints in each of the repository primary languages.

What changed

Adds 24 endpoint examples for Create ZUGFeRD PDF (/zugferd-pdf) and Validate ZUGFeRD PDF (/validated-zugferd) in C#, Java, JavaScript, PHP, Python, and cURL. Each endpoint has a direct multipart upload example and an upload-then-JSON resource-ID example.

Creation examples submit invoice XML with an existing visual PDF and set regenerate_pdf to true, so the API preserves the PDF when it matches and generates a replacement from canonical XML when it does not. The inline comments explain that fallback behavior and clarify that the presentation settings apply only to a replacement PDF. Validation examples submit an existing hybrid ZUGFeRD/Factur-X PDF and print the full validation response.

The .NET dispatcher and usage help expose the four new .NET example commands alongside the existing endpoint samples. The Java samples use the repository-standard 60-second request timeout for the longer-running creation flow.

Behavior changes

The JSON creation samples upload the local XML and PDF first, then pass both returned resource IDs to the processing endpoint. Multipart creation samples send both source files directly. Validation samples use the corresponding single-PDF flows. No existing samples or API behavior change.

Validation

  • Shell syntax: cURL samples
  • node --check: JavaScript samples
  • python3 -m py_compile: Python samples
  • php -l: PHP samples
  • mvn package: Java multipart and JSON directories
  • dotnet build: .NET samples
  • Cloud API execution with a paid key: all 24 samples passed—Create and Validate, multipart and resource-ID JSON, across C#, Java, JavaScript, PHP, Python, and cURL. Creation produced an output resource; validation of the generated hybrid PDF returned VALID.

Risks and follow-ups

These examples use placeholder API keys and local input paths consistent with the rest of the repository. Users replace those values before running a sample. This PR adds endpoint examples only; it does not change API behavior.

@datalogics-erics
datalogics-erics marked this pull request as ready for review September 17, 2026 22:03
@datalogics-cgreen
datalogics-cgreen merged commit 482df0d into pdfrest:main Sep 18, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants