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"
}Upload delivery PDF
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"
}Overview
Uploads a delivery-note PDF and starts asynchronous segmentation and extraction (staple-scan). Suitable for single delivery notes as well as PDF bundles that contain multiple delivery notes and optional order sheets. The PDF is streamed to storage and enqueued on the segmentation queue. After segmentation, one delivery in statusPROCESSING is created per detected delivery note; extraction then runs asynchronously. The response returns fileId and jobId immediately — delivery rows appear only after segmentation completes.
delivery-async-processing feature flag. Without it, the API responds with 403.Permissions
| Scope | Tenant type |
|---|---|
deliveries:patch | Customer only (CUSTOMER_ONLY) |
Headers
| Header | Required | Description |
|---|---|---|
x-api-key | Yes | API key with scope deliveries:patch |
Content-Type | Yes | Must be application/pdf |
Content-Length | Yes | Size of the PDF body in bytes (max 16 MiB) |
Query parameters
| Parameter | Required | Description |
|---|---|---|
projectId | No | Project UUID if known at upload time. Project-scoped API keys use their configured project when omitted; otherwise the worker resolves the project |
supplierId | No | Supplier UUID if known at upload time |
sourceType | No | Intake source for the delivery. Default: COMSTRUCT_API |
Behavior
- The request body is the raw PDF (not multipart, not Base64).
- Metadata is passed only via query parameters.
- For project-scoped API keys,
projectIdmay be omitted — the key’s project is used. - For other customer API keys,
projectIdmay be omitted — the delivery worker resolves the project asynchronously. - After a successful upload: segmentation → fan-out → extraction. Poll
GET /deliveriesfor the resulting rows. fileIdis the uploaded bundle document id, not a delivery id.
Example
curl -X POST "https://api.comstruct.com/v1/deliveries/pdf" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/pdf" \
--data-binary @delivery-note.pdf
Successful response
{
"fileId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"jobId": "42",
"success": true
}
Response codes
| Code | Description |
|---|---|
200 | PDF uploaded and segmentation queued |
400 | Invalid PDF or missing Content-Length |
401 | Unauthorized — missing or invalid API key |
403 | Forbidden — missing scope, wrong tenant type, or feature flag disabled |
413 | PDF exceeds 16 MiB |
500 | Internal error while storing or enqueueing |
Authorizations
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.
Query Parameters
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.