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

Contract Schema

Schema-ID
contract
Collection
contracts
Permissions
  • Lesencontract_view
  • Anlegencontract_create
  • Änderncontract_edit
  • Löschencontract_delete

Felder

Contract Schema

contracts4 Permissions

Schema for validating contract entities

namestringerforderlich

Contract name

1–200 Zeichen
descriptionstringoptional

Contract description

nullable
descriptionHtmlstringoptional

Rich text HTML version of the contract description

nullable
contractTypeIduuidoptional

Contract type UUID

nullable
contractCategorystringerforderlich

Contract category — MAINTENANCE covers all service contracts (positions, asset assignments, contingents, SLA, compliance, coverage); LICENSE is the separate license-billing flow (positions grid + Weclapp invoice import).

MAINTENANCELICENSE
partyIduuiderforderlich

Associated party UUID

contactPartyIduuidoptional

Associated contact person UUID

nullable
parentContractIduuidoptional

Parent contract UUID for sub-contracts

nullable
statusstringerforderlich

Contract status (ADR 0198 R7): DRAFT → PENDING_APPROVAL → ACTIVE → EXPIRING → CANCELLED (+ TEMPLATE). SUSPENDED/RENEWED/EXPIRED removed — pausing gone, renewal is in-place, lapse at endDate ends in CANCELLED.

DRAFTPENDING_APPROVALACTIVEEXPIRINGCANCELLEDTEMPLATE
startDatedateerforderlich

Contract start date (YYYY-MM-DD)

endDatedateoptional

Contract end date (YYYY-MM-DD)

nullable
cancellationDeadlinedateoptional

Earliest cancellation deadline across the contract + positions (R5).

read-onlynullable
nextNotificationDatedateoptional

Earliest expiry reminder date across the contract + positions (R5).

read-onlynullable
nextRenewalDatedateoptional

Earliest auto-renewal boundary across the contract + positions (R5).

read-onlynullable
cancellationDeadlineSourcestringoptional
read-onlynullable
nextNotificationSourcestringoptional
read-onlynullable
nextRenewalSourcestringoptional
read-onlynullable
contractDatedatetimeoptional

Contract signing date (from legacy Toast import)

nullable
activatedAtdatetimeoptional

Activation timestamp

nullable
cancelledAtdatetimeoptional

Cancellation timestamp

nullable
expiredAtdatetimeoptional

Expiration timestamp

nullable
cancellationobjectoptional
nullable
noticePeriodDaysnumbererforderlich
≥ 0
extensionDaysnumberoptional

Auto-renewal extension length in days (day-precise, replaces extensionMonths)

≥ 0
extensionMonthsnumberoptional

deprecated — migrated to extensionDays; kept for backward compatibility

≥ 0
autoRenewbooleanerforderlich
nextPossibleDatedateoptional
nullable
cancellationRequestedAtdatetimeoptional
nullable
cancellationRequestedByuuidoptional
nullable
cancellationReasonstringoptional
nullable
cancellationEffectiveDatedateoptional
nullable
softframestringoptional

Reference frame for cancellation period (weclapp: cancellationPeriodSoftframe)

