Skip to main content
POST
/
workflows
/
trigger
Workflow-Verarbeitung auslösen
curl --request POST \
  --url https://api.comstruct.com/v1/workflows/trigger \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "external_id": "INV-2024-001",
  "base64document": "JVBERi0xLjQKJcOkw7zDtsO...",
  "project_number": "PRJ-2024-001",
  "creditor_number": "CR-001",
  "creditor_name": "ABC Supplies Ltd.",
  "invoice_number": "INV-2024-001",
  "invoice_date": "2024-01-15",
  "due_date": "2024-02-15",
  "currency": "EUR",
  "net_amount": 1000,
  "total_amount": 1190,
  "total_tax_amount": 190,
  "tenant": "tenant-123",
  "comment": "Spezielle Handhabung erforderlich",
  "document_type": "INVOICE",
  "assignee": "john.doe@example.com",
  "accounts": [
    {
      "account_number": "1000",
      "project_number": "PRJ-2024-001",
      "quantity": 10,
      "net_amount": 1000,
      "gross_amount": 1190,
      "tax_amount": 190
    }
  ],
  "dimensions": [
    {
      "dimension_label": "Kostenstelle",
      "option_title": "Verwaltung"
    }
  ]
}
'
import requests

url = "https://api.comstruct.com/v1/workflows/trigger"

payload = {
"external_id": "INV-2024-001",
"base64document": "JVBERi0xLjQKJcOkw7zDtsO...",
"project_number": "PRJ-2024-001",
"creditor_number": "CR-001",
"creditor_name": "ABC Supplies Ltd.",
"invoice_number": "INV-2024-001",
"invoice_date": "2024-01-15",
"due_date": "2024-02-15",
"currency": "EUR",
"net_amount": 1000,
"total_amount": 1190,
"total_tax_amount": 190,
"tenant": "tenant-123",
"comment": "Spezielle Handhabung erforderlich",
"document_type": "INVOICE",
"assignee": "john.doe@example.com",
"accounts": [
{
"account_number": "1000",
"project_number": "PRJ-2024-001",
"quantity": 10,
"net_amount": 1000,
"gross_amount": 1190,
"tax_amount": 190
}
],
"dimensions": [
{
"dimension_label": "Kostenstelle",
"option_title": "Verwaltung"
}
]
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
external_id: 'INV-2024-001',
base64document: 'JVBERi0xLjQKJcOkw7zDtsO...',
project_number: 'PRJ-2024-001',
creditor_number: 'CR-001',
creditor_name: 'ABC Supplies Ltd.',
invoice_number: 'INV-2024-001',
invoice_date: '2024-01-15',
due_date: '2024-02-15',
currency: 'EUR',
net_amount: 1000,
total_amount: 1190,
total_tax_amount: 190,
tenant: 'tenant-123',
comment: 'Spezielle Handhabung erforderlich',
document_type: 'INVOICE',
assignee: 'john.doe@example.com',
accounts: [
{
account_number: '1000',
project_number: 'PRJ-2024-001',
quantity: 10,
net_amount: 1000,
gross_amount: 1190,
tax_amount: 190
}
],
dimensions: [{dimension_label: 'Kostenstelle', option_title: 'Verwaltung'}]
})
};

