KPIs - Number of Deals Entering Certain Stages

Hi,

New to using the Pipedrive API - what would be the simplest way to pull information on how many Deals entered certain stages on a daily basis?

I’m looking to track the daily number of Deals Opened, “Offers Made” (i.e. a random Stage ID), “Contracts Received” (another intermediate stage ID), and Deals Won.

I see the Get deals in a stage [GET /stages/{id}/deals] endpoint, but I don’t see a field showing when it was added to the stage. I don’t want to seemingly recreate managing the state of deals on my side (i.e. Deals A, B, & C are in stage Y yesterday, now Deals A, B, C, & D are in stage Y -> so 1 deal was added).

Is there a simpler way I’m missing?

Thanks.

Hi!

What do you think about subscribing to deal update events via Webhooks instead of pulling data via API?

You can configure webook in “Settings -> Tools -> Webhooks”, to the “update.deal” event. Once a deal is updated (moved to the different stage is also a deal update event), webhook is triggered, with the following payload:

{
 // ...
 "current": {
    "stage_id": "<current stage id>",
 },
 "previous": {
    "stage_id": "<previous stage id>",
 }
 // ...
}

You can get stages ids by calling https://developers.pipedrive.com/docs/api/v1/#!/Stages/get_stages, and once a current deal stage matches you desirable stage id and previous stage id is not the same as a current one, +1 into KPI calculations for that stage.

Would it work for your need?

2 Likes

Ok great, I’ll check that out. Thanks!