CONTRACT_ENDEND_OF_MONTHEND_OF_QUARTEREND_OF_CALENDAR_YEAREND_OF_CONTRACT_YEARnull
Default: nullnullable
notificationobjectoptional
nullable
enabledbooleanoptional
nullable
channelsstring[]optional
nullable
recipientsobject[]optional
nullable
typestringerforderlich
USERTEAMEMAIL
valuestringerforderlich
targetsobjectoptional
nullable
inAppobjectoptional
nullable
recipientsobject[]optional
nullable
typestringerforderlich
USERTEAMEMAIL
valuestringerforderlich
prioritystringoptional
LOWNORMALHIGHCRITICALnull
nullable
contactPartyIdstringoptional
nullable
emailobjectoptional
nullable
recipientsobject[]optional
nullable
typestringerforderlich
USERTEAMEMAIL
valuestringerforderlich
prioritystringoptional
LOWNORMALHIGHCRITICALnull
nullable
contactPartyIdstringoptional
nullable
taskobjectoptional
nullable
recipientsobject[]optional
nullable
typestringerforderlich
USERTEAMEMAIL
valuestringerforderlich
prioritystringoptional
LOWNORMALHIGHCRITICALnull
nullable
contactPartyIdstringoptional
nullable
opportunityobjectoptional
nullable
recipientsobject[]optional
nullable
typestringerforderlich
USERTEAMEMAIL
valuestringerforderlich
prioritystringoptional
LOWNORMALHIGHCRITICALnull
nullable
contactPartyIdstringoptional
nullable
leadQuantitynumberoptional
≥ 0nullable
leadUnitstringoptional
DAYWEEKMONTHYEARnull
nullable
lastNotifiedAtdatetimeoptional
nullable
monthlyRevenuestringoptional

Monthly revenue as decimal string

Patternnullable
currencyCodestringerforderlich

Three-letter currency code (ISO 4217)

Pattern
billingCyclestringoptional

Billing cycle

MONTHLYQUARTERLYSEMI_ANNUALYEARLYONE_TIMENONE
nullable
paymentTermsDaysnumberoptional

Payment terms in days

≥ 0nullable
priceEscalationobjectoptional
nullable
typestringerforderlich
FIXED_PERCENTCPI_INDEXMANUAL
percentPerYearstringoptional
Patternnullable
effectiveMonthnumberoptional
1 – 12nullable
lastAppliedAtdatetimeoptional
nullable
serviceTargetProfileIduuidoptional

Service target profile UUID (ADR 0117a — replaces slaProfileId)

nullable
inlineTargetsanyoptional
defaultCoverageanyoptional
scopeobjectoptional
nullable
coverageTypestringerforderlich

Legacy coverage type — kept for backwards-compat. New code reads `coverageMode` (see below).

ALL_ASSETSASSIGNED_ONLYCUSTOM
coverageModestringoptional

Defines what counts as a contract-covered service. ALL_WITH_EXCLUSIONS: all services except the excluded* lists. ONLY_SPECIFIC: only the included* lists. ONLY_EXPLICIT_ASSIGNMENTS: only matches via explicit assignments[]. Falls back to coverageType mapping when unset.

ALL_WITH_EXCLUSIONSONLY_SPECIFICONLY_EXPLICIT_ASSIGNMENTS
nullable
excludedServiceTypeIdsuuid[]optional
Default: []
excludedLocationIdsuuid[]optional
Default: []
excludedTechnicianIdsuuid[]optional
Default: []
includedServiceTypeIdsuuid[]optional
Default: []
includedLocationIdsuuid[]optional
Default: []
includedTechnicianIdsuuid[]optional
Default: []
serviceTypeIdsuuid[]optional
Default: []
technicianUserIdsuuid[]optional
Default: []
technicianOrgUnitIdsuuid[]optional
Default: []
locationIdsuuid[]optional
Default: []
excludeAfterHoursbooleanoptional
excludeTravelbooleanoptional
assignedToIduuidoptional

Assigned user UUID

nullable
orgUnitIduuidoptional

Associated org unit UUID

nullable
amendmentOfuuidoptional

Original contract UUID this amends

nullable
amendmentNumbernumberoptional

Amendment sequence number

≥ 0nullable
templateIduuidoptional

Template contract UUID this was created from

nullable
assignmentsobject[]optional

Contract assignments (assets, parties, locations, service types)

Default: []
iduuiderforderlich
assignmentTypestringerforderlich

Subject of the assignment. ASSET = concrete asset; ASSET_TYPE = curated asset-type bucket (see `assetTypeKey`); PARTY = concrete customer employee; ALL_ASSETS = default coverage for any asset under the contract; ALL_PARTIES = default coverage for any customer employee; LOCATION = matches when `asset.locationId === assignment.locationId` (ADR 0151 Phase B). SERVICE_TYPE is legacy.

