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

Opportunity Schema

ID du schéma
opportunity
Collection
opportunities
Autorisations
  • Lireopportunity_view
  • Créeropportunity_create
  • Modifieropportunity_edit
  • Supprimeropportunity_delete

Champs

Opportunity Schema

opportunities4 autorisations

Schema for validating sales opportunity entities

titlestringobligatoire

Opportunity title

1–300 caractères
descriptionstringfacultatif

Detailed description (plain text)

max. 5000 caractèresnullable
descriptionHtmlstringfacultatif

Rich text HTML version of the opportunity description

nullable
statusstringobligatoire

Pipeline status (tenant-configurable)

prioritystringfacultatif

Opportunity priority level

LOWNORMALHIGHCRITICAL
Par défaut : "NORMAL"
pipelineIduuidfacultatif

Sales pipeline UUID (references sales_pipelines collection)

nullable
partyIduuidfacultatif

Customer party UUID

nullable
partyAddressIduuidfacultatif

Specific site/address of the associated party

Par défaut : nullnullable
contactPartyIduuidfacultatif

Contact person UUID

nullable
assignedToIduuidfacultatif

Assigned sales rep user UUID

nullable
orgUnitIduuidfacultatif

Organization unit UUID

nullable
valuestringfacultatif

Deal value / CLV (Decimal128 as string, synced with customerLifetimeValue)

Motifnullable
onetimeRevenuestringfacultatif

One-time revenue (hardware, projects, migrations)

Motifnullable
monthlyRecurringstringfacultatif

Monthly recurring revenue (MRR)

Motifnullable
contractDurationMonthsnumberfacultatif

Minimum contract duration in months

1 – 120nullable
estimatedLifetimeMonthsnumberfacultatif

Estimated customer lifetime in months (manual override; auto-calculated from party churn data or tenant default if null)

1 – 600nullable
annualRecurringRevenuestringfacultatif

ARR = MRR × 12

Motifnullable
totalContractValuestringfacultatif

TCV = onetime + (MRR × contractDurationMonths)

Motifnullable
customerLifetimeValuestringfacultatif

CLV = onetime + (MRR × estimatedLifetimeMonths)

Motifnullable
weightedValuestringfacultatif

Weighted value = CLV × (probability / 100)

Motifnullable
currencyCodestringfacultatif

ISO 4217 currency code

max. 3 caractèresPar défaut : "EUR"
probabilitynumberfacultatif

Win probability in percent

0 – 100nullable
expectedCloseDatedatefacultatif

Expected close date (YYYY-MM-DD)

nullable
dueDatedatefacultatif

Due date — act on the opportunity by this day (YYYY-MM-DD)

nullable
sourcestringfacultatif

Lead source (references opportunity_sources name)

max. 100 caractèresnullable
contractIduuidfacultatif

Linked contract UUID

nullable
projectIduuidfacultatif

Linked project UUID

nullable
lostReasonstringfacultatif

Reason for losing the opportunity

max. 2000 caractèresnullable
mergedIntoOpportunityIduuidfacultatif

If set, this opportunity was merged into the referenced opportunity

nullable
mergedIntoOpportunityNumberstringfacultatif

Opportunity number of the opportunity this was merged into (denormalized for display)

nullable
tagsstring[]facultatif

Tags

Par défaut : []nullable
attachmentsobject[]facultatif
Par défaut : []nullable
s3Keystringobligatoire
fileNamestringobligatoire
mimeTypestringobligatoire
sizeBytesnumberobligatoire
uploadedAtdatetimeobligatoire
uploadedByuuidobligatoire
isInternalbooleanobligatoire
linkedEntitiesobject[]facultatif
Par défaut : []nullable
entityTypestringobligatoire
partyassetticketprojectuseropportunityproposalarticletaskcomplaintproblem
entityIduuidobligatoire
rolestringobligatoire
convertedToobjectfacultatif

Set when this opportunity was converted to another entity (ticket). The opportunity is kept — not deleted — so linked records stay reachable. Written only by the conversion routes.

lecture seulenullable
entityTypestringobligatoire
ticketopportunitycomplaint
entityIduuidobligatoire
convertedAtdatetimefacultatif
nullable
convertedBystringfacultatif
nullable
convertedFromobjectfacultatif

Set when this opportunity was created by converting another entity (ticket). Written only by the conversion routes.

lecture seulenullable
entityTypestringobligatoire
ticketopportunitycomplaint
entityIduuidobligatoire
convertedAtdatetimefacultatif
nullable
convertedBystringfacultatif
nullable
lineItemsobject[]facultatif
Par défaut : []nullable
iduuidobligatoire
articleIduuidfacultatif

Article UUID (null = free-text manual position)

nullable
articleNamestringfacultatif

Denormalized article name at request time

nullable
articleNumberstringfacultatif

Denormalized article number at request time

nullable
quantitystringobligatoire

Requested quantity

Motif
unitstringfacultatif

Unit label snapshot from the article (e.g. "Stk", "h")

max. 100 caractèresnullable
unitPricestringfacultatif

Quoted unit price (null = price on request)

Motifnullable
billingIntervalstringfacultatif

Billing interval — drives MRR/onetime auto-calculation. Null is treated as ONE_TIME.

nullONE_TIMEMONTHLYYEARLY
nullable
currencyCodestringfacultatif

ISO 4217 currency code

