Skip to main content
PATCH
/
deliveries
/
{id}
Lieferung aktualisieren
curl --request PATCH \
  --url https://api.comstruct.com/v1/deliveries/{id} \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "comment": "<string>",
  "planned_arrival_time": "2023-11-07T05:31:56Z",
  "order_number": "<string>",
  "project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "project_number": "<string>",
  "invoice_number": "<string>",
  "delivery_number": "<string>",
  "work_type_id": "<string>",
  "charging_number": "<string>",
  "received_at": "2023-11-07T05:31:56Z",
  "invoice_matched": true,
  "marked": true,
  "charged": true,
  "items": [
    {
      "title": "<string>",
      "quantity": 123,
      "unit": "<string>",
      "product_number": "<string>",
      "type": "<string>",
      "work_type_id": "<string>",
      "marked": true,
      "invoice_matched": true,
      "charged": true,
      "purchase_order_item_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
    }
  ],
  "properties": {},
  "plant": {
    "title": "<string>"
  }
}
'
{ "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a", "delivery_number": "<string>", "comment": "<string>", "planned_arrival_time": "2023-11-07T05:31:56Z", "marked": true, "invoice_matched": true, "charged": true, "received_at": "2023-11-07T05:31:56Z", "items": [ { "title": "<string>", "quantity": 123, "unit": "<string>", "product_number": "<string>", "work_type_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a", "marked": true, "invoice_matched": true, "charged": true } ] }

Overview

This endpoint allows customers to update existing deliveries. Changes are recorded in the delivery history. Only deliveries belonging to the API key’s customer can be patched.
Marked (locked) deliveries cannot be edited. To update a marked delivery, unmark it first via the web app.

Permissions

ScopeTenant type
deliveries:patchCustomer only (CUSTOMER_ONLY)
The API key must be linked to a customer. Supplier API keys cannot use this endpoint.

Headers

HeaderRequiredDescription
x-api-keyYesAPI key with scope deliveries:patch
x-change-reasonNoReason for the change (stored in delivery history)

Editable fields

Delivery

FieldTypeDescription
commentstringFree-text comment
planned_arrival_timestring (ISO 8601)Planned arrival time
order_numberstringOrder number
project_iduuidProject assignment
project_numberstringProject number
invoice_numberstringInvoice number
delivery_numberstringDelivery note number
work_type_idstringWork type ID
charging_numberstringCharging number
received_atstring (ISO 8601)Received timestamp
invoice_matchedbooleanInvoice matching confirmed
markedbooleanMark delivery as verified
chargedbooleanMark delivery as charged
propertiesobjectAdditional properties (merged with existing)
plantobjectPlant ({ "title": "..." })

Items

FieldTypeDescription
titlestringItem description
quantitynumberQuantity
unitstringUnit of measure
product_numberstringProduct number
typestringItem type
work_type_idstringWork type ID
markedbooleanMark item as verified
invoice_matchedbooleanInvoice matching confirmed
chargedbooleanMark item as charged
purchase_order_item_iduuidLink to a purchase order item

Behavior

  • Only changed fields are updated. Fields not included in the body remain unchanged.
  • If no changes are detected, the existing delivery is returned unchanged.
  • When boolean fields (marked, invoice_matched, charged) are changed at the delivery level, all items are synchronized.
  • Setting marked: true automatically sets received_at to the current timestamp.
  • Changes to properties are merged with existing properties.

Response codes

CodeDescription
200Delivery successfully updated (or returned unchanged)
400Invalid input or delivery is marked/locked
403Forbidden — delivery belongs to another customer
404Delivery not found
422Update failed

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.

Headers

x-change-reason
string

Grund für die Änderung (wird in der Lieferhistorie gespeichert)

Path Parameters

id
string<uuid>
required

Lieferungs-ID (UUID)

Body

application/json

Alle Felder sind optional. Nur angegebene Felder werden aktualisiert.

comment
string

Freitext-Kommentar

planned_arrival_time
string<date-time>

Geplante Ankunftszeit (ISO 8601)

order_number
string

Bestellnummer

project_id
string<uuid>

Projektzuordnung

project_number
string

Projektnummer

invoice_number
string

Rechnungsnummer

delivery_number
string

Lieferscheinnummer

work_type_id
string

Leistungsart-ID

charging_number
string

Verrechnungsnummer

received_at
string<date-time>

Empfangszeitpunkt (ISO 8601)

invoice_matched
boolean

Rechnungszuordnung bestätigt

marked
boolean

Lieferung als verifiziert markieren

charged
boolean

Lieferung als berechnet markieren

items
object[]

Positionen der Lieferung

properties
object

Zusätzliche Eigenschaften (wird mit bestehenden zusammengeführt)

plant
object

Response

Lieferung erfolgreich aktualisiert (oder unverändert zurückgegeben)

id
string<uuid>

Lieferungs-ID

delivery_number
string

Lieferscheinnummer

comment
string

Kommentar

planned_arrival_time
string<date-time>

Geplante Ankunftszeit

marked
boolean

Ob die Lieferung markiert/verifiziert wurde

invoice_matched
boolean

Rechnungszuordnung bestätigt

charged
boolean

Lieferung als berechnet markiert

received_at
string<date-time>

Empfangszeitpunkt

items
object[]