ASSETASSET_TYPEPARTYALL_ASSETSALL_PARTIESLOCATIONSERVICE_TYPE
assetIduuidoptional
nullable
assetTypeKeystringoptional

Curated asset-type bucket key for `assignmentType: ASSET_TYPE`. Each key maps to a set of asset.schema discriminator patterns (see `asset-type-keys.ts`).

PCSERVERNETWORKPERIPHERALMOBILELICENSEAPPLICATION
nullable
partyIduuidoptional
nullable
locationDescriptionstringoptional
nullable
locationIduuidoptional

Reference to a Location entity. Required when `assignmentType === "LOCATION"` (ADR 0151 Phase B); the resolver matches assets whose `asset.locationId` equals this value at Specificity 2.5 (between ASSET_TYPE and SERVICE_TYPE).

nullable
serviceTypeIduuidoptional
nullable
itemIduuidoptional

Optional link to a contract.items[].id — when set, billing is driven by the position and the assignment-level monthlyPrice/discountPercent are ignored by the UI.

nullable
monthlyPricestringoptional
Patternnullable
discountPercentstringoptional
Patternnullable
stockingCoststringoptional
Patternnullable
targetsOverrideanyoptional
coverageanyoptional
responseTimeMinutesnumberoptional

Convenience field: when set, the save-helper synthesises a `targetsOverride.stages[]` entry with `kind=time_to_first_response` and this duration. Read back from the same stage.

≥ 0nullable
resolutionTimeMinutesnumberoptional

Convenience field: when set, the save-helper synthesises a `targetsOverride.stages[]` entry with `kind=time_to_close` and this duration. Read back from the same stage.

≥ 0nullable
validFromdateoptional
nullable
validUntildateoptional
nullable
isActivebooleanerforderlich
sortOrdernumbererforderlich
notesstringoptional
nullable
contingentsobject[]optional

Contract contingents (prepaid hours, monetary budgets, trips)

Default: []
iduuiderforderlich
contingentTypestringerforderlich
HOURSMONETARYTRIPS
labelstringerforderlich
totalAmountstringerforderlich
Pattern
usedAmountstringerforderlich
Pattern
unitstringerforderlich
HOURSMINUTESEURTRIPS
periodTypestringerforderlich
MONTHLYQUARTERLYYEARLYONE_TIMEUNLIMITED
periodStartdateerforderlich
periodEnddateoptional
nullable
carryOverobjecterforderlich
typestringerforderlich
NONEFULLCAPPEDPERCENT
maxCarryOverstringoptional
Patternnullable
maxCarryOverPercentnumberoptional
nullable
expiresAfterPeriodsnumberoptional
nullable
overagePolicystringerforderlich
BLOCKALLOWALLOW_WITH_SURCHARGENOTIFY
overageSurchargePercentstringoptional
Patternnullable
overageCapAmountstringoptional
Patternnullable
autoRefillobjectoptional
nullable
enabledbooleanoptional
schedulestringoptional
PERIOD_STARTMANUALTHRESHOLD
thresholdPercentnumberoptional
nullable
refillAmountstringoptional
Pattern
conversionRatestringoptional
Patternnullable
fallbackContractIduuidoptional
nullable
fallbackPrioritynumberoptional
1 – 9nullable
isActivebooleanerforderlich
exhaustedAtdatetimeoptional
nullable
itemsobject[]optional

Contract line items (incl. GROUP divider rows for positional grouping)

Default: []
iduuiderforderlich
itemTypestringerforderlich
RECURRINGONE_TIMESURCHARGEDISCOUNTNOTEGROUP
namestringerforderlich
max 200 Zeichen
descriptionstringoptional
nullable
quantitynumbererforderlich
≥ 0
minQuantitynumberoptional

Lower clamp for a datasource-resolved quantity (ADR 0357). Ignored for static quantities.

Default: nullnullable
maxQuantitynumberoptional

Upper clamp for a datasource-resolved quantity (ADR 0357).

Default: nullnullable
unitPricestringerforderlich
Pattern
discountPercentstringoptional
Patternnullable
intervalstringerforderlich
MONTHLYQUARTERLYSEMI_ANNUALYEARLYONE_TIMENONEDAILYWEEKLYTWO_YEARLYTHREE_YEARLY
validFromdateoptional
nullable
validUntildateoptional
nullable
isActivebooleanerforderlich
sortOrdernumbererforderlich
assetIduuidoptional
nullable
serviceTypeIduuidoptional
nullable
nextBillingDatedateoptional

Next billing date for this specific item

Default: nullnullable
previousBillingDatedateoptional

Last time this item was billed

Default: nullnullable
billingGroupIdstringoptional

Group ID for splitting items across multiple invoices

Default: nullnullable
articleIduuidoptional

Optional link to a Codemeta catalog article

nullable
articleNumberstringoptional
nullable
isBillOfMaterialbooleanoptional

When true, this item is a sales bill of material with sub-items

nullable
useSubItemPricesbooleanoptional

BOM pricing: when true, unitPrice mirrors the sum of subItems; else own price

nullable
subItemsany[]optional
nullable
quantitySourceobjectoptional

Dynamic quantity source — resolved at billing time

Default: nullnullable
conditionsobjectoptional

Contract-level overrides for billing conditions. Each block is optional; unset fields fall back to service-type / tenant defaults (punctual override strategy).

nullable
surchargeStackingModestringoptional

How surcharges combine when several apply to the same minute (ADR 0431). ADDITIVE (default) sums them (1 + Σ pct/100) — the long-standing behaviour; MAX lets the single highest surcharge win (collective-agreement practice). Unset = fall back to service_type.billing.surchargeStackingMode, then ADDITIVE.

ADDITIVEMAX
nullable
serviceRatesobject[]optional

Per-service-type rate schedule (overrides service-type.billing.pricing). Multiple entries per serviceTypeId are allowed: each may carry a validFrom date; an entry without validFrom is the baseline. For a given booking date the effective entry is the one with the latest validFrom <= date. To change a rate, ADD a new entry (do not overwrite an existing one) so historical bookings keep their old rate.

Default: []
iduuidoptional
nullable
serviceTypeIduuiderforderlich
validFromdateoptional
nullable
ratePerHourstringoptional
Patternnullable
ratePerKmstringoptional
Patternnullable
travelAllowanceobjectoptional

Arrival/departure travel costs: per-km rate, flat per-trip fee, vehicle base fee.

nullable
ratePerKmstringoptional
Patternnullable
flatRatestringoptional
Patternnullable
vehicleBaseFeestringoptional
Patternnullable
overtimeSurchargesobject[]optional

Overtime / evening / weekend / holiday surcharges applied multiplicatively to the service rate when the time-of-day + day-of-week (+ optional service-type / holiday) match.

Default: []
iduuiderforderlich
namestringerforderlich
1–100 Zeichen
fromTimestringerforderlich
Pattern
toTimestringerforderlich
Pattern
daysOfWeeknumber[]erforderlich
unique items
surchargePercentstringerforderlich
Pattern
serviceTypeIdsuuid[]optional

Service types this surcharge applies to. Empty/omitted = all service types (ADR 0163).

unique itemsDefault: []
holidayModestringoptional

Public-holiday behaviour (ADR 0163). IGNORE/unset = match weekday windows only (never on a holiday); ALSO_ON_HOLIDAYS = weekday windows OR any holiday; ONLY_ON_HOLIDAYS = only on holidays (daysOfWeek ignored). Region resolved per technician via holiday-resolver.

IGNOREALSO_ON_HOLIDAYSONLY_ON_HOLIDAYS
nullable
validFromdateoptional
nullable
validUntildateoptional
nullable
serviceRoundingobject[]optional

Per-service-type rounding overrides. Unset fields fall back to service-type.billing.{roundingMinutes,roundingMode,minimumMinutes,billingUnitMinutes}.

Default: []
serviceTypeIduuiderforderlich
roundingMinutesnumberoptional
≥ 0nullable
roundingModestringoptional
UPDOWNNEAREST
nullable
minimumMinutesnumberoptional
≥ 0nullable
billingUnitMinutesnumberoptional
≥ 0nullable
remarksobject[]optional

Structured free-text remarks list for capturing miscellaneous contract data (per ADR 0149).

Default: []
iduuiderforderlich
textstringerforderlich
min 1 Zeichen
textHtmlstringoptional

Optional Tiptap-rendered HTML with mention spans (`<span data-mention-id data-mention-type>...</span>`). Falls back to `text` when not set.

nullable
mentionsobject[]optional

Structured sidecar: every @-user or #-ticket mention extracted from `textHtml` at save time. Server-side resolvers can pick this up without parsing HTML.

Default: []nullable
iduuiderforderlich
typestringerforderlich
userticketasset
labelstringerforderlich
createdAtdatetimeerforderlich
read-only
createdByuuiderforderlich
read-only
updatedAtdatetimeoptional
read-onlynullable
notesstringoptional

External notes

nullable
internalNotesstringoptional

Internal notes (not visible to customer)

nullable
tagsstring[]optional

Contract tags

Default: []
customFieldsobjectoptional

Custom fields (tenant-specific)

nullable
linkedRiskIdsstring[]optional

Linked risk IDs

Default: []
licensePositionsobject[]optional

License contract positions (for LICENSE category)

Default: []
uuidstringerforderlich
typestringerforderlich
STATICDYNAMIC
articleIdstringerforderlich
articleNumberstringerforderlich
titlestringerforderlich
descriptionstringoptional
nullable
companyNamestringoptional
nullable
quantityoneOferforderlich
unitPricenumbererforderlich
unchangedUnitPricenumberoptional
nullable
manualUnitPricenumberoptional

Manually overridden own unit price (may be negative, e.g. discount positions). Replaces the weclapp article price as billing basis; unchangedUnitPrice keeps the fetched article price as revert target.

nullable
discountPercentagenumbererforderlich
pricingDatedatetimeoptional
nullable
startDatedateoptional
nullable
endDatedateoptional
nullable
periodstringoptional

ISO-8601 billing period for this position (P1Y = yearly, P1M = monthly)

