API · v1 · stable
CODEMETA OSDeveloper Center
FR
Ouvrir la console
Entité · sales_orders

Sales Order Schema

ID du schéma
sales_order
Collection
sales_orders
Autorisations
  • Liresales_order_view
  • Créersales_order_create
  • Modifiersales_order_edit
  • Supprimersales_order_delete

Champs

Sales Order Schema

sales_orders4 autorisations

Schema for validating sales order entities

documentLanguagestringfacultatif

Language the document (PDF) is rendered in. Decided when the document is created (explicit → customer language → tenant default → de) and never re-derived. Missing = de.

deenesfrnlnull
nullable
partyIduuidobligatoire

Customer party UUID

contactPartyIduuidfacultatif

Contact person UUID at customer

nullable
assignedToIduuidfacultatif

Assigned MSP employee UUID

nullable
orgUnitIduuidfacultatif

Responsible org unit UUID

nullable
statusstringobligatoire

Order status

ORDER_ENTRY_IN_PROGRESSSUBMITTEDPENDING_APPROVALORDER_CONFIRMATION_PRINTEDIN_PROGRESSPARTIALLY_FULFILLEDCLOSEDMANUALLY_CLOSEDCANCELLED
orderDatedatetimeobligatoire

Order date

sourcestringfacultatif

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

max. 50 caractèresnullable
notestringfacultatif

Customer note

max. 2000 caractèresnullable
internalNotestringfacultatif

Internal note (not visible to customer)

max. 4000 caractèresnullable
orderItemsobject[]facultatif

Order line items

Par défaut : []
iduuidobligatoire
weclappItemIdstringfacultatif

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 caractèresPar défaut : nullnullable
codemetaBillingMarkerstringfacultatif

ADR 0918: marker of a position Codemeta itself appended to the weclapp order — `[TR:…]` for a transferred booking (ADR 0412), `[PB:…]` for a collective replacement position (ADR 0634). Derived from the weclapp item (note, legacy description/title) on every mirror run, never preserved locally. Such a position is already billed work, not a sold position: the order intake never materialises it as a project position/task. Null for every other position.

max. 200 caractèresPar défaut : nullnullable
articleIdstringobligatoire

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.

Motifnullable
articleNamestringfacultatif

Denormalized article name

nullable
articleNumberstringfacultatif

Denormalized article number

nullable
descriptionstringfacultatif

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

Par défaut : nullnullable
unitNamestringfacultatif

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

max. 100 caractèresPar défaut : nullnullable
externalArticleRefobjectfacultatif

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.

Par défaut : nullnullable
quantitystringobligatoire

Ordered quantity

Motif
unitPricestringobligatoire

Unit price at time of order

Motif
discountPercentstringfacultatif

Line item discount percentage

Motifnullable
netAmountstringfacultatif

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

Motifnullable
billingIntervalstringfacultatif

Billing interval for this item

MONTHLYQUARTERLYSEMI_ANNUALYEARLYONE_TIME
nullable
setupFeestringfacultatif

One-time setup fee for this item

Motifnullable
parentItemIduuidfacultatif

Parent bundle item UUID

nullable
isBomItembooleanfacultatif

Is a resolved BOM position from a bundle

Par défaut : false
fulfilledQuantitystringfacultatif

Fulfilled quantity

MotifPar défaut : "0"
fulfilledAtdatetimefacultatif

Fulfillment timestamp

nullable
provisioningStatusstringfacultatif

Provisioning status

PENDINGIN_PROGRESSDONEFAILED
Par défaut : "PENDING"
positionNumberintegerobligatoire

Position number for sorting

≥ 0
vatRatestringfacultatif

Item-level VAT rate

Par défaut : nullnullable
shippedQuantitystringfacultatif

Quantity shipped (synced from shipments)

Par défaut : "0"
serialNumbersstring[]facultatif

Assigned serial numbers

Par défaut : []
taskIdstringfacultatif

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

MotifPar défaut : nullnullable
ticketIdstringfacultatif

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

MotifPar défaut : nullnullable
projectIdstringfacultatif

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

MotifPar défaut : nullnullable
isServiceItembooleanfacultatif

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

Par défaut : nullnullable
plannedMinutesintegerfacultatif

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

≥ 0Par défaut : nullnullable
plannedAmountstringfacultatif

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

MotifPar défaut : nullnullable
availabilityobjectfacultatif

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

Par défaut : nullnullable
netAmountstringfacultatif

Total net amount

Motifnullable
recurringAmountstringfacultatif

Recurring portion of total

Motifnullable
onetimeAmountstringfacultatif

One-time portion of total

Motifnullable
setupFeesTotalstringfacultatif

Total setup fees

Motifnullable
currencyCodestringfacultatif

ISO 4217 currency code

MotifPar défaut : "EUR"
submittedAtdatetimefacultatif

Submission timestamp

