API · v1 · stabil
CODEMETA OSDeveloper Center
Konsole öffnen
Entity · sales_orders

Sales Order Schema

Schema-ID
sales_order
Collection
sales_orders
Permissions
  • Lesensales_order_view
  • Anlegensales_order_create
  • Ändernsales_order_edit
  • Löschensales_order_delete

Felder

Sales Order Schema

sales_orders4 Permissions

Schema for validating sales order entities

partyIduuiderforderlich

Customer party UUID

contactPartyIduuidoptional

Contact person UUID at customer

nullable
assignedToIduuidoptional

Assigned MSP employee UUID

nullable
orgUnitIduuidoptional

Responsible org unit UUID

nullable
statusstringerforderlich

Order status

ORDER_ENTRY_IN_PROGRESSSUBMITTEDPENDING_APPROVALORDER_CONFIRMATION_PRINTEDIN_PROGRESSPARTIALLY_FULFILLEDCLOSEDMANUALLY_CLOSEDCANCELLED
orderDatedatetimeerforderlich

Order date

sourcestringoptional

Origin of the order (e.g. "portal" for customer-portal submissions)

max 50 Zeichennullable
notestringoptional

Customer note

max 2000 Zeichennullable
internalNotestringoptional

Internal note (not visible to customer)

max 4000 Zeichennullable
orderItemsobject[]optional

Order line items

Default: []
iduuiderforderlich
weclappItemIdstringoptional

weclapp salesOrderItem id — stable anchor so re-imports can match existing local items instead of regenerating them (preserves id/taskId/projectId linkage). Null for internal orders and for items imported before this field existed (positionNumber fallback).

max 200 ZeichenDefault: nullnullable
articleIdstringerforderlich

Article UUID. Nullable to support inbound imports (e.g. weclapp) where the source article has no corresponding codemeta record yet — the missing-article resolver fills these in.

Patternnullable
articleNamestringoptional

Denormalized article name

nullable
articleNumberstringoptional

Denormalized article number

nullable
descriptionstringoptional

Line item description / note (from external systems or manual entry)

Default: nullnullable
unitNamestringoptional

Unit label denormalized at order time (e.g. "Stück", "h")

max 100 ZeichenDefault: nullnullable
externalArticleRefobjectoptional

Reference to the source-system article (e.g. weclapp). Used by the resolve-missing-articles endpoint to fetch and create codemeta articles for unresolved items.

Default: nullnullable
quantitystringerforderlich

Ordered quantity

Pattern
unitPricestringerforderlich

Unit price at time of order

Pattern
discountPercentstringoptional

Line item discount percentage

Patternnullable
netAmountstringoptional

Net amount = quantity * unitPrice * (1 - discount)

Patternnullable
billingIntervalstringoptional

Billing interval for this item

MONTHLYQUARTERLYSEMI_ANNUALYEARLYONE_TIME
nullable
setupFeestringoptional

One-time setup fee for this item

Patternnullable
parentItemIduuidoptional

Parent bundle item UUID

nullable
isBomItembooleanoptional

Is a resolved BOM position from a bundle

Default: false
fulfilledQuantitystringoptional

Fulfilled quantity

PatternDefault: "0"
fulfilledAtdatetimeoptional

Fulfillment timestamp

nullable
provisioningStatusstringoptional

Provisioning status

PENDINGIN_PROGRESSDONEFAILED
Default: "PENDING"
positionNumberintegererforderlich

Position number for sorting

≥ 0
vatRatestringoptional

Item-level VAT rate

Default: nullnullable
shippedQuantitystringoptional

Quantity shipped (synced from shipments)

Default: "0"
serialNumbersstring[]optional

Assigned serial numbers

Default: []
taskIdstringoptional

Linked task UUID (if this position has been materialized as a task)

PatternDefault: nullnullable
ticketIdstringoptional

Linked ticket UUID (if this position has been materialized as a ticket via the "nur Tickets" path)

PatternDefault: nullnullable
projectIdstringoptional

Linked project UUID (if this position has been materialized into a project)

PatternDefault: nullnullable
isServiceItembooleanoptional

True if the article is a service article (computed at import/sync time from article.articleType)

Default: nullnullable
plannedMinutesintegeroptional

Planned effort in minutes, computed at import time when the unit is hour-like (quantity * 60).

≥ 0Default: nullnullable
plannedAmountstringoptional

Planned amount in EUR, computed at import time for non-hour service items (mirrors netAmount).

PatternDefault: nullnullable
availabilityobjectoptional

Cached availability snapshot for delivery/non-service items. Updated by weclapp-order-sync reconcile job.

Default: nullnullable
netAmountstringoptional

Total net amount

Patternnullable
recurringAmountstringoptional

Recurring portion of total

Patternnullable
onetimeAmountstringoptional

