Skip to main content
The Deals API provides comprehensive pipeline management functionality for real estate transactions, enabling agents to track deals from initial contact through closing with complete visibility and control.

Deal Object

Deal Properties

{
  "id": "deal_123e4567-e89b-12d3-a456-426614174000",
  "organizationId": "org_123e4567-e89b-12d3-a456-426614174000",
  "title": "Miami Waterfront Condo Sale",
  "description": "Luxury 2BR/2BA oceanfront condo with panoramic views",
  "type": "SALE",
  "stage": "NEGOTIATION",
  "status": "ACTIVE",
  "amount": 750000,
  "commission": {
    "rate": 0.06,
    "amount": 45000,
    "split": 0.5
  },
  "contact": {
    "id": "contact_123",
    "firstName": "John",
    "lastName": "Doe",
    "email": "john.doe@example.com"
  },
  "property": {
    "id": "property_456",
    "address": "123 Ocean Drive, Miami Beach, FL 33139",
    "type": "CONDO",
    "bedrooms": 2,
    "bathrooms": 2,
    "squareFootage": 1200
  },
  "assignedTo": "agent_123e4567-e89b-12d3-a456-426614174000",
  "teamMembers": [
    {
      "userId": "user_456",
      "role": "LISTING_AGENT",
      "commissionSplit": 0.5
    },
    {
      "userId": "user_789",
      "role": "BUYER_AGENT",
      "commissionSplit": 0.5
    }
  ],
  "timeline": {
    "listingDate": "2024-01-01T00:00:00Z",
    "contractDate": "2024-01-15T00:00:00Z",
    "inspectionDate": "2024-01-22T00:00:00Z",
    "appraisalDate": "2024-01-25T00:00:00Z",
    "closingDate": "2024-02-15T00:00:00Z"
  },
  "documents": [
    {
      "id": "doc_123",
      "name": "Purchase Agreement",
      "type": "CONTRACT",
      "url": "https://storage.winnerr.com/documents/doc_123.pdf"
    }
  ],
  "tasks": [
    {
      "id": "task_123",
      "title": "Schedule inspection",
      "dueDate": "2024-01-20T00:00:00Z",
      "completed": false
    }
  ],
  "probability": 75,
  "source": "REFERRAL",
  "tags": ["luxury", "waterfront", "cash-buyer"],
  "notes": "Buyer is pre-approved for cash purchase",
  "createdAt": "2024-01-01T10:00:00Z",
  "updatedAt": "2024-01-15T14:30:00Z",
  "lastActivityAt": "2024-01-15T14:30:00Z"
}

Deal Types

TypeDescription
SALEProperty sale transaction
PURCHASEProperty purchase transaction
LEASEProperty lease transaction
RENTALProperty rental transaction

Deal Stages

StageDescription
LEADInitial contact or inquiry
QUALIFIEDQualified prospect
APPOINTMENTScheduled showing or meeting
NEGOTIATIONActive negotiation
CONTRACTUnder contract
INSPECTIONInspection period
APPRAISALAppraisal in progress
FINANCINGFinancing approval
CLOSINGClosing preparation
CLOSEDDeal closed successfully
LOSTDeal lost or cancelled

Deal Status

StatusDescription
ACTIVEDeal is active and progressing
ON_HOLDDeal is temporarily paused
CANCELLEDDeal has been cancelled
CLOSEDDeal has been closed

Endpoints

List Deals

Retrieve a paginated list of deals with optional filtering and sorting.
curl -X GET "https://api.winnerr.com/v1/deals" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json"
Query Parameters:
ParameterTypeDescription
limitintegerNumber of deals to return (1-100, default: 25)
cursorstringPagination cursor for next page
typestringFilter by deal type
stagestringFilter by deal stage
statusstringFilter by deal status
assignedTostringFilter by assigned agent
amount[gte]numberFilter by minimum deal amount
amount[lte]numberFilter by maximum deal amount
probability[gte]integerFilter by minimum probability
createdAt[gte]stringFilter by creation date (ISO 8601)
closingDate[gte]stringFilter by closing date (ISO 8601)
sortstringSort order (e.g., “amount:desc,createdAt:desc”)
includestringInclude related data (e.g., “contact,property,documents”)
Response:
{
  "success": true,
  "data": [
    {
      "id": "deal_123",
      "title": "Miami Waterfront Condo Sale",
      "type": "SALE",
      "stage": "NEGOTIATION",
      "status": "ACTIVE",
      "amount": 750000,
      "probability": 75,
      "assignedTo": "agent_123",
      "closingDate": "2024-02-15T00:00:00Z",
      "createdAt": "2024-01-01T10:00:00Z"
    }
  ],
  "pagination": {
    "hasMore": true,
    "nextCursor": "eyJpZCI6IjEyNCJ9",
    "total": 85,
    "limit": 25
  }
}

Get Deal

Retrieve a specific deal by ID.
curl -X GET "https://api.winnerr.com/v1/deals/deal_123" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"
Path Parameters:
ParameterTypeDescription
idstringDeal ID
Query Parameters:
ParameterTypeDescription
includestringInclude related data (e.g., “contact,property,documents,tasks,activities”)
Response:
{
  "success": true,
  "data": {
    "id": "deal_123",
    "title": "Miami Waterfront Condo Sale",
    "type": "SALE",
    "stage": "NEGOTIATION",
    "amount": 750000,
    "contact": {
      "id": "contact_123",
      "firstName": "John",
      "lastName": "Doe",
      "email": "john.doe@example.com"
    },
    "property": {
      "id": "property_456",
      "address": "123 Ocean Drive, Miami Beach, FL 33139",
      "type": "CONDO"
    },
    "tasks": [
      {
        "id": "task_123",
        "title": "Schedule inspection",
        "dueDate": "2024-01-20T00:00:00Z",
        "completed": false
      }
    ]
  }
}

Create Deal

Create a new deal in the pipeline.
curl -X POST "https://api.winnerr.com/v1/deals" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Downtown Loft Sale",
    "type": "SALE",
    "stage": "QUALIFIED",
    "amount": 450000,
    "contactId": "contact_456",
    "propertyId": "property_789",
    "timeline": {
      "closingDate": "2024-03-01T00:00:00Z"
    },
    "commission": {
      "rate": 0.06
    },
    "probability": 60
  }'
Request Body:
FieldTypeRequiredDescription
titlestringYesDeal title
typestringYesDeal type (SALE, PURCHASE, LEASE, RENTAL)
stagestringNoDeal stage (default: LEAD)
amountnumberYesDeal amount
contactIdstringYesAssociated contact ID
propertyIdstringNoAssociated property ID
descriptionstringNoDeal description
timelineobjectNoDeal timeline dates
commissionobjectNoCommission details
probabilityintegerNoDeal probability (0-100)
sourcestringNoDeal source
tagsarrayNoArray of tags
notesstringNoAdditional notes
Response:
{
  "success": true,
  "data": {
    "id": "deal_456",
    "title": "Downtown Loft Sale",
    "type": "SALE",
    "stage": "QUALIFIED",
    "status": "ACTIVE",
    "amount": 450000,
    "probability": 60,
    "commission": {
      "rate": 0.06,
      "amount": 27000
    },
    "createdAt": "2024-01-15T16:00:00Z",
    "updatedAt": "2024-01-15T16:00:00Z"
  }
}

Update Deal

Update an existing deal’s information.
curl -X PUT "https://api.winnerr.com/v1/deals/deal_123" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "stage": "CONTRACT",
    "amount": 740000,
    "probability": 90,
    "timeline": {
      "contractDate": "2024-01-15T00:00:00Z",
      "closingDate": "2024-02-10T00:00:00Z"
    }
  }'
