API · v1 · estable
CODEMETA OSDeveloper Center
ES
Abrir la consola
Entidad · sales_orders

Sales Order Schema

ID del esquema
sales_order
Colección
sales_orders
Permisos
  • Leersales_order_view
  • Crearsales_order_create
  • Modificarsales_order_edit
  • Eliminarsales_order_delete

Campos

Sales Order Schema

sales_orders4 permisos

Schema for validating sales order entities

documentLanguagestringopcional

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
admite null
partyIduuidobligatorio

Customer party UUID

contactPartyIduuidopcional

Contact person UUID at customer

admite null
assignedToIduuidopcional

Assigned MSP employee UUID

admite null
orgUnitIduuidopcional

Responsible org unit UUID

admite null
statusstringobligatorio

Order status

ORDER_ENTRY_IN_PROGRESSSUBMITTEDPENDING_APPROVALORDER_CONFIRMATION_PRINTEDIN_PROGRESSPARTIALLY_FULFILLEDCLOSEDMANUALLY_CLOSEDCANCELLED
orderDatedatetimeobligatorio

Order date

sourcestringopcional

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

máx. 50 caracteresadmite null
notestringopcional

Customer note

máx. 2000 caracteresadmite null
internalNotestringopcional

Internal note (not visible to customer)

máx. 4000 caracteresadmite null
orderItemsobject[]opcional

Order line items

Valor por defecto: []
iduuidobligatorio
weclappItemIdstringopcional

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).

máx. 200 caracteresValor por defecto: nulladmite null
codemetaBillingMarkerstringopcional

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.

máx. 200 caracteresValor por defecto: nulladmite null
articleIdstringobligatorio

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.

Patrónadmite null
articleNamestringopcional

Denormalized article name

admite null
articleNumberstringopcional

Denormalized article number

admite null
descriptionstringopcional

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

Valor por defecto: nulladmite null
unitNamestringopcional

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

máx. 100 caracteresValor por defecto: nulladmite null
externalArticleRefobjectopcional

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.

Valor por defecto: nulladmite null
quantitystringobligatorio

Ordered quantity

Patrón
unitPricestringobligatorio

Unit price at time of order

Patrón
discountPercentstringopcional

Line item discount percentage

Patrónadmite null
netAmountstringopcional

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

Patrónadmite null
billingIntervalstringopcional

Billing interval for this item

MONTHLYQUARTERLYSEMI_ANNUALYEARLYONE_TIME
admite null
setupFeestringopcional

One-time setup fee for this item

Patrónadmite null
parentItemIduuidopcional

Parent bundle item UUID

admite null
isBomItembooleanopcional

Is a resolved BOM position from a bundle

Valor por defecto: false
fulfilledQuantitystringopcional

Fulfilled quantity

PatrónValor por defecto: "0"
fulfilledAtdatetimeopcional

Fulfillment timestamp

admite null
provisioningStatusstringopcional

Provisioning status

PENDINGIN_PROGRESSDONEFAILED
Valor por defecto: "PENDING"
positionNumberintegerobligatorio

Position number for sorting

≥ 0
vatRatestringopcional

Item-level VAT rate

Valor por defecto: nulladmite null
shippedQuantitystringopcional

Quantity shipped (synced from shipments)

Valor por defecto: "0"
serialNumbersstring[]opcional

Assigned serial numbers

Valor por defecto: []
taskIdstringopcional

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

PatrónValor por defecto: nulladmite null
ticketIdstringopcional

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

PatrónValor por defecto: nulladmite null
projectIdstringopcional

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

PatrónValor por defecto: nulladmite null
isServiceItembooleanopcional

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

Valor por defecto: nulladmite null
plannedMinutesintegeropcional

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

≥ 0Valor por defecto: nulladmite null
plannedAmountstringopcional

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

PatrónValor por defecto: nulladmite null
availabilityobjectopcional

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

Valor por defecto: nulladmite null
netAmountstringopcional

Total net amount

Patrónadmite null
recurringAmountstringopcional

Recurring portion of total

Patrónadmite null
onetimeAmountstringopcional

One-time portion of total

Patrónadmite null
setupFeesTotalstringopcional

Total setup fees

Patrónadmite null
currencyCodestringopcional

ISO 4217 currency code

PatrónValor por defecto: "EUR"
submittedAtdatetimeopcional

Submission timestamp

admite null
submittedByuuidopcional

User who submitted the order

