curl --request POST \
--url https://api.comstruct.com/v1/deliveries/pdf \
--header 'Content-Type: application/pdf' \
--header 'X-API-Key: <api-key>' \
--data '"<string>"'import requests
url = "https://api.comstruct.com/v1/deliveries/pdf"
payload = "<string>"
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/pdf"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/pdf'},
body: JSON.stringify('<string>')
};
fetch('https://api.comstruct.com/v1/deliveries/pdf', 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/deliveries/pdf",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode('<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/deliveries/pdf"
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/deliveries/pdf")
.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/deliveries/pdf")
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{
"fileId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"success": true,
"jobId": "42"
}{
"error": "Validation failed",
"message": "The provided data did not pass validation checks"
}{
"error": "Validation failed",
"message": "The provided data did not pass validation checks"
}{
"error": "Validation failed",
"message": "The provided data did not pass validation checks"
}{
"error": "Validation failed",
"message": "The provided data did not pass validation checks"
}{
"error": "Validation failed",
"message": "The provided data did not pass validation checks"
}Lieferschein-PDF hochladen
Erforderliche Berechtigungen: deliveries:patch
Öffentlicher API-Einstieg für den asynchronen Lieferschein-PDF-Upload (Stapel-/Heftscan).
Erfordert das Feature-Flag delivery-async-processing und einen kundengebundenen API-Schlüssel
(CUSTOMER_ONLY) mit Scope deliveries:patch. Lieferanten-API-Schlüssel werden abgelehnt.
Senden Sie das rohe PDF als Request-Body (Content-Type: application/pdf).
Der Header Content-Length ist Pflicht. Metadaten werden als Query-Parameter übergeben.
Das PDF wird gestreamt in den Speicher geschrieben und in die Queue delivery-segmentation
eingereiht. Nach der Segmentierung wird pro erkannter Lieferschein-Seite eine Lieferung
im Status PROCESSING angelegt und die Extraktion über delivery-processing gestartet.
Die Antwort enthält sofort fileId und jobId — die Lieferzeilen erscheinen erst nach
Abschluss der Segmentierung. Abfragen Sie anschließend GET /deliveries.
Maximale PDF-Größe: 16 MiB.
curl --request POST \
--url https://api.comstruct.com/v1/deliveries/pdf \
--header 'Content-Type: application/pdf' \
--header 'X-API-Key: <api-key>' \
--data '"<string>"'import requests
url = "https://api.comstruct.com/v1/deliveries/pdf"
payload = "<string>"
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/pdf"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/pdf'},
body: JSON.stringify('<string>')
};
fetch('https://api.comstruct.com/v1/deliveries/pdf', 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/deliveries/pdf",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode('<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/deliveries/pdf"
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/deliveries/pdf")
.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/deliveries/pdf")
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{
"fileId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"success": true,
"jobId": "42"
}{
"error": "Validation failed",
"message": "The provided data did not pass validation checks"
}{
"error": "Validation failed",
"message": "The provided data did not pass validation checks"
}{
"error": "Validation failed",
"message": "The provided data did not pass validation checks"
}{
"error": "Validation failed",
"message": "The provided data did not pass validation checks"
}{
"error": "Validation failed",
"message": "The provided data did not pass validation checks"
}Übersicht
Lädt ein Lieferschein-PDF hoch und startet die asynchrone Segmentierung und Extraktion (Stapel-/Heftscan). Geeignet für einzelne Lieferscheine sowie PDF-Bundles mit mehreren Lieferscheinen und optionalen Bestellscheinen. Das PDF wird gestreamt gespeichert und in die Segmentierungs-Queue eingereiht. Pro erkanntem Lieferschein entsteht danach eine Lieferung im StatusPROCESSING; die Extraktion läuft asynchron. Die Antwort enthält sofort fileId und jobId — die Lieferzeilen erscheinen erst nach der Segmentierung.
delivery-async-processing. Ohne aktiviertes Flag antwortet die API mit 403.Berechtigungen
| Scope | Tenant-Typ |
|---|---|
deliveries:patch | Nur Kunden (CUSTOMER_ONLY) |
Header
| Header | Pflicht | Beschreibung |
|---|---|---|
x-api-key | Ja | API-Schlüssel mit Scope deliveries:patch |
Content-Type | Ja | Muss application/pdf sein |
Content-Length | Ja | Größe des PDF-Bodys in Bytes (max. 16 MiB) |
Query-Parameter
| Parameter | Pflicht | Beschreibung |
|---|---|---|
projectId | Nein | Projekt-UUID, falls zum Upload-Zeitpunkt bekannt. Bei projektgebundenen API-Schlüsseln wird andernfalls das konfigurierte Projekt verwendet; sonst ermittelt der Worker das Projekt |
supplierId | Nein | Lieferanten-UUID, falls zum Upload-Zeitpunkt bekannt |
sourceType | Nein | Quelle der Lieferung. Standard: COMSTRUCT_API |
Verhalten
- Der Request-Body ist das rohe PDF (kein multipart, kein Base64).
- Metadaten werden ausschließlich über Query-Parameter übergeben.
- Bei projektgebundenen API-Schlüsseln kann
projectIdweggelassen werden — das Projekt des Schlüssels wird verwendet. - Bei anderen Kunden-API-Schlüsseln kann
projectIdebenfalls weggelassen werden — der Worker ermittelt das Projekt asynchron. - Nach erfolgreichem Upload: Segmentierung → Fan-out → Extraktion. Abfragen Sie
GET /deliveries, um die erstellten Zeilen zu sehen. fileIdist die ID des hochgeladenen Bundle-Dokuments, keine Lieferungs-ID.
Beispiel
curl -X POST "https://api.comstruct.com/v1/deliveries/pdf" \
-H "x-api-key: IHR_API_SCHLUESSEL" \
-H "Content-Type: application/pdf" \
--data-binary @lieferschein.pdf
Erfolgreiche Antwort
{
"fileId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"jobId": "42",
"success": true
}
Response Codes
| Code | Beschreibung |
|---|---|
200 | PDF hochgeladen und Segmentierung eingereiht |
400 | Ungültiges PDF oder fehlender Content-Length |
401 | Nicht autorisiert — fehlender oder ungültiger API-Schlüssel |
403 | Keine Berechtigung — fehlender Scope, falscher Tenant-Typ oder Feature-Flag deaktiviert |
413 | PDF überschreitet 16 MiB |
500 | Interner Serverfehler beim Speichern oder Einreihen |
Autorisierungen
API-Schlüssel zur Authentifizierung. Kontaktieren Sie Ihren Customer Success Manager, um einen API-Schlüssel zu erhalten.
Jeder Endpunkt erfordert spezifische Berechtigungen (Scopes); die erforderlichen Scopes werden pro Endpunkt angezeigt.
Abfrageparameter
Projekt-UUID. Pflicht, sofern der API-Schlüssel nicht projektgebunden ist (dann wird das Projekt des Schlüssels verwendet) oder der Aufrufer kein Admin ist.
Optionale Lieferanten-UUID, falls zum Upload-Zeitpunkt bekannt
Quelle der Lieferung. Standard für öffentliche API-Uploads: COMSTRUCT_API.
WEB_APP_IMPORT, MAIL, GENERAL_MAIL, COMSTRUCT_API, EXTERNAL_API, PORTAL, APP_SCAN Body
Rohes PDF (binär)
The body is of type file.