fetch('https://api.comstruct.com/v1/workflows/trigger', 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/workflows/trigger",
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([
'external_id' => 'INV-2024-001',
'base64document' => 'JVBERi0xLjQKJcOkw7zDtsO...',
'project_number' => 'PRJ-2024-001',
'creditor_number' => 'CR-001',
'creditor_name' => 'ABC Supplies Ltd.',
'invoice_number' => 'INV-2024-001',
'invoice_date' => '2024-01-15',
'due_date' => '2024-02-15',
'currency' => 'EUR',
'net_amount' => 1000,
'total_amount' => 1190,
'total_tax_amount' => 190,
'tenant' => 'tenant-123',
'comment' => 'Spezielle Handhabung erforderlich',
'document_type' => 'INVOICE',
'assignee' => 'john.doe@example.com',
'accounts' => [
[
'account_number' => '1000',
'project_number' => 'PRJ-2024-001',
'quantity' => 10,
'net_amount' => 1000,
'gross_amount' => 1190,
'tax_amount' => 190
]
],
'dimensions' => [
[
'dimension_label' => 'Kostenstelle',
'option_title' => 'Verwaltung'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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/workflows/trigger"

payload := strings.NewReader("{\n \"external_id\": \"INV-2024-001\",\n \"base64document\": \"JVBERi0xLjQKJcOkw7zDtsO...\",\n \"project_number\": \"PRJ-2024-001\",\n \"creditor_number\": \"CR-001\",\n \"creditor_name\": \"ABC Supplies Ltd.\",\n \"invoice_number\": \"INV-2024-001\",\n \"invoice_date\": \"2024-01-15\",\n \"due_date\": \"2024-02-15\",\n \"currency\": \"EUR\",\n \"net_amount\": 1000,\n \"total_amount\": 1190,\n \"total_tax_amount\": 190,\n \"tenant\": \"tenant-123\",\n \"comment\": \"Spezielle Handhabung erforderlich\",\n \"document_type\": \"INVOICE\",\n \"assignee\": \"john.doe@example.com\",\n \"accounts\": [\n {\n \"account_number\": \"1000\",\n \"project_number\": \"PRJ-2024-001\",\n \"quantity\": 10,\n \"net_amount\": 1000,\n \"gross_amount\": 1190,\n \"tax_amount\": 190\n }\n ],\n \"dimensions\": [\n {\n \"dimension_label\": \"Kostenstelle\",\n \"option_title\": \"Verwaltung\"\n }\n ]\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")

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/workflows/trigger")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"external_id\": \"INV-2024-001\",\n \"base64document\": \"JVBERi0xLjQKJcOkw7zDtsO...\",\n \"project_number\": \"PRJ-2024-001\",\n \"creditor_number\": \"CR-001\",\n \"creditor_name\": \"ABC Supplies Ltd.\",\n \"invoice_number\": \"INV-2024-001\",\n \"invoice_date\": \"2024-01-15\",\n \"due_date\": \"2024-02-15\",\n \"currency\": \"EUR\",\n \"net_amount\": 1000,\n \"total_amount\": 1190,\n \"total_tax_amount\": 190,\n \"tenant\": \"tenant-123\",\n \"comment\": \"Spezielle Handhabung erforderlich\",\n \"document_type\": \"INVOICE\",\n \"assignee\": \"john.doe@example.com\",\n \"accounts\": [\n {\n \"account_number\": \"1000\",\n \"project_number\": \"PRJ-2024-001\",\n \"quantity\": 10,\n \"net_amount\": 1000,\n \"gross_amount\": 1190,\n \"tax_amount\": 190\n }\n ],\n \"dimensions\": [\n {\n \"dimension_label\": \"Kostenstelle\",\n \"option_title\": \"Verwaltung\"\n }\n ]\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.comstruct.com/v1/workflows/trigger")

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/json'
request.body = "{\n \"external_id\": \"INV-2024-001\",\n \"base64document\": \"JVBERi0xLjQKJcOkw7zDtsO...\",\n \"project_number\": \"PRJ-2024-001\",\n \"creditor_number\": \"CR-001\",\n \"creditor_name\": \"ABC Supplies Ltd.\",\n \"invoice_number\": \"INV-2024-001\",\n \"invoice_date\": \"2024-01-15\",\n \"due_date\": \"2024-02-15\",\n \"currency\": \"EUR\",\n \"net_amount\": 1000,\n \"total_amount\": 1190,\n \"total_tax_amount\": 190,\n \"tenant\": \"tenant-123\",\n \"comment\": \"Spezielle Handhabung erforderlich\",\n \"document_type\": \"INVOICE\",\n \"assignee\": \"john.doe@example.com\",\n \"accounts\": [\n {\n \"account_number\": \"1000\",\n \"project_number\": \"PRJ-2024-001\",\n \"quantity\": 10,\n \"net_amount\": 1000,\n \"gross_amount\": 1190,\n \"tax_amount\": 190\n }\n ],\n \"dimensions\": [\n {\n \"dimension_label\": \"Kostenstelle\",\n \"option_title\": \"Verwaltung\"\n }\n ]\n}"

response = http.request(request)
puts response.read_body
{
  "success": true,
  "external_id": "INV-2024-001",
  "invoiceId": "123",
  "jobId": "job-789xyz012"
}
Submit invoices from external systems (e.g. JobRouter) for asynchronous processing in comstruct. Use the external_id later with the Workflow status endpoint to check processing status.

Dimension assignments

The optional dimensions field lets external systems pass dimension values as { dimension_label, option_title } pairs. These are resolved against the tenant’s configured invoice dimensions and assigned to the created invoice. Workflow-provided dimension values take priority over AI-extracted values.

Authorizations

X-API-Key
string
header
required

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.

Body

application/json
external_id
string
required

Externe Kennung für die Rechnung (zur späteren Statusabfrage)

Example:

"INV-2024-001"

base64document
string<byte>
required

Base64-kodiertes PDF-Dokument

Example:

"JVBERi0xLjQKJcOkw7zDtsO..."

project_number
string
required

Projektnummer

Example:

"PRJ-2024-001"

creditor_name
string
required

Name des Kreditors/Lieferanten

Example:

"ABC Supplies Ltd."

invoice_number
string
required

Rechnungsnummer

Example:

"INV-2024-001"

invoice_date
string<date>
required

Rechnungsdatum im Format YYYY-MM-DD

Example:

"2024-01-15"

net_amount
number<double>
required

Nettobetrag

Example:

1000

total_amount
number<double>
required

Gesamtbetrag (brutto)

Example:

1190

tenant
string
required

Mandanten-Kennung

Example:

"tenant-123"

creditor_number
string

Kreditorennummer (optional)

Example:

"CR-001"

due_date
string<date>

Fälligkeitsdatum im Format YYYY-MM-DD (optional)

Example:

"2024-02-15"

receipt_date
string<date>

Buchungsdatum im Format YYYY-MM-DD (optional). Wenn nicht angegeben, wird das aktuelle Datum verwendet.

Example:

"2024-01-16"

currency
string
default:EUR

Währungscode (ISO-4217)

Example:

"EUR"

comment
string

Kommentar (optional)

Example:

"Spezielle Handhabung erforderlich"

document_type
enum<string>
default:INVOICE

Dokumenttyp

Available options:
INVOICE,
CREDIT_NOTE
Example:

"INVOICE"

total_tax_amount
number<double>

Gesamter Steuerbetrag (optional)

Example:

190

assignee
string<email>

E-Mail-Adresse des Benutzers, dem die Rechnung zugewiesen werden soll (optional)

Example:

"john.doe@example.com"

accounts
object[]

Vordefinierte Rechnungskontierungen mit Kontonummern, Mengen und Projektnummern (optional). Hat Vorrang vor der Comstruct-Kontierung.

Example:
[
{
"account_number": "1000",
"project_number": "PRJ-001",
"quantity": 10,
"net_amount": 1000,
"gross_amount": 1190,
"tax_amount": 190
}
]
dimensions
object[]

Optionale Dimensionszuweisungen als Label/Titel-Paare (z.B. Kostenstelle, Abteilung). Werden anhand des Labels gegen die konfigurierten Rechnungsdimensionen und des Titels gegen die Dimensionsoptionen des Mandanten aufgelöst. Hat Vorrang vor KI-extrahierten Dimensionswerten.

Example:
[
{
"dimension_label": "Kostenstelle",
"option_title": "Verwaltung"
},
{
"dimension_label": "Abteilung",
"option_title": "Einkauf"
}
]

Response

Workflow erfolgreich ausgelöst

success
boolean

Gibt an, ob der Workflow erfolgreich ausgelöst wurde

Example:

true

external_id
string

Externe Kennung der verarbeiteten Rechnung

Example:

"INV-2024-001"

invoiceId
string

Interne Rechnungs-ID

Example:

"123"

jobId
string

Hintergrund-Job-ID zur Verfolgung des Verarbeitungsstatus

Example:

"job-789xyz012"