Skip to main content
PATCH
/
supplier-orders
/
{id}
curl --request PATCH \
  --url https://api.comstruct.com/v1/supplier-orders/{id} \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "change_type": "CONFIRM_ORDER",
  "comment": "Bestellung wird wie geplant ausgeliefert."
}
'
{
  "message": "Die aktualisierte Bestellung wurde an das Bauunternehmen gesendet.",
  "error": null
}

Documentation Index

Fetch the complete documentation index at: https://developer.comstruct.com/llms.txt

Use this file to discover all available pages before exploring further.

Overview

This endpoint lets a supplier update one of their assigned orders through the comstruct API. Confirming, declining, editing, confirming a cancellation, confirming an on-demand call-off, and acknowledging receipt are all handled through a single PATCH call. The actual status transition is derived server-side from the change_type field — status is intentionally not part of the request body so the state machine stays on the server.
If the submitted fields match the current state of the order, the endpoint replies with Keine Änderungen (“No changes”) and skips the write. ERP systems can therefore safely include the full order payload on confirmations without risking accidental mutations.

Permissions

ScopeTenant type
orders:writeSupplier API key (SUPPLIER_AND_OPTIONAL_CUSTOMER)
The API key must be linked to a supplier. Customer-only API keys cannot use this endpoint. Suppliers can only update orders that are assigned to their own supplier account.

Headers

HeaderRequiredDescription
x-api-keyYesAPI key with scope orders:write
Content-TypeYesapplication/json

Path parameters

ParameterTypeDescription
iduuidUnique ID of the order to update

Change types (change_type)

ValueEffectPrecondition
CONFIRM_ORDERSets status to CONFIRMED
DECLINE_ORDERSets status to DECLINED
EDIT_ORDERApplies the fields in changes; status stays the same
CONFIRM_CANCEL_ORDERSets status to CANCEL_CONFIRMEDOrder must be in status CANCELLED
CONFIRM_ON_DEMANDSets status to ON_DEMAND_CONFIRMED
RECEIVE_ORDERSets status to RECEIVED
changes is only consumed for EDIT_ORDER. For every other change type the body of changes is ignored.

Editable fields (only on EDIT_ORDER)

FieldTypeDescription
supplier_order_numberstringSupplier-side order number
planned_delivery_timestring (ISO 8601)Planned delivery date / time
commentstringSupplier comment on the order
propertiesobjectFree-form additional metadata (shallow-merged with existing properties)
itemsarrayOrder line items — replaces the existing item list

Item fields (items[])

FieldTypeDescription
titlestringLine item title
quantitynumber (≥ 0)Quantity
unitstringUnit of measure (m3, t, kg, stk, h, pau, …)
descriptionstringOptional long description
product_numberstringSupplier product number
typestringLine item type
markedbooleanFlag the line item as verified

Behavior

  • Only fields that actually differ from the current state are written.
  • If EDIT_ORDER produces no real diff, the endpoint replies with Keine Änderungen and writes nothing.
  • properties is shallow-merged with the existing payload — keys you don’t send keep their previous value.
  • items is fully replaced when present in changes.
  • Every successful mutation triggers a change notification email to the customer; the comment is forwarded in that email.

Response codes

CodeDescription
200Order updated successfully or no changes detected
400Invalid input — validation failed
401Unauthorized — API key is not linked to a supplier
403Forbidden — missing orders:write scope, or order belongs to another supplier
404Order not found / invalid id
500Internal server error

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.

Path Parameters

id
string<uuid>
required

Bestellungs-ID (UUID)

Body

application/json
change_type
enum<string>
required

Treibt die Statusübergänge der Bestellung:

  • CONFIRM_ORDER → Status CONFIRMED
  • DECLINE_ORDER → Status DECLINED
  • EDIT_ORDER → Status unverändert; changes werden angewendet
  • CONFIRM_CANCEL_ORDER → Status CANCEL_CONFIRMED (Bestellung muss vorher CANCELLED sein)
  • CONFIRM_ON_DEMAND → Status ON_DEMAND_CONFIRMED
  • RECEIVE_ORDER → Status RECEIVED
Available options:
CONFIRM_ORDER,
DECLINE_ORDER,
EDIT_ORDER,
CONFIRM_CANCEL_ORDER,
CONFIRM_ON_DEMAND,
RECEIVE_ORDER
comment
string

Optionaler Kommentar des Lieferanten zu dieser Änderung. Wird in der Benachrichtigung an das Bauunternehmen mitgesendet.

Maximum string length: 2000
changes
object

Konkrete Feldänderungen. Wird nur für change_type: EDIT_ORDER ausgewertet — bei allen anderen Änderungstypen wird der Inhalt ignoriert, sodass ERP-Systeme den vollständigen Bestelldatensatz risikofrei mitschicken können.

Response

Bestellung erfolgreich aktualisiert oder keine Änderungen erkannt

message
string

Menschenlesbare Statusmeldung; Keine Änderungen signalisiert, dass keine Mutation durchgeführt wurde.

Example:

"Die aktualisierte Bestellung wurde an das Bauunternehmen gesendet."

error
string | null

Fehlermeldung, sofern aufgetreten (sonst null)

Example:

null