How tell if deal is won/lost when getting All/Recent Deals


#1

When using the All or Recent deal API is there an easy way to tell if the deal is closed and whether is was lost or won?

The only way I see is to look at the dealstage, then use the GET /deals/v1/pipelines/:pipelineId to look up the stage. Even then the only flag I see is closedWon. How can I tell if its closed/lost? Do I have to look at the probabilities (0 and 1)?

Keep in mind there may be custom pipelines so we can just look for dealstage values of “closedwon” and “closedlost”

It would be nice if there was some indication of closed won/lost in the All/Recent API response. Am I missing something?


#2

Hi @homerlex,

Closed/won deal stages will have their closedwon field set to true. There is no comparable closedlost field; the default Closed/lost value will have a probability of 0. A probability value greater than 0 implies that the deal isn’t completely lost, so that’s likely to be true for custom pipelines as well.

The only way to see closed won/lost in the All/Recent deals response is to include properties=dealstage as a query parameter and look for known closed won/lost deal stages. Since deal pipeline information changes infrequently, you can cache the stage info so that you don’t need to make a deal pipeline request for every dealstage value.