Skip to main content
WEBHOOK

Overview

When a customer dispatches an order to a supplier API, comstruct-logic POSTs the JSON below to the supplier’s https:// URL. This is not a call to api.comstruct.com, and comstruct does not send an x-api-key. The order contact must be exactly one https:// URL. An email address on the same contact sends the order by email instead.
context.status is the status before this dispatch. Read the resulting status from change_type. After a successful response, PLACE_ORDER and EDIT_ORDER become ORDERED, and CANCEL_ORDER becomes CANCELLED.

When the webhook is sent

COMPLETE_ORDER (goods received on site) is not sent to the supplier API.

Headers

Fields

context

Line item (items[] and changes.items[])

Older type keys are rewritten before send, including REINFORCEMENT → STEEL_REINFORCEMENT and BULK_GOODS → EARTH_MATERIALS.

Attachments (attachments[])

changes (EDIT_ORDER only)

Response

Reply with JSON. comstruct does not check the HTTP status.
When a contact has email addresses and one extra https:// URL, that URL receives the same shape as a copy of the email. There, context already includes the new status and the applied field changes, and comment can carry the action note. HTTP 2xx counts as success. supplier_order_number is stored only when success is not false and the number is a non-empty string.
The return path — supplier confirm, decline, and edit — is Update supplier order.

Body

application/json
order_id
string<uuid>
required

ID der Bestellung in comstruct

Example:

"11111111-1111-4111-8111-111111111111"

change_type
enum<string>
required

Art des Versands:

  • PLACE_ORDER — neue Bestellung
  • EDIT_ORDER — Änderung; Details in changes
  • CANCEL_ORDER — Stornierung
Available options:
PLACE_ORDER,
EDIT_ORDER,
CANCEL_ORDER
context
object
required

Stand der Bestellung zum Zeitpunkt des Versands, bevor comstruct den neuen Status speichert.

changes
object
required

Geänderte Felder. Bei PLACE_ORDER und CANCEL_ORDER ist das Objekt leer. Bei EDIT_ORDER sind nur die vom Benutzer geänderten Felder gesetzt. items ersetzt in diesem Fall die Positionsliste. planned_delivery_time nutzt dasselbe Berlin-Format wie context.planned_delivery_time. items[].type ist normalisiert.

supplier_order_number
string | null

Bisherige Lieferantenbestellnummer. null, solange der Lieferant noch keine Nummer zurückgemeldet hat.

Example:

"SUP-2026-0001"

comment
string

Optionaler Kommentar zu dieser Aktion. Beim API-Versand setzt comstruct das Feld nicht. Der gespeicherte Bestellkommentar steht in context.comment. Eine Webhook-Kopie neben einer E-Mail-Adresse kann den Aktionskommentar hier enthalten. In dieser Kopie steht in context bereits der neue Status.

attachments
object[]

Spezifikationsanhänge als Base64. Fehlt, wenn die Bestellung keine Anhänge hat. PDF-Anhänge lassen type weg (als application/pdf lesen). Maschinenlesbare Listen setzen type auf text/plain und enden auf .abs.

Response

200 - application/json

JSON-Antwort des Lieferanten. Der HTTP-Status wird ignoriert; success entscheidet, ob die Bestellung als gesendet gilt.

success
boolean
required

true nimmt die Bestellung an. Jeder andere Wert — einschließlich eines fehlenden Feldes — bricht den Versand ab. Die Bestellung bleibt unverändert.

message
string

Hinweis für den Benutzer. Wird angezeigt, wenn success nicht true ist.

Example:

"Bestellung angenommen"

supplier_order_number
string

Lieferanteneigene Bestellnummer. Wird bei success: true an der Bestellung gespeichert.

Example:

"SUP-2026-0001"