curl --request POST \
--url https://api.comstruct.com/v1/invoices/custom \
--header 'Content-Type: application/pdf' \
--header 'X-API-Key: <api-key>' \
--data '<string>'import requests
url = "https://api.comstruct.com/v1/invoices/custom"
payload = "<string>"
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/pdf"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/pdf'},
body: '<string>'
};
fetch('https://api.comstruct.com/v1/invoices/custom', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.comstruct.com/v1/invoices/custom",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "<string>",
CURLOPT_HTTPHEADER => [
"Content-Type: application/pdf",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.comstruct.com/v1/invoices/custom"
payload := strings.NewReader("<string>")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/pdf")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.comstruct.com/v1/invoices/custom")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/pdf")
.body("<string>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.comstruct.com/v1/invoices/custom")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/pdf'
request.body = "<string>"
response = http.request(request)
puts response.read_body{
"invoiceId": "invoice-abc123def456",
"success": true,
"jobId": "job-789xyz012"
}Custom invoice upload
Erforderliche Berechtigungen: invoices:write
Verarbeitet ein benutzerdefiniertes Rechnungsformat mittels GPT/KI-Parsing. Akzeptiert PDF- oder TIFF-Dateien bis zu 32MiB und verarbeitet sie mittels generativer KI zur Rechnungsdatenextraktion.
Optionale Request-Header können vordefinierte Werte für Lieferant, Projekt und externe Dokument-ID übergeben und damit die von der KI extrahierten Felder überschreiben.
Der API-Schlüssel muss mit einem Lieferanten verknüpft sein.
Akzeptiert entweder einen einzelnen rohen PDF-/TIFF-Body (Legacy) oder multipart/form-data
mit optionalem xml-Teil und einem oder mehreren pdf-Teilen. Bei XML laufen die
automatisierten Prüfungen auf dem XML; die PDF(s) dienen der Visualisierung (mehrere PDFs werden gemerged).
curl --request POST \
--url https://api.comstruct.com/v1/invoices/custom \
--header 'Content-Type: application/pdf' \
--header 'X-API-Key: <api-key>' \
--data '<string>'import requests
url = "https://api.comstruct.com/v1/invoices/custom"
payload = "<string>"
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/pdf"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/pdf'},
body: '<string>'
};
fetch('https://api.comstruct.com/v1/invoices/custom', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.comstruct.com/v1/invoices/custom",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "<string>",
CURLOPT_HTTPHEADER => [
"Content-Type: application/pdf",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.comstruct.com/v1/invoices/custom"
payload := strings.NewReader("<string>")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/pdf")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.comstruct.com/v1/invoices/custom")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/pdf")
.body("<string>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.comstruct.com/v1/invoices/custom")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/pdf'
request.body = "<string>"
response = http.request(request)
puts response.read_body{
"invoiceId": "invoice-abc123def456",
"success": true,
"jobId": "job-789xyz012"
}Overview
Processes invoices as PDF or TIFF files with AI-assisted data extraction. Optional request headers can supply preset values for supplier, project, and external document ID, overriding fields extracted by the AI parser. Accepts either a single raw PDF/TIFF body (legacy) ormultipart/form-data with an optional xml part and one or more pdf parts. When XML is supplied, automated checks run on the XML while the PDF(s) are used for visualization (multiple PDFs are merged).
Permissions
| Scope | Tenant type |
|---|---|
invoices:write | Supplier (SUPPLIER_ONLY) |
Headers
| Header | Required | Description |
|---|---|---|
x-api-key | Yes | API key with scope invoices:write |
Content-Type | Yes | application/pdf, application/tiff, or multipart/form-data |
kreditorname | No | Supplier name; overrides the supplier name extracted by the AI parser |
archivdocument | No | External document ID for archival purposes; stored as the invoice external_id |
projekt | No | Project number; overrides the project assignment extracted by the AI parser |
buchungskreis | No | Company code (legal entity); fallback for the project number when projekt is empty — format HQ-{buchungskreis} |
Preset header behavior
kreditornamesetssupplier_nameduring invoice processing.projektsetsproject_number. Ifprojektis missing or empty,HQ-{buchungskreis}is used instead (whenbuchungskreisis set).archivdocumentis stored as the invoice external ID (external_id).
Example (legacy PDF body)
curl -X POST "https://api.comstruct.com/v1/invoices/custom" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/pdf" \
-H "kreditorname: Example Supplier GmbH" \
-H "archivdocument: ARCH-2024-001" \
-H "projekt: PRJ-001" \
--data-binary @invoice.pdf
Example (multipart with XML + PDF)
curl -X POST "https://api.comstruct.com/v1/invoices/custom" \
-H "x-api-key: YOUR_API_KEY" \
-H "kreditorname: Example Supplier GmbH" \
-H "archivdocument: ARCH-2024-001" \
-H "projekt: PRJ-001" \
-F "xml=@invoice.xml" \
-F "pdf=@visualization.pdf"
Authorizations
Headers
Query Parameters
Body
Rohe PDF-Rechnungsdaten (Legacy, bis zu 32MiB)