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"
    }
  ]
}
'
{ "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"