Path Parameters:
ParameterTypeDescription
idstringDeal ID
Request Body: Same fields as create deal (all optional for updates) Response:
{
  "success": true,
  "data": {
    "id": "deal_123",
    "title": "Miami Waterfront Condo Sale",
    "stage": "CONTRACT",
    "amount": 740000,
    "probability": 90,
    "timeline": {
      "contractDate": "2024-01-15T00:00:00Z",
      "closingDate": "2024-02-10T00:00:00Z"
    },
    "updatedAt": "2024-01-15T17:30:00Z"
  }
}

Delete Deal

Delete a deal from the pipeline.
curl -X DELETE "https://api.winnerr.com/v1/deals/deal_123" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"
Path Parameters:
ParameterTypeDescription
idstringDeal ID
Response:
{
  "success": true,
  "message": "Deal deleted successfully"
}

Deal Tasks

List Deal Tasks

Retrieve tasks associated with a deal.
curl -X GET "https://api.winnerr.com/v1/deals/deal_123/tasks" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"
Response:
{
  "success": true,
  "data": [
    {
      "id": "task_123",
      "title": "Schedule inspection",
      "description": "Coordinate property inspection with buyer",
      "dueDate": "2024-01-20T00:00:00Z",
      "completed": false,
      "assignedTo": "agent_123",
      "priority": "HIGH",
      "createdAt": "2024-01-15T10:00:00Z"
    }
  ]
}

Create Deal Task

Add a new task to a deal.
curl -X POST "https://api.winnerr.com/v1/deals/deal_123/tasks" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Order appraisal",
    "description": "Contact appraiser for property valuation",
    "dueDate": "2024-01-25T00:00:00Z",
    "priority": "MEDIUM",
    "assignedTo": "agent_123"
  }'

Deal Documents

List Deal Documents

Retrieve documents associated with a deal.
curl -X GET "https://api.winnerr.com/v1/deals/deal_123/documents" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"
Response:
{
  "success": true,
  "data": [
    {
      "id": "doc_123",
      "name": "Purchase Agreement",
      "type": "CONTRACT",
      "size": 245760,
      "mimeType": "application/pdf",
      "url": "https://storage.winnerr.com/documents/doc_123.pdf",
      "signedAt": "2024-01-15T14:30:00Z",
      "uploadedAt": "2024-01-15T14:00:00Z"
    }
  ]
}

Upload Deal Document

Upload a new document to a deal.
curl -X POST "https://api.winnerr.com/v1/deals/deal_123/documents" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -F "file=@purchase_agreement.pdf" \
  -F "name=Purchase Agreement" \
  -F "type=CONTRACT"

Deal Activities

List Deal Activities

Retrieve activity history for a deal.
curl -X GET "https://api.winnerr.com/v1/deals/deal_123/activities" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"
Response:
{
  "success": true,
  "data": [
    {
      "id": "activity_123",
      "type": "STAGE_CHANGED",
      "description": "Deal stage changed from QUALIFIED to NEGOTIATION",
      "createdAt": "2024-01-15T14:20:00Z",
      "userId": "user_123",
      "metadata": {
        "previousStage": "QUALIFIED",
        "newStage": "NEGOTIATION"
      }
    }
  ]
}

Pipeline Management

Get Pipeline Overview

Retrieve pipeline statistics and stage breakdown.
curl -X GET "https://api.winnerr.com/v1/deals/pipeline" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"
Response:
{
  "success": true,
  "data": {
    "totalValue": 5250000,
    "totalDeals": 28,
    "averageDealSize": 187500,
    "conversionRate": 0.68,
    "stages": [
      {
        "stage": "LEAD",
        "count": 5,
        "value": 875000,
        "averageProbability": 25
      },
      {
        "stage": "QUALIFIED",
        "count": 8,
        "value": 1400000,
        "averageProbability": 45
      },
      {
        "stage": "NEGOTIATION",
        "count": 6,
        "value": 1200000,
        "averageProbability": 70
      },
      {
        "stage": "CONTRACT",
        "count": 4,
        "value": 950000,
        "averageProbability": 90
      },
      {
        "stage": "CLOSING",
        "count": 3,
        "value": 600000,
        "averageProbability": 95
      }
    ]
  }
}

