Deals & Pipelines

A deal represents a sales opportunity with a monetary value. A pipeline defines the ordered stages that deals progress through.

Deals

Every deal tracks a potential sale from first conversation to close.

Deal status

StatusDescription
openActive opportunity
wonClosed-won — revenue realized
lostClosed-lost — opportunity dead
stalledNo activity for a defined period

Key fields

FieldTypeDescription
idstringTypeID with deal_ prefix
namestringDeal name (e.g., "Acme Corp - Enterprise Plan")
valueintegerDeal value in cents (e.g., 500000 = $5,000.00)
statusenumCurrent deal status
contact_idstringPrimary contact for this deal
pipeline_idstringPipeline this deal belongs to
stage_idstringCurrent stage within the pipeline
expected_closedateExpected close date
owner_idstringAssigned team member
metadataobjectArbitrary key-value pairs

Money values

All monetary values in Rex are stored as int64 in cents. This avoids floating-point precision issues:

DisplayAPI Value
$5,000.00500000
$99.509950
$1,000,000.00100000000

Pipelines

A pipeline is an ordered list of stages that deals move through. Each org can have multiple pipelines (e.g., "Sales Pipeline", "Partnership Pipeline").

Pipeline stages

Each stage has:

FieldTypeDescription
idstringStage ID
namestringStage name (e.g., "Discovery", "Proposal", "Negotiation")
colorstringHex color for UI display
positionintegerOrder in the pipeline (0-indexed)

Example pipeline

Discovery → Qualification → Proposal → Negotiation → Closed
    (0)         (1)           (2)         (3)          (4)

Deal lifecycle

  1. Create a deal linked to a contact and pipeline stage
  2. Progress the deal by updating its stage_id as conversations advance
  3. Close the deal by setting status to won or lost
  4. Events are emitted at each transition for webhook consumers

Common API operations

OperationMethodEndpoint
Create a dealPOST/deals
List dealsGET/deals
Get a dealGET/deals/:id
Update a dealPATCH/deals/:id
Delete a dealDELETE/deals/:id
Create a pipelinePOST/pipelines
List pipelinesGET/pipelines
Get a pipelineGET/pipelines/:id
Update a pipelinePATCH/pipelines/:id

See the full Deals API reference and Pipelines API reference.

Was this page helpful?

·