Deals, pipelines and stages
How a deal moves, what ends it, how it is weighted in the forecast and when it counts as stale.
On this page
A deal is one chance to sell to a company, with a value, an owner, the day it is expected to close and a stage. The pipeline is the set of stages, in the order of the columns of the board.
How a deal moves
| Operation | From | To | Needs |
|---|---|---|---|
createDeal | - | lead | A company, a name, a value above zero and a day that is today or later. |
moveDeal | any open stage | any other open stage, forwards or back | The revision you read. |
winDeal | offer, negotiation | won | A reason. A deal that has no offer yet cannot be won. |
loseDeal | any open stage | lost | A reason. |
reopenDeal | won, lost | the stage it was closed from, or one you name | No order in ERP. |
won and lost end the deal. Only reopening it, or creating its order if it is won, is accepted on an ended deal. A reopening is recorded in the history of the deal.
Reasons
A win and a loss each take a reason from a short list, and the deal keeps it in reason. The reasons for loss add up in the forecast.
| Operation | Values of `reason` |
|---|---|
winDeal | price, range, delivery, relationship |
loseDeal | price, competitor, no-budget, no-decision, not-a-fit |
The pipeline
Get a pipeline returns the stages with their position on the board and their weight. The stage a deal leaves the board for, lost, has no position. The weights and staleAfterDays are settings of your account, set up with you.
curl
curl "$RDC_BASE_URL/crm/v1/pipelines/d114b9e3-ccb6-43c0-aa1f-59d1e5fe8985" \
-H "Authorization: Bearer $RDC_TOKEN" JavaScript
const response = await fetch(`${process.env.RDC_BASE_URL}/crm/v1/pipelines/d114b9e3-ccb6-43c0-aa1f-59d1e5fe8985`, {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.RDC_TOKEN}`,
},
});
const result = await response.json(); Python
import os
import requests
response = requests.request(
'GET',
f'{os.environ["RDC_BASE_URL"]}/crm/v1/pipelines/d114b9e3-ccb6-43c0-aa1f-59d1e5fe8985',
headers={
'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
},
)
result = response.json() PHP
<?php
$curl = curl_init(getenv('RDC_BASE_URL') . '/crm/v1/pipelines/d114b9e3-ccb6-43c0-aa1f-59d1e5fe8985');
curl_setopt_array($curl, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('RDC_TOKEN'),
],
]);
$result = json_decode(curl_exec($curl), true);
curl_close($curl); C#
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/crm/v1/pipelines/d114b9e3-ccb6-43c0-aa1f-59d1e5fe8985");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync(); {
"id": "d114b9e3-ccb6-43c0-aa1f-59d1e5fe8985",
"name": "Sales",
"stages": [
{
"id": "lead",
"kind": "open",
"position": 1,
"weight": 10
},
{
"id": "qualified",
"kind": "open",
"position": 2,
"weight": 25
},
{
"id": "offer",
"kind": "open",
"position": 3,
"weight": 50
},
{
"id": "negotiation",
"kind": "open",
"position": 4,
"weight": 75
},
{
"id": "won",
"kind": "won",
"position": 5,
"weight": 100
},
{
"id": "lost",
"kind": "lost",
"position": null,
"weight": 0
}
],
"staleAfterDays": 14,
"revision": 1
} Weight and the forecast
A deal counts in the forecast for its value multiplied by the weight of its stage, as a percent, rounded to the nearest 0.01. A won deal counts in full and a lost deal counts for nothing.
When a deal is stale
A deal that has stood in one open stage for staleAfterDays days or more is stale. The API does not store this: it is the number of days since the deal came to stand in its stage. Moving or reopening a deal starts the count again. Scheduling or completing a task does not.
Revisions
The revision of a deal counts the changes made to it: creating it is revision 1. Every change adds one: a move, a win or a loss, a reopening, scheduling or completing a task, creating the order, merging a duplicate into it. Logging a call or writing a note changes no deal. Send the revision you read as expectedRevision; see Idempotency and concurrency.