Skip to content

Firsatlar API ​

Satis firsatlarini programatik olarak yonetin.

Endpoints ​

MethodEndpointAciklama
GET/dealsFirsat listesi
POST/dealsYeni firsat
GET/deals/:idFirsat detayi
PUT/deals/:idFirsat guncelleme
DELETE/deals/:idFirsat silme

Firsat Listesi ​

http
GET /api/v1/deals

Query Parameters ​

ParametreTipAciklama
pagenumberSayfa numarasi
limitnumberSayfa basi kayit
stagestringAsama filtresi
assignedTostringAtanan kisi
contactIdstringKisi ID
minValuenumberMinimum deger
maxValuenumberMaksimum deger

Ornek Yanit ​

json
{
  "success": true,
  "data": [
    {
      "id": "deal_abc123",
      "name": "Kurumsal Paket Satisi",
      "value": 50000,
      "currency": "TRY",
      "stage": "proposal",
      "probability": 60,
      "contact": {
        "id": "contact_xyz",
        "name": "ABC Sirket"
      },
      "assignedTo": {
        "id": "user_123",
        "name": "Ahmet Yilmaz"
      },
      "expectedCloseDate": "2024-02-15",
      "createdAt": "2024-01-10T09:00:00Z"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 20,
    "total": 35
  }
}

Yeni Firsat ​

http
POST /api/v1/deals

Request Body ​

json
{
  "name": "Yeni Proje",
  "value": 75000,
  "currency": "TRY",
  "stage": "lead",
  "probability": 20,
  "contactId": "contact_xyz",
  "assignedTo": "user_123",
  "expectedCloseDate": "2024-03-01",
  "description": "Kurumsal CRM cozumu",
  "customFields": {
    "source": "referral",
    "competitor": "Rakip A"
  }
}

Ornek Yanit ​

json
{
  "success": true,
  "data": {
    "id": "deal_new123",
    "name": "Yeni Proje",
    "value": 75000,
    "stage": "lead",
    "createdAt": "2024-01-21T11:00:00Z"
  }
}

Firsat Detayi ​

http
GET /api/v1/deals/:id

Ornek Yanit ​

json
{
  "success": true,
  "data": {
    "id": "deal_abc123",
    "name": "Kurumsal Paket Satisi",
    "value": 50000,
    "currency": "TRY",
    "stage": "proposal",
    "probability": 60,
    "contact": {
      "id": "contact_xyz",
      "firstName": "Ali",
      "lastName": "Veli",
      "company": "ABC Sirket",
      "email": "[email protected]"
    },
    "assignedTo": {
      "id": "user_123",
      "name": "Ahmet Yilmaz"
    },
    "expectedCloseDate": "2024-02-15",
    "description": "100 kullanici lisansi",
    "activities": [
      {
        "type": "note",
        "content": "Ilk gorusme yapildi",
        "createdAt": "2024-01-15T10:00:00Z"
      },
      {
        "type": "stage_change",
        "from": "lead",
        "to": "contact",
        "createdAt": "2024-01-16T09:00:00Z"
      }
    ],
    "tasks": [
      {
        "id": "task_123",
        "title": "Teklif hazirlama",
        "dueDate": "2024-01-25",
        "status": "pending"
      }
    ],
    "createdAt": "2024-01-10T09:00:00Z",
    "updatedAt": "2024-01-20T14:30:00Z"
  }
}

Asama Guncelleme ​

http
PATCH /api/v1/deals/:id/stage
json
{
  "stage": "negotiation",
  "note": "Fiyat muzakeresine gecildi"
}

Mevcut Asamalar ​

AsamaAciklama
leadYeni firsat
contactIletisim kuruldu
proposalTeklif gonderildi
negotiationMuzakere
wonKazanildi
lostKaybedildi

Firsat Kazanma ​

http
POST /api/v1/deals/:id/won
json
{
  "closedValue": 48000,
  "note": "Indirimli kapanis"
}

Firsat Kaybetme ​

http
POST /api/v1/deals/:id/lost
json
{
  "reason": "price",
  "competitorName": "Rakip B",
  "note": "Fiyat yuksek bulundu"
}

Kayip Nedenleri ​

  • price - Fiyat
  • competitor - Rakip tercih
  • timing - Zamanlama
  • budget - Butce yok
  • no_response - Yanit yok
  • other - Diger

Aktivite Ekleme ​

http
POST /api/v1/deals/:id/activities
json
{
  "type": "note",
  "content": "Musterityle toplanti yapildi"
}

Pipeline Ozeti ​

http
GET /api/v1/deals/pipeline

Ornek Yanit ​

json
{
  "success": true,
  "data": {
    "stages": [
      {
        "stage": "lead",
        "count": 15,
        "value": 450000
      },
      {
        "stage": "proposal",
        "count": 8,
        "value": 320000
      }
    ],
    "summary": {
      "totalDeals": 35,
      "totalValue": 1250000,
      "weightedValue": 425000,
      "avgDealSize": 35714
    }
  }
}

Webhooks ​

Firsat olaylari:

  • deal.created - Firsat olusturuldu
  • deal.updated - Firsat guncellendi
  • deal.stage_changed - Asama degisti
  • deal.won - Kazanildi
  • deal.lost - Kaybedildi

DOLU.ai - AI Destekli CRM Platformu