max. 3 caractèresnullable
sourcestringfacultatif

Origin of the line item

nullportalmanualproposalsales_orderai
nullable
optionalbooleanfacultatif

Optional position — offered, but not counted into MRR/onetime. Becomes an optional quotation position (weclapp quotationItem.optional). Missing/null = false.

nullable
requestedAtdatetimefacultatif

When the article was added to the opportunity

nullable
notestringfacultatif

Per-item note (e.g. customer remark)

max. 1000 caractèresnullable
alternativesobject[]facultatif

Alternative positions offered alongside this line (e.g. cheaper / premium variant). Not aggregated into MRR/onetime.

Par défaut : []nullable
iduuidobligatoire
articleIduuidfacultatif
nullable
articleNamestringfacultatif
nullable
articleNumberstringfacultatif
nullable
quantitystringfacultatif
Motifnullable
unitstringfacultatif
max. 100 caractèresnullable
unitPricestringfacultatif
Motifnullable
billingIntervalstringfacultatif
nullONE_TIMEMONTHLYYEARLY
nullable
currencyCodestringfacultatif
max. 3 caractèresnullable
notestringfacultatif
max. 1000 caractèresnullable
risksobject[]facultatif

Internal calculation risks of the offer (extra effort, delivery, price, scope)

max. 12 élémentsPar défaut : []nullable
iduuidobligatoire
titlestringobligatoire
1–120 caractères
detailstringfacultatif
max. 500 caractèresnullable
effectstringfacultatif
nullhourspricedeliveryscopeother
nullable
sourcestringfacultatif
nullmanualai
nullable
assumptionsstring[]facultatif

Customer-facing assumptions / scope boundaries the offer is based on (one sentence each)

max. 12 élémentsPar défaut : []nullable
statusChangedAtdatetimefacultatif

Timestamp of the last status change (drives time_in_status / time_to_status targets, ADR 0117a)

nullable
inboundReplyAckedAtdatetimefacultatif

Timestamp at which the latest inbound prospect email was acknowledged as "handled, no reply needed". Clears the awaiting-reply badge when >= the last inbound email time; a newer inbound email re-arms the badge. Mirrors ticket.inboundReplyAckedAt.

nullable
inboundReplyAckedBystringfacultatif

User who acknowledged the latest inbound prospect email (see inboundReplyAckedAt).

nullable
awaitingReplyPinnedAtdate-time[]facultatif

Timestamps of unanswered inbound customer emails that were carried over by a merge and that the standard computation can no longer see. The awaiting-reply badge derives from "inbound emails newer than the last OUTBOUND email of the record" — after a merge that comparison spans two formerly independent conversations, so a reply in one thread silently marks an open question in the other as answered. The merge therefore pins the affected timestamps here; the badge counts them in addition to the computed ones. Cleared by ack-inbound-reply. Server-managed (see merge.service.ts).

nullable
snoozedUntildatetimefacultatif

Opportunity is snoozed until this timestamp; hidden from active pipeline views

nullable
snoozedByuuidfacultatif

User who snoozed the opportunity

nullable
snoozedAtdatetimefacultatif

When the opportunity was snoozed

nullable
snoozeReasonstringfacultatif

Reason provided when snoozing

max. 500 caractèresnullable
snoozeFollowUpTaskIduuidfacultatif

ID of the follow-up task created at snooze time (due at snoozedUntil). Cleared on unsnooze.

nullable
snoozeWokenAtdatetimefacultatif

Set by the snooze-wakeup worker when snoozedUntil passed. snoozedUntil/snoozeReason stay in place so the board can flag the opportunity as "Wiedervorlage fällig" (red) until a user acts on it; it also makes the wakeup fire exactly once. Cleared on snooze/unsnooze. Absent on documents predating the field = never woken (no backfill needed).

nullable
targetsobject[]facultatif

Denormalized active service targets (ADR 0117a)

nullable
stageIdstringobligatoire
stageKindstringobligatoire
time_to_first_responsetime_in_statustime_to_statustime_to_close
stageStatusstringfacultatif
nullable
stageLabelstringfacultatif
nullable
bindingnessstringobligatoire
contractualinternal
deadlinedatetimeobligatoire
breachedAtdatetimefacultatif
nullable
completedAtdatetimefacultatif
nullable
profileIduuidobligatoire
sourceRefobjectfacultatif

Provenance marker for the source system a weclapp-born opportunity was imported from (ADR 0220). The weclapp sync anchor lives in externalReferences[system="weclapp"], NOT here.

Par défaut : nullnullable
systemstringobligatoire

Source system identifier (e.g. weclapp)

idstringobligatoire

Entity ID in the source system

externalReferencesobject[]facultatif

Cross-system linking refs (e.g. weclapp). The weclapp entry is the identity anchor for the bidirectional opportunity sync (ADR 0220). Read/written by the inbound + outbound sync workers and indexed for duplicate prevention.

Par défaut : []nullable
systemstringobligatoire
max. 100 caractères
externalIdstringobligatoire
max. 200 caractères
externalVersionstringfacultatif
nullable
externalNumberstringfacultatif
max. 200 caractèresnullable
syncedAtdatetimefacultatif
nullable
lastSyncCorrelationIdstringfacultatif
nullable
lastInboundHashstringfacultatif
max. 64 caractèresnullable
lastOutboundHashstringfacultatif
max. 64 caractèresnullable

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

Recherche