One-time portion of total

Patternnullable
setupFeesTotalstringoptional

Total setup fees

Patternnullable
currencyCodestringoptional

ISO 4217 currency code

PatternDefault: "EUR"
submittedAtdatetimeoptional

Submission timestamp

nullable
submittedByuuidoptional

User who submitted the order

nullable
approvedAtdatetimeoptional

Approval timestamp

nullable
approvedByuuidoptional

User who approved the order

nullable
rejectedAtdatetimeoptional

Rejection timestamp

nullable
rejectedByuuidoptional

User who rejected the order

nullable
rejectionReasonstringoptional

Reason for rejection

max 2000 Zeichennullable
fulfilledAtdatetimeoptional

Full fulfillment timestamp

nullable
cancelledAtdatetimeoptional

Cancellation timestamp

nullable
cancelledByuuidoptional

User who cancelled the order

nullable
opportunityIdstringoptional

Source opportunity UUID (sales pipeline anchor). Set when an order is created/won directly without a quotation, so the deal can still be traced back to its Vertriebschance.

PatternDefault: nullnullable
proposalIdstringoptional

Source proposal UUID (if order was created from an accepted proposal)

PatternDefault: nullnullable
contractIduuidoptional

Generated contract UUID

nullable
invoiceIdsuuid[]optional

Generated invoice UUIDs (supports partial/collective invoicing)

Default: []
tagsstring[]optional

Order tags

Default: []
deliveryAddressobjectoptional

Delivery address (snapshot)

Default: nullnullable
invoiceAddressobjectoptional

Invoice address (snapshot)

Default: nullnullable
paymentTermIdstringoptional

Reference to payment_terms collection

PatternDefault: nullnullable
paymentTermsDaysintegeroptional
≥ 0Default: nullnullable
paymentMethodstringoptional
BANK_TRANSFERSEPA_DIRECT_DEBITCREDIT_CARDCASHPAYPALOTHERnull
Default: nullnullable
headerDiscountstringoptional
PatternDefault: nullnullable
shippingMethodstringoptional
max 200 ZeichenDefault: nullnullable
shippingCoststringoptional
PatternDefault: nullnullable
defaultVatRatestringoptional
Default: "19"
vatAmountstringoptional
PatternDefault: nullnullable
grossAmountstringoptional
PatternDefault: nullnullable
plannedDeliveryDatedateoptional
Default: nullnullable
actualDeliveryDatedateoptional
Default: nullnullable
customerOrderNumberstringoptional

Customer purchase order number

max 100 ZeichenDefault: nullnullable
commissionstringoptional

Kommission — free-text reference from weclapp (§baseSalesRecord.commission). Mirrored by the order sync so intake templates can render {{order.commission}} (ADR 0373).

max 255 ZeichenDefault: nullnullable
orderNumberstringoptional

Auto-generated order number (BE-YYYY-NNNNN)

max 30 ZeichenDefault: nullread-onlynullable
externalReferencesobject[]optional

Cross-system linking refs (e.g. weclapp). Read by inbound sync worker.

Default: []
systemstringerforderlich
max 100 Zeichen
externalIdstringerforderlich
max 200 Zeichen
externalVersionstringoptional
nullable
syncedAtdatetimeoptional
nullable
weclappSalesOrderIdstringoptional

Linked weclapp sales order ID

Default: nullnullable
weclappSalesOrderNumberstringoptional

Linked weclapp sales order number (e.g. AB-2026-00042)

max 100 ZeichenDefault: nullnullable
weclappOrderUrlstringoptional

URL to the linked weclapp sales order detail page

Default: nullnullable
weclappSalesOrderDataobjectoptional

Cached weclapp sales order data

Default: nullnullable
weclappCustomAttributesobjectoptional

Generic { [attributeKey]: value } map of the weclapp order-level custom attributes, translated from weclapp's opaque definition ids at sync time (ADR 0285, Phase 0). Backfill-free & additive: orders synced before this field lack it and fall back to defaults. The meaning of each key (deadline / responsible / "transfer" flag) is resolved downstream by the order_intake_profile — this field only carries the raw values.

Default: nullnullable

Standard-Endpoints

Diese Resource folgt dem generischen CRUD-Vertrag der Plattform. Lesen Sie die Konventionen für Pagination, Idempotenz, Optimistic Locking und Audit. Die wichtigsten Endpoints:

  • GET /api/v1/sales_orders — Liste, paginiert + filterbar
  • GET /api/v1/sales_orders/<id> — Einzelne Entity
  • POST /api/v1/sales_orders — Anlegen
  • PATCH /api/v1/sales_orders/<id> — Teil-Update
  • DELETE /api/v1/sales_orders/<id> — Soft-Delete
  • GET /api/v1/sales_orders/<id>/timeline — Audit + Aktivitäten

Suche