APIs & Integrations

KMalaiyappan
Participant

Value for deal stage pulled thru API

SOLVE

Thru API call deal data has pulled and I some the deal has dealstage description of interger values like (139921,139925) I would be expecting it to be like (closedwon, closedlost)

 

what those integer deal stage mean?

 

0 Upvotes
1 Accepted solution
coldrickjack
Solution
Guide

Value for deal stage pulled thru API

SOLVE

Hey @KMalaiyappan,

 

The "dealstage" property will return the internal ID of the deal stage the deal resides in within a pipeline. If you are using the default "Sales Pipeline" those internal IDs correlate to the labels of the stages. What I mean by that (for example) is "Closed Won" would have an internal Id of "closedwon". See below:

 

 

"label": "Closed Won",
"displayOrder": 5,
"metadata": {
   "isClosed": "true",
   "probability": "1.0"
},
"id": "closedwon",
"createdAt": "1970-01-01T00:00:00Z",
"updatedAt": "1970-01-01T00:00:00Z",
"archived": false,
"writePermissions": "CRM_PERMISSIONS_ENFORCEMENT"

 

 

If you are using any other pipeline outside of the default pipeline it's expected that these internal IDs return as a string of numbers. For instance the same stage "Closed Won" in my "Renewal Pipeline" has an internal ID of "258551227". 

 

 

"label": "Closed won",
"displayOrder": 5,
"metadata": {
   "isClosed": "true",
   "probability": "1.0"
},
"id": "258551227",
"createdAt": "2023-07-20T08:51:49.359Z",
"updatedAt": "2023-07-20T08:51:49.359Z",
"archived": false,
"writePermissions": "CRM_PERMISSIONS_ENFORCEMENT"

 

 

To get the label of the stage you'll need to make an additional request to the Pipelines API. Specifically GET /crm/v3/pipelines/{objectType}/{pipelineId}/stages/{stageId}

View solution in original post

1 Reply 1
coldrickjack
Solution
Guide

Value for deal stage pulled thru API

SOLVE

Hey @KMalaiyappan,

 

The "dealstage" property will return the internal ID of the deal stage the deal resides in within a pipeline. If you are using the default "Sales Pipeline" those internal IDs correlate to the labels of the stages. What I mean by that (for example) is "Closed Won" would have an internal Id of "closedwon". See below:

 

 

"label": "Closed Won",
"displayOrder": 5,
"metadata": {
   "isClosed": "true",
   "probability": "1.0"
},
"id": "closedwon",
"createdAt": "1970-01-01T00:00:00Z",
"updatedAt": "1970-01-01T00:00:00Z",
"archived": false,
"writePermissions": "CRM_PERMISSIONS_ENFORCEMENT"

 

 

If you are using any other pipeline outside of the default pipeline it's expected that these internal IDs return as a string of numbers. For instance the same stage "Closed Won" in my "Renewal Pipeline" has an internal ID of "258551227". 

 

 

"label": "Closed won",
"displayOrder": 5,
"metadata": {
   "isClosed": "true",
   "probability": "1.0"
},
"id": "258551227",
"createdAt": "2023-07-20T08:51:49.359Z",
"updatedAt": "2023-07-20T08:51:49.359Z",
"archived": false,
"writePermissions": "CRM_PERMISSIONS_ENFORCEMENT"

 

 

To get the label of the stage you'll need to make an additional request to the Pipelines API. Specifically GET /crm/v3/pipelines/{objectType}/{pipelineId}/stages/{stageId}