P1YP1Mnull
nullable
factornumberoptional
nullable
roundingstringoptional
EXACTCEILROUND
nullable
articleTypestringoptional
BASICSALES_BILL_OF_MATERIALSTORABLE
nullable
groupNamestringoptional
nullable
useSalesBillOfMaterialItemPricesbooleanoptional
nullable
salesBillOfMaterialItemsobject[]optional
Default: []
uuidstringoptional
typestringoptional
STATICDYNAMIC
articleIdstringoptional
articleNumberstringoptional
titlestringoptional
descriptionstringoptional
nullable
quantityoneOfoptional
unitPricenumberoptional
unchangedUnitPricenumberoptional
nullable
discountPercentagenumberoptional
nullable
pricingDatedatetimeoptional
nullable
articleFactornumberoptional
nullable
roundingstringoptional
EXACTCEILROUND
nullable
factornumberoptional
nullable
cancellationPeriodQuantitynumberoptional
nullable
cancellationPeriodUnitstringoptional
nullable
extensionQuantitynumberoptional
nullable
extensionUnitstringoptional
nullable
cancellationNotificationbooleanoptional
nullable
cancellationNotificationQuantitynumberoptional
nullable
cancellationNotificationUnitstringoptional
nullable
lastCancellationNotificationDatedatetimeoptional
nullable
notificationChannelsstring[]optional
nullable
notificationRecipientsobject[]optional
nullable
typestringerforderlich
USERTEAMEMAIL
valuestringerforderlich
notificationTargetsobjectoptional
nullable
inAppobjectoptional
nullable
recipientsobject[]optional
nullable
typestringerforderlich
USERTEAMEMAIL
valuestringerforderlich
prioritystringoptional
LOWNORMALHIGHCRITICALnull
nullable
contactPartyIdstringoptional
nullable
emailobjectoptional
nullable
recipientsobject[]optional
nullable
typestringerforderlich
USERTEAMEMAIL
valuestringerforderlich
prioritystringoptional
LOWNORMALHIGHCRITICALnull
nullable
contactPartyIdstringoptional
nullable
taskobjectoptional
nullable
recipientsobject[]optional
nullable
typestringerforderlich
USERTEAMEMAIL
valuestringerforderlich
prioritystringoptional
LOWNORMALHIGHCRITICALnull
nullable
contactPartyIdstringoptional
nullable
opportunityobjectoptional
nullable
recipientsobject[]optional
nullable
typestringerforderlich
USERTEAMEMAIL
valuestringerforderlich
prioritystringoptional
LOWNORMALHIGHCRITICALnull
nullable
contactPartyIdstringoptional
nullable
groupNamesobject[]optional

Group names for license contract positions

Default: []
uuidstringerforderlich
titlestringerforderlich
lastInvoicedAtdatetimeoptional

Timestamp of last billing/invoice creation

nullable
billingConfigobjectoptional

Automatic billing configuration

Default: nullnullable
nextBillingDatedateoptional

Next billing date (calculated from lastInvoicedAt + billingCycle)

Default: nullnullable
billingFrequencystringoptional

Billing frequency for license contracts

monatlichjährlichno_billing
nullable
weclappCustomerIdstringoptional

weclapp ERP customer ID

nullable
productsobject[]optional

Product logos for display

Default: []
namestringerforderlich
imagestringoptional
nullable
initialsstringerforderlich
linkedDocumentsobject[]optional

Linked documents (tickets, etc.)

Default: []
typestringerforderlich
idoneOferforderlich
titlestringerforderlich
descriptionstringoptional
nullable
linkedEntitiesobject[]optional

Linked entities (assets, tickets, etc.)

Default: []nullable
entityTypestringerforderlich
partyassetticketcontractprojectuseropportunity
entityIduuiderforderlich
rolestringerforderlich
ticketRulesobject[]optional

Activated ticket-generation rules (ADR 0439). Each entry binds a tenant-wide contract_ticket_rule to this contract, usually to one position, with its own due-date cursor.

Default: []
iduuiderforderlich

Activation UUID (stable key, used in generated tickets’ sourceRef).

ruleIduuiderforderlich

The contract_ticket_rule this activation executes.

positionIdstringoptional

items[].id or licensePositions[].uuid this activation is bound to; null = manual activation without a position.

Default: nullnullable
positionSourcestringoptional

Which position array positionId refers to — the two stay separate models (ADR 0357). null when positionId is null.

ITEMLICENSEnull
Default: nullnullable
startDatedateerforderlich

First due date, chosen at activation. The UI prevents past dates; the server tolerates them (sweep creates exactly one ticket, then continues from the next future occurrence).

nextDueDatedateerforderlich

Cursor: next due date (initially = startDate). Advanced by the sweep.

nextCreateDatedateerforderlich

Derived scan key: nextDueDate minus the rule’s leadDays. The sweep creates the ticket when nextCreateDate <= today.

lastTicketDatedateoptional

Due date of the most recently generated ticket.

Default: nullnullable
lastTicketIdstringoptional

Id of the most recently generated ticket.

PatternDefault: nullnullable
isActivebooleanerforderlich

Paused activations are skipped by the sweep but stay documented on the contract.

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

Suche