Is there a way to ensure I'm not setting a deal stage to a prior state?
SOLVE
Hi @kwonderschool, welcome! Are you using this endpoint: https://developers.hubspot.com/docs/methods/deals/update_deal instead of the one you listed above? The endpoint you listed simply updates a particular property on a deal. For example, If I wanted to change a property on deal from a dropdown to an input, I'd use the one you specified, but use the one I specified when making changes to an actual deal in your Account.
That said, for your actual question, there isn't a way to do that out of the box. You can set deals back a stage in the UI, and we don't have a method for preventing this behavior in the API. What you could potentially do is code this behavior in to your application if you're developing one. To do this, you could make a GET to the pipelines API, then assign a sequential number value to each stage. If the number of the stage you're updating to is greater than the number of the stage that the deal is currently on, you can go ahead and make the request. If it is the opposite, then you could prevent your code from running.
Is there a way to ensure I'm not setting a deal stage to a prior state?
SOLVE
Hi @kwonderschool, welcome! Are you using this endpoint: https://developers.hubspot.com/docs/methods/deals/update_deal instead of the one you listed above? The endpoint you listed simply updates a particular property on a deal. For example, If I wanted to change a property on deal from a dropdown to an input, I'd use the one you specified, but use the one I specified when making changes to an actual deal in your Account.
That said, for your actual question, there isn't a way to do that out of the box. You can set deals back a stage in the UI, and we don't have a method for preventing this behavior in the API. What you could potentially do is code this behavior in to your application if you're developing one. To do this, you could make a GET to the pipelines API, then assign a sequential number value to each stage. If the number of the stage you're updating to is greater than the number of the stage that the deal is currently on, you can go ahead and make the request. If it is the opposite, then you could prevent your code from running.