Move Deal to Stage

Move a deal to a different pipeline stage.
curl -X POST "https://api.winnerr.com/v1/deals/deal_123/move" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "stage": "CONTRACT",
    "reason": "Offer accepted by seller",
    "probability": 90
  }'

Deal Analytics

Get Deal Metrics

Retrieve analytics and performance metrics for deals.
curl -X GET "https://api.winnerr.com/v1/deals/analytics" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"
Query Parameters:
ParameterTypeDescription
periodstringTime period (7d, 30d, 90d, 1y)
assignedTostringFilter by assigned agent
typestringFilter by deal type
Response:
{
  "success": true,
  "data": {
    "period": "30d",
    "totalDeals": 28,
    "closedDeals": 8,
    "totalValue": 5250000,
    "closedValue": 1800000,
    "averageTimeToClose": 45,
    "conversionRate": 0.68,
    "topPerformers": [
      {
        "agentId": "agent_123",
        "name": "Sarah Johnson",
        "deals": 12,
        "closedValue": 850000
      }
    ]
  }
}

Webhooks

Deal Events

Supported webhook events for deals:
  • deal.created
  • deal.updated
  • deal.stage_changed
  • deal.closed
  • deal.lost
  • deal.document_uploaded
  • deal.task_created
  • deal.task_completed

Webhook Payload Example

{
  "id": "evt_123456789",
  "event": "deal.stage_changed",
  "createdAt": "2024-01-15T14:30:00Z",
  "data": {
    "id": "deal_123",
    "title": "Miami Waterfront Condo Sale",
    "previousStage": "QUALIFIED",
    "newStage": "NEGOTIATION",
    "amount": 750000,
    "probability": 70
  },
  "organization": {
    "id": "org_123",
    "name": "Premier Realty Group"
  }
}

Best Practices

1. Pipeline Management

Regularly update deal stages and probabilities:
// Update deal stage with probability adjustment
await fetch('https://api.winnerr.com/v1/deals/deal_123', {
  method: 'PUT',
  headers: {
    'Authorization': 'Bearer YOUR_JWT_TOKEN',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    stage: 'NEGOTIATION',
    probability: 75, // Adjust based on stage
    notes: 'Buyer submitted counter-offer'
  })
});

2. Task Management

Create tasks automatically when deals progress:
// Create inspection task when deal reaches contract stage
if (deal.stage === 'CONTRACT') {
  await fetch(`https://api.winnerr.com/v1/deals/${deal.id}/tasks`, {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer YOUR_JWT_TOKEN',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      title: 'Schedule inspection',
      dueDate: new Date(Date.now() + 7 * 24 * 60 * 60 * 1000), // 7 days from now
      priority: 'HIGH'
    })
  });
}

3. Document Management

Organize documents by type and stage:
// Upload document with proper categorization
const formData = new FormData();
formData.append('file', contractFile);
formData.append('name', 'Signed Purchase Agreement');
formData.append('type', 'CONTRACT');
formData.append('stage', 'CONTRACT');

await fetch(`https://api.winnerr.com/v1/deals/${dealId}/documents`, {
  method: 'POST',
  headers: { 'Authorization': 'Bearer YOUR_JWT_TOKEN' },
  body: formData
});

4. Performance Tracking

Monitor deal performance regularly:
// Get pipeline metrics for performance analysis
const metrics = await fetch('https://api.winnerr.com/v1/deals/pipeline', {
  headers: { 'Authorization': 'Bearer YOUR_JWT_TOKEN' }
});

// Identify bottlenecks and optimization opportunities
const bottlenecks = metrics.data.stages.filter(stage => 
  stage.averageProbability < 0.5 && stage.count > 5
);

Deal data is automatically synchronized with your CRM dashboard, analytics, and commission tracking. All deal activities are logged for audit and compliance purposes.