Converting to CRM Deals

I’m attempting to migrate to the new CRM Deals API. I need to determine if a deal already exists. Currently I use https://api.hubapi.com/extensions/ecomm/v1/sync-messages/DEAL

with a paramater of “action”: “UPSERT”. In the new API CRM I’m using https://api.hubapi.com/crm/v3/objects/deals. It appears I need to know if the deal exist as I need to use a Post to create one or a Patch to update one. Can I execute a GET based on a custom property instead of the deal ID. So far I haven’t been able to find a why to preform this

Thank You

Angelo

Hi Angelo,

You may refer to this document: Accounts Dashboard | HubSpot

There is an endpoint called

/crm/v3/objects/deals/search

From there, you can input the propertyName, operator, filterGroups values via the API explorer and the code samples will do the necessary for you :slightly_smiling_face:

Cheers
WL

Thank you for your response. I’m entering this CURL data command
--data ‘{
“filterGroups”: [
{
“filters”: [
{
“propertyName”: “abandon_email_address”,
“operator”: “EQ”,
“value”: [angelo.emmi@gaylord.com ]
}
]
}
],
“sorts”: [
“abandon_email_address”
],
“limit”: 20,
“after”: 0
}’
And I’m receiving this response
{“status”:“error”,“message”:“Invalid input JSON on line 9, column 15: Cannot deserialize value of type `java.lang.String` from Array value (token `JsonToken.START_ARRAY`)”,“correlationId”:“ac8a45b4-86e6-456e-844c-16b9d89693cd”}
Any suggestions on how to correct this issue

Hi @aemmi ,

If you use the ‘EQ’ operator, the API does not expect an array, so try this instead:

--data '{
"filterGroups": [
{
"filters": [
{
"propertyName": "abandon_email_address",
"operator": "EQ",
"value": "example@email.com"
}
]
}
],
"sorts": [
"abandon_email_address"
],
"limit": 20,
"after": 0
}'

Thank you for your help