I'm trying to integrate hubspot with our inventory management software system I've created a sale in HubSpot via API with Contact (AssociatedVid: 12801). After that I changed sale's customer in our inventory system end and try to update the deal in HubSpot. I sent the Put request with new AssociatedVid: 4301, but got a response with old AssociatedVid: 12801. I checked in HubSpot UI, the contact in deal is not updated. How can I update contact for existing deal via HubSpot API?
I am unable to determine which endpoint you're hitting here but seeing as how you mention that you're updating a Deal, I will assume it is our Update a Deal endpoint seen here.
As per the documentation, the Method and endpoint are as follows:
PATCH/crm/v3/objects/deals/{dealId}
Can you confirm that you're hitting this endpoint? Looking at your code, it appears the method you're using is PUT instead of PATCH too, can you attempt to update this to see if this resolves the issue?
Thanks for the detail here! Looking into the details it appears you're attempting to update the Associations via the Deals endpoint which is not currently possible.
This must be done via the use of our Associations API which can be found here. In this case, when updating the associations a new call will be made. For example, if we add a new association between the Deal and a Contact, we'd use the following request: