Party Schema
Felder
Party Schema
Schema for validating party entities
partyType
Type of party
ORGANIZATIONPERSONname
Party name
displayName
Display name
abbreviation
Unique ALL CAPS abbreviation (e.g. ITF)
isCustomer
Whether party is a customer
isProspect
Whether party is a prospect (Interessent) — potential customer not yet converted
isSupplier
Whether party is a supplier
isApprover
Whether this person may approve customer-portal orders (used by approval-policy supervisor-chain resolution).
createdViaInvitation
True when this PERSON party was created solely as part of a portal-invite flow (not via the Kontakte-Tab). Used by the revoke handler to clean up stub persons whose only purpose was the invitation, when that invitation gets cancelled before acceptance.
approvalLimit
Maximum order net total (EUR) this person may approve. null = unlimited. Only meaningful when isApprover=true.
addresses
_id
Address ID (UUIDv7, auto-generated)
name
Site name (e.g. Niederlassung Berlin)
type
Address type
MAINBRANCHDELIVERYBILLINGDUNNINGOTHERlabel
Custom label (e.g. Standort Berlin)
street
zipCode
city
state
countryCode
Two-letter country code (ISO 3166-1 alpha-2)
latitude
GPS latitude (WGS84)
longitude
GPS longitude (WGS84)
invoiceReference
Free reference/SAP number for this address (e.g. customer's own supplier number). Printed on invoices when showInvoiceReference is true.
showInvoiceReference
Whether invoiceReference is printed on invoices using this address.
language
Communication language for tickets of this site (ADR 0875). null = inherit from customer/tenant.
deennullphone
Central phone number of this site (e.g. the front desk of a branch).
isPartner
Whether party is a partner
parentPartyId
Parent ORGANIZATION party (corporate group hierarchy). Must be null on PERSON parties — see ADR 0098.
partyAddressId
Address ID at the parent organization where this person is located
website
Website URL
emailDomains
Mail domains of an ORGANIZATION (lowercase, without "@"). Exact-match anchor for attaching auto-provisioned portal users to this company (ADR 0808). Freemail domains are rejected by the party hook. Must be empty on PERSON parties.
emailDomainPrimary
When several ORGANIZATIONs share a domain in `emailDomains`, the one carrying this flag wins the domain match (ADR 0808). At most one non-deleted party per tenant and domain may carry it — enforced by the party hook.
businessHours
Customer business/opening hours (Geschäftszeiten)
weeklySchedule
Opening hours per weekday. Keys: mon,tue,wed,thu,fri,sat,sun. Values: array of {start,end} time slots in HH:MM format. Same shape as business_hours_profile.weeklySchedule.
note
Free-text note (e.g. "Mittagspause 12–13 Uhr", "Notdienst 24/7")
taxId
Steuernummer (locally issued by Finanzamt, e.g. "12/345/67890"). 10–15 digits, optional slashes; whitespace must be stripped client-side. For the EU VAT ID use vatId instead.
vatId
USt-IdNr. / EU VAT identification number (ISO 3166-1 alpha-2 country code + identifier, e.g. "DE123456789"). Must be normalized (uppercase, no whitespace/dots/dashes) before persisting; landesspezifische Format-Validität wird über @codemeta/shared `isValidVatId` zusätzlich am Client geprüft.
notes
Free-text notes
firstName
First name (for PERSON type)
lastName
Last name (for PERSON type)
salutation
Salutation (for PERSON type)
HerrFrauDiversacademicTitle
Academic/honorary title, e.g. "Dr." or "Prof. Dr." (for PERSON type)
jobTitle
Job title (for PERSON type)
preferredLanguage
Preferred communication language (ISO 639-1). PERSON: language of the contact. ORGANIZATION: customer-wide default for ticket communication (ADR 0875).
aaabaeafakamanarasavayazbabebgbhbibmbnbobrbscacechcocrcscucvcydadedvdzeeeleneoeseteufafffifjfofrfygagdglgngugvhahehihohrhthuhyhziaidieigiiikioisitiujajvkakgkikjkkklkmknkokrkskukvkwkylalblglilnloltlulvmgmhmimkmlmnmrmsmtmynanbndnengnlnnnonrnvnyocojomorospapiplpsptqurmrnrorurwsascsdsesgsiskslsmsnsosqsrssstsusvswtatetgthtitktltntotrtstttwtyugukuruzvevivowawoxhyiyozazhzunulladditionalLanguages
Additional communication languages (ISO 639-1, for PERSON type)
postResolutionContactPreference
How this party wants to be reached after a ticket is resolved (CALL | MESSAGE | NONE; null = not specified). Set on a PERSON for that contact, or on an ORGANIZATION as the default for its contacts; a PERSON value overrides the company default.
CALLMESSAGENONEnullcustomerNumber
Customer number
datevDebitorenkonto
Stable DATEV-Debitorenkontonummer (assigned on first DATEV export, persisted for subsequent exports)
datevKreditorenkonto
Stable DATEV-Kreditorenkontonummer (assigned when this party is referenced from a vendor invoice)
supplierNumber
Supplier number (Lieferantennummer)
responsibleUserId
Account manager / responsible user (synced with weclapp)
hasOwnResponsibleUser
PERSON only: true = AM is curated on the person directly; false = AM is derived from the linked organizations via party_relationships. ORGANIZATION: ignored. Documents lacking this field are treated at read time as (responsibleUserId != null), preserving pre-existing data on live tenants.
inheritedResponsibleUserIds
PERSON + hasOwnResponsibleUser=false only: distinct account managers of all linked organizations (driven by recomputePersonResponsibleUser). Server-managed — not writable via the API. Empty array otherwise.
teamId
Primary technical team (org unit). Automatically mirrored into assignedOrgUnitIds so the team gains access; secondary teams may be added directly via the team management page (ADR 0124, revised).
assignedOrgUnitIds
All org units (teams) that have access to this party. Drives the team_member data-scope and the SpiceDB assigned_org_unit relation. Contains teamId plus any extra teams granted access via the team management page.
hasOwnTeam
PERSON only: true = primary technical team (teamId) is curated on the person directly; false = teamId is derived from the linked organizations via party_relationships (ADR 0318, mirrors hasOwnResponsibleUser). ORGANIZATION: ignored. Documents lacking this field are treated at read time as (teamId != null), preserving pre-existing data on live tenants (no backfill required).
inheritedTeamIds
PERSON + hasOwnTeam=false only: distinct primary technical teams of all linked organizations (driven by recomputePersonTeam). Server-managed — not writable via the API. Empty array otherwise.
classification
Customer classification (A = highest priority)
ABCDtags
Party tags
isSelfCompany
Whether this party represents the tenant own company
isInternalCompany
Whether work booked on this party counts as INTERNAL in reports (ADR 1013). Unlike isSelfCompany this flag may be set on MANY parties of a tenant: a Systemhaus whose branches are each kept as their own party record ticks it on all of them. isSelfCompany stays single-valued — it identifies THE legal entity and nine read sites in API and worker resolve it with findOne({ isSelfCompany: true }) for the letterhead, the travel start point, availability, company sites, the mail sender and onboarding; a second match would hand them an arbitrary branch. isSelfCompany: true already implies internal, so readers build { $or: [{ isSelfCompany: true }, { isInternalCompany: true }] } and nobody has to tick both.
travelConfig
Travel/distance configuration for this party
distances
ownLocationId
ID of own company location address
ownLocationLabel
Display label of the own location
customerAddressId
Target party address this distance refers to. Null = legacy entry, resolved against the main customer address.
distanceKm
Distance in kilometers
durationMinutes
Travel duration in minutes
travelAllowanceId
Default travel allowance for this route
calculatedAt
When the distance was last calculated
calculationSource
How the distance was determined
MANUALOPENROUTESERVICEdefaultBillingMode
Default billing mode for travel to this party
DISTANCE_BASEDFLAT_RATEnotes
Travel configuration notes
dunningBlocked
Block all dunning for this customer (Mahnsperre)
inactive
Party is retired: kept for historical references but no longer offered in any selector. Absence of the field means active — read filters must use { $ne: true }, never { inactive: false }.
inactiveReason
Why the party was set inactive (e.g. "Kunde abgewandert 03/2026").
inactiveAt
When the party was set inactive. Server-filled by the party beforeUpdate hook, which overwrites any client value.
inactiveBy
Internal users._id that set the party inactive. Server-filled by the party beforeUpdate hook, which overwrites any client value.
mergedIntoPartyId
The company this party was merged into. Set on the first confirmed merge run and kept through delete/retire so old links can be forwarded.
mergedAt
When the merge into mergedIntoPartyId was started.
mergedBy
Internal users._id that started the merge.
mergedIntoAddressId
Site (addresses[]._id of mergedIntoPartyId) the merged documents were pointed at; null when the merge targeted the company as a whole. Written with mergedIntoPartyId so later batches of the same merge cannot switch sites.
billingBlock
Billing block (Abrechnungssperre) — when active, invoices and Leistungsnachweise cannot be created for this party
active
reason
blockedAt
blockedBy
blockedUntil
serviceBlock
Service block (Leistungssperre) — when active, tickets/time-records/calendar-events for this party trigger warnings; time-records require approval
active
reason
blockedAt
blockedBy
blockedUntil
weclappBlock
Read-only mirror of the weclapp customer block (customerBlocked / customerInsolvent + customerBlockNotice). weclapp-master — set by the weclapp party sync, never edited in Codemeta and never pushed back. When blocked, it triggers both the billing- and service-block warnings (party-block helpers), mirroring the TANSS lockout behaviour.
logoFileId
File ID of the party logo (from file storage)
serviceTypeOverrides
Per-customer overrides for service type billing parameters
serviceTypeId
Service type to override pricing for
roundingMinutes
Override rounding increment for this customer
inclusiveMinutes
Override inclusive minutes for this customer
pricingDateBasis
ADR 0415 — per-customer override of the pricing date basis for this service type: SERVICE_DATE = price at the day the work was performed, BILLING_DATE = price at the day of the billing run. Null falls back to service_type.billing.pricingDateBasis (then SERVICE_DATE).
SERVICE_DATEBILLING_DATEnullpricing
Customer-specific price schedule — absolute rate or discount, dated (overrides service type defaults)
validFrom
Price effective from this date
ratePerHour
Customer-specific hourly rate. Absolute price — takes precedence over discountPercent when both are set.
discountPercent
Customer discount in percent off the rate that would otherwise apply (article price or service-type mask price). Alternative to ratePerHour (ADR 0411).
flatRateAmount
Customer-specific flat rate amount
travelBilling
ADR 0480 — customer-wide travel conditions. Third step of the €/km precedence (contract → customer → tenant default → fallback); applies to customers with negotiated rates but no maintenance contract. Same fields as contract.conditions.travelAllowance, deliberately named differently to keep it apart from party.travelConfig (the ADR 0033b distance matrix).
ratePerKm
Customer-wide mileage rate in EUR per km
flatRate
Customer-wide flat travel fee per assignment
vehicleBaseFee
Customer-wide vehicle base fee per assignment
performanceRecordSettings
ADR 0909 — per-customer presentation of the Leistungsnachweis. Resolved via resolveGroupPositionsByTicket() at generation time and snapshotted on the performance record.
groupPositionsByTicket
Overrides billingSettings.groupPositionsByTicket for this customer. null/missing = tenant default.
emergencyServiceBilling
ADR 0914 — overrides billingSettings.emergencyServiceBilling for this customer. null/missing = tenant default.
COMBINEDSEPARATEnullnotices
Persistente Hinweise zur Firma, die kontextabhängig in Tickets, Leistungserfassung oder anderen Workflows als Banner angezeigt werden. Pendant zu TANSS-supportInfos: dort wurden sie beim Auswählen des Kunden als Popup gezeigt; in Codemeta surface wir sie an den Touchpoints, an denen mit dem Kunden gearbeitet wird.
_id
Notice ID (UUIDv7, auto-generated server-side wenn fehlend)
name
Optionale Überschrift des Hinweises (z. B. "Wartung", "Patch Management"). Quelle u. a. die TANSS-„wichtigen Firmeninformationen", wo jeder Eintrag benannt ist. Optional und ohne Default — Alt-Notices haben keinen Namen und werden weiterhin nur als Text gerendert.
text
Hinweistext (Plaintext, mehrzeilig erlaubt)
severity
Visuelle Wichtigkeit. CRITICAL = rotes Banner (entspricht TANSS popup=true), WARNING = gelb, INFO = neutral.
INFOWARNINGCRITICALshowOnTicket
Banner auf der Ticket-Detail-Seite anzeigen, wenn das Ticket auf diese Firma referenziert (partyId).
showOnTimeRecord
Banner im Time-Record-/Leistungserfassungs-Dialog anzeigen, wenn die Leistung auf diese Firma gebucht wird.
source
Herkunft des Hinweises (z. B. "TANSS-Import", "TANSS (Headquarter)", "Manuell"). Informativ für den Bearbeiter.
validFrom
Optionaler Beginn des Gültigkeitszeitraums (YYYY-MM-DD, inklusiv). Vor diesem Datum wird der Hinweis an den Touchpoints (Ticket, Leistungserfassung, Detailseiten-Banner) nicht angezeigt. Fehlend/null = ab sofort gültig. Anwendungsfall: zeitgebundene Hinweise wie Betriebsferien.
validUntil
Optionales Ende des Gültigkeitszeitraums (YYYY-MM-DD, inklusiv). Nach diesem Datum läuft der Hinweis automatisch aus, ohne dass ihn jemand manuell entfernen muss. Fehlend/null = unbegrenzt gültig.
createdAt
Anlagezeitpunkt (informativ).
externalReferences
Cross-system linking refs (e.g. weclapp). The weclapp entry is the canonical identity anchor for the bidirectional party sync (ADR 0147). Read/written by the inbound + outbound sync workers and indexed for duplicate prevention.
system
externalId
externalVersion
externalNumber
syncedAt
lastSyncCorrelationId
lastInboundHash
lastOutboundHash
syncWithWeclapp
Opt-in flag for the bidirectional weclapp party sync (ADR 0147). Only consulted when the tenant runs partySync.scope.mode = "opt-in"; ignored in "all"/"filtered"/"off".
shopConfig
Customer-portal shop configuration for this organization. Master switches that gate per-role permissions defined in shop_roles.
enabled
Whether the customer portal shop is enabled for this customer at all. Disabled = portal users belonging to this party see no shop UI.
globalPermissions
Fallback permissions granted to portal users of this organization who have no shop role assigned. Use sparingly — prefer explicit roles.
featureFlags
Org-level feature flags. A role may grant a permission, but the flag must also allow it. Use to disable a feature globally for one customer regardless of roles.
onboardingDismissedAt
Set when the admin explicitly hides the Shop-Tab onboarding checklist. Null = checklist still relevant. ISO timestamp = dismissed (auto-hidden).
crm
Aggregated CRM relationship metrics (satisfaction, NPS, etc.)
csat
Rolling 90-day CSAT aggregate (normalized 0-100)
avg
Weighted average CSAT over the last 90 days (0-100)
trend
Trend of last 30 days vs previous 60 days
upstabledownnullsampleSize
Number of responses included in the rolling window
lastUpdated
When this aggregate was last recalculated
lastScore
Most recent raw CSAT score
nps
Rolling 90-day NPS aggregate (-100 to 100)
score
Net Promoter Score over the last 90 days
trend
upstabledownnullsampleSize
lastUpdated
lastScore
inboundReplyAckedAt
Timestamp at which the latest inbound customer email linked to this party was acknowledged as "handled, no reply needed". Clears the account-level awaiting-reply badge in the CRM list when >= the last inbound email time; a newer inbound email re-arms it. Mirrors opportunity.inboundReplyAckedAt.
inboundReplyAckedBy
User who acknowledged the latest inbound customer email (see inboundReplyAckedAt).
Keine Felder passen zum Filter.
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/parties— Liste, paginiert + filterbarGET /api/v1/parties/<id>— Einzelne EntityPOST /api/v1/parties— AnlegenPATCH /api/v1/parties/<id>— Teil-UpdateDELETE /api/v1/parties/<id>— Soft-DeleteGET /api/v1/parties/<id>/timeline— Audit + Aktivitäten