Updating deal creates new deal record

Hello,

I am using the CRM API to create and update deal records and am noticing an oddity when updating deals:

hubspotClient.crm.deals.basicApi.update(dealIdToUpdate, dealPropertiesObject, undefined)

where ‘dealIdToUpdate’ is the ID of an existing deal *does* in fact update the deal as I expect, which is great, but it also always creates a new deal with the same properties.

I am using a stripe integration and based on certain webhooks calling this update method, which is only firing once, and that leads me to believe there is an issue somewhere in my hubspot code.

I am curious if this is a known bug that others have experienced, otherwise how I might go along resolving the issue?

Thank you for any and all guidance/support.

Best,

Zach

I don’t see anything with that line of code that would create a new deal…

Can you add more of your code here? @Teun , you see anything?

Hi @ZRetterath ,

If you use an API key or a private app you can check the call log to see what is happening at the HubSpot side.
API Key logs: https://app.hubspot.com/api-key/\/call-log

Private app logs: https://app.hubspot.com/private-apps/<portalId>/<appId>/logs/api

That way, you can check if your code is making multiple calls to HubSpot.
I do not see anything wrong with your code, so if possible, please share a bit more.

Thanks, Teun! Following your steps I was able to diagnose and patch the issue.

I appreciate the response and assistance!

Best,

Zach

Awesome! Happy I could help!