admite null
approvedAtdatetimeopcional

Approval timestamp

admite null
approvedByuuidopcional

User who approved the order

admite null
rejectedAtdatetimeopcional

Rejection timestamp

admite null
rejectedByuuidopcional

User who rejected the order

admite null
rejectionReasonstringopcional

Reason for rejection

máx. 2000 caracteresadmite null
fulfillmentStartedAtdatetimeopcional

Timestamp the order entered fulfillment (IN_PROGRESS) — ADR 0777

admite null
fulfilledAtdatetimeopcional

Full fulfillment timestamp

admite null
closedAtdatetimeopcional

Timestamp the order was closed (CLOSED / MANUALLY_CLOSED)

admite null
cancelledAtdatetimeopcional

Cancellation timestamp

admite null
cancelledByuuidopcional

User who cancelled the order

admite null
opportunityIdstringopcional

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.

PatrónValor por defecto: nulladmite null
proposalIdstringopcional

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

PatrónValor por defecto: nulladmite null
contractIduuidopcional

Generated contract UUID

admite null
invoiceIdsuuid[]opcional

Generated invoice UUIDs (supports partial/collective invoicing)

Valor por defecto: []
tagsstring[]opcional

Order tags

Valor por defecto: []
deliveryAddressobjectopcional

Delivery address (snapshot)

Valor por defecto: nulladmite null
invoiceAddressobjectopcional

Invoice address (snapshot)

Valor por defecto: nulladmite null
paymentTermIdstringopcional

Reference to payment_terms collection

PatrónValor por defecto: nulladmite null
paymentTermsDaysintegeropcional
≥ 0Valor por defecto: nulladmite null
paymentMethodstringopcional
BANK_TRANSFERSEPA_DIRECT_DEBITCREDIT_CARDCASHPAYPALOTHERnull
Valor por defecto: nulladmite null
headerDiscountstringopcional
PatrónValor por defecto: nulladmite null
shippingMethodstringopcional
máx. 200 caracteresValor por defecto: nulladmite null
shippingCoststringopcional
PatrónValor por defecto: nulladmite null
defaultVatRatestringopcional
Valor por defecto: "19"
vatAmountstringopcional
PatrónValor por defecto: nulladmite null
grossAmountstringopcional
PatrónValor por defecto: nulladmite null
plannedDeliveryDatedateopcional
Valor por defecto: nulladmite null
actualDeliveryDatedateopcional
Valor por defecto: nulladmite null
customerOrderNumberstringopcional

Customer purchase order number

máx. 100 caracteresValor por defecto: nulladmite null
commissionstringopcional

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

máx. 255 caracteresValor por defecto: nulladmite null
orderNumberstringopcional

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

máx. 30 caracteresValor por defecto: nullsolo lecturaadmite null
shipmentMethodNamestringopcional

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}}.

máx. 255 caracteresValor por defecto: nulladmite null
warehouseNamestringopcional

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

máx. 255 caracteresValor por defecto: nulladmite null
externalReferencesobject[]opcional

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

Valor por defecto: []
systemstringobligatorio
máx. 100 caracteres
externalIdstringobligatorio
máx. 200 caracteres
externalVersionstringopcional
admite null
syncedAtdatetimeopcional
admite null
weclappSalesOrderIdstringopcional

Linked weclapp sales order ID

Valor por defecto: nulladmite null
weclappSalesOrderNumberstringopcional

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

máx. 100 caracteresValor por defecto: nulladmite null
weclappOrderUrlstringopcional

URL to the linked weclapp sales order detail page

Valor por defecto: nulladmite null
weclappSalesOrderDataobjectopcional

Cached weclapp sales order data

Valor por defecto: nulladmite null
weclappCustomAttributesobjectopcional

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.

Valor por defecto: nulladmite null

Endpoints estándar

Este recurso sigue el contrato CRUD genérico de la plataforma. Lea las convenciones sobre paginación, idempotencia, bloqueo optimista y auditoría. Los endpoints principales:

  • GET /api/v1/sales_orders — Lista, paginada y filtrable
  • GET /api/v1/sales_orders/<id> — Una entidad
  • POST /api/v1/sales_orders — Crear
  • PATCH /api/v1/sales_orders/<id> — Actualización parcial
  • DELETE /api/v1/sales_orders/<id> — Eliminación lógica
  • GET /api/v1/sales_orders/<id>/timeline — Auditoría y actividades

Búsqueda