nullable
submittedByuuidfacultatif

User who submitted the order

nullable
approvedAtdatetimefacultatif

Approval timestamp

nullable
approvedByuuidfacultatif

User who approved the order

nullable
rejectedAtdatetimefacultatif

Rejection timestamp

nullable
rejectedByuuidfacultatif

User who rejected the order

nullable
rejectionReasonstringfacultatif

Reason for rejection

max. 2000 caractèresnullable
fulfillmentStartedAtdatetimefacultatif

Timestamp the order entered fulfillment (IN_PROGRESS) — ADR 0777

nullable
fulfilledAtdatetimefacultatif

Full fulfillment timestamp

nullable
closedAtdatetimefacultatif

Timestamp the order was closed (CLOSED / MANUALLY_CLOSED)

nullable
cancelledAtdatetimefacultatif

Cancellation timestamp

nullable
cancelledByuuidfacultatif

User who cancelled the order

nullable
opportunityIdstringfacultatif

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.

MotifPar défaut : nullnullable
proposalIdstringfacultatif

Legacy: source proposal UUID. ADR 1237: proposal entity removed; field kept for existing documents.

MotifPar défaut : nullnullable
contractIduuidfacultatif

Generated contract UUID

nullable
invoiceIdsuuid[]facultatif

Generated invoice UUIDs (supports partial/collective invoicing)

Par défaut : []
tagsstring[]facultatif

Order tags

Par défaut : []
deliveryAddressobjectfacultatif

Delivery address (snapshot)

Par défaut : nullnullable
invoiceAddressobjectfacultatif

Invoice address (snapshot)

Par défaut : nullnullable
paymentTermIdstringfacultatif

Reference to payment_terms collection

MotifPar défaut : nullnullable
paymentTermsDaysintegerfacultatif
≥ 0Par défaut : nullnullable
paymentMethodstringfacultatif
BANK_TRANSFERSEPA_DIRECT_DEBITCREDIT_CARDCASHPAYPALOTHERnull
Par défaut : nullnullable
headerDiscountstringfacultatif
MotifPar défaut : nullnullable
shippingMethodstringfacultatif
max. 200 caractèresPar défaut : nullnullable
shippingCoststringfacultatif
MotifPar défaut : nullnullable
defaultVatRatestringfacultatif
Par défaut : "19"
vatAmountstringfacultatif
MotifPar défaut : nullnullable
grossAmountstringfacultatif
MotifPar défaut : nullnullable
plannedDeliveryDatedatefacultatif
Par défaut : nullnullable
actualDeliveryDatedatefacultatif
Par défaut : nullnullable
customerOrderNumberstringfacultatif

Customer purchase order number

max. 100 caractèresPar défaut : nullnullable
commissionstringfacultatif

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

max. 255 caractèresPar défaut : nullnullable
orderNumberstringfacultatif

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

max. 30 caractèresPar défaut : nulllecture seulenullable
shipmentMethodNamestringfacultatif

Versandart — resolved NAME behind weclapp §baseSalesRecord.shipmentMethodId. Denormalised by the order sync (weclapp sends only the id next to a pinned properties list) so intake templates can render {{order.shipmentMethodName}}.

max. 255 caractèresPar défaut : nullnullable
warehouseNamestringfacultatif

Lager — resolved NAME behind weclapp §salesOrder.warehouseId. Denormalised by the order sync so intake templates can render {{order.warehouseName}}.

max. 255 caractèresPar défaut : nullnullable
externalReferencesobject[]facultatif

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

Par défaut : []
systemstringobligatoire
max. 100 caractères
externalIdstringobligatoire
max. 200 caractères
externalVersionstringfacultatif
nullable
syncedAtdatetimefacultatif
nullable
weclappSalesOrderIdstringfacultatif

Linked weclapp sales order ID

Par défaut : nullnullable
weclappSalesOrderNumberstringfacultatif

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

max. 100 caractèresPar défaut : nullnullable
weclappOrderUrlstringfacultatif

URL to the linked weclapp sales order detail page

Par défaut : nullnullable
weclappSalesOrderDataobjectfacultatif

Cached weclapp sales order data

Par défaut : nullnullable
weclappCustomAttributesobjectfacultatif

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.

Par défaut : nullnullable

Endpoints standard

Cette ressource suit le contrat CRUD générique de la plateforme. Lisez les conventions pour la pagination, l'idempotence, le verrouillage optimiste et l'audit. Les endpoints principaux :

  • GET /api/v1/sales_orders — Liste, paginée et filtrable
  • GET /api/v1/sales_orders/<id> — Une entité
  • POST /api/v1/sales_orders — Créer
  • PATCH /api/v1/sales_orders/<id> — Mise à jour partielle
  • DELETE /api/v1/sales_orders/<id> — Suppression logique
  • GET /api/v1/sales_orders/<id>/timeline — Audit et activités

Recherche