CRM

tjsimpson
Participante

Deal Close Date 1 Day Behind Integration API

Hello everyone!

I am currently observing an issue with Deals in HubSpot when I write to the 'Close date' via API integration the date is 1 day behind. I believe there are 2 possibles fixes/approahces and wanted to get advice from the community.

tjsimpson_0-1719929061294.png

Data written to the API for 'Close date' in this example: 2024-07-01


Approach 1: Can I leave off the Deal 'Close Date' altogether and HubSpot will automatically write to it when a Deal is moved to the correct 'Deal stage'? In my case the 'Deal stage' of 'Funded' would mean the Deal has been closed won and this is marked in the 'Deal Probability' of the Deal pipeline as so. My assumption is that maybe I can leave off the 'Close date' and HubSpot will set it automatically based on when the 'Deal stage' has been moved to the appropriate stage?

Approach 2: I believe the format of my date could be wrong causing the issue. I use the format 'yyyy-MM-dd' i.e. 2024-06-12. Has anyone had success with a different date format for 'Close date'?

Thank you in advance!

2 Respostas 2
Humashankar
Conselheiro(a) de destaque

Deal Close Date 1 Day Behind Integration API

Hi @tjsimpson 

 

The discrepancy in dates is likely due to a time zone difference between your system and HubSpot.

 

HubSpot stores timestamps in UTC, while your system may be sending dates in your local time zone, causing a one-day difference when converted to UTC.

 

To avoid this issue, you can simply omit the Close Date when creating or updating a Deal via the API. HubSpot will automatically set the Close Date to the current UTC date and time when the Deal reaches a specific stage, such as "Funded", which is configured to mark it as closed-won.

 

This approach streamlines your integration and eliminates potential time zone-related problems.

 

Also,

Simplify your approach by utilizing HubSpot's automatic Close Date feature, which updates the Close Date based on the closed-won stage.

By leveraging this feature, you can avoid the complexity of time zone adjustments in your code and let HubSpot handle the date management seamlessly.

 

Hope this helps - Happy to help further!!
Thank you very much and have a great one!
Warm regards

Humashankar VJ
HubSpot Community Champion and enthusiast | Engineering Manager
tjsimpson
Participante

Deal Close Date 1 Day Behind Integration API

@Humashankar  thank you for your response!

I have just made the change to remove 'Close date' from my integration and assume this will fix the issue. I had to do the same thing with 'Create date' a while back now that I am looking through my notes.

 

Unfortunately, the removal of 'Create date' has caused consistent issues. Sometimes the integration fails and then when records are uploaded the 'Create date' is of course not correct and require manual adjustment. It would be great to get to the bottom of this so I can reintroduce that feature.

 

I am in the US Eastern Time Zone (EST) which is 4 hour behind UTC. Regardless it is weird that time comes into play in a date field anyways where only year, month, and day are accepted. I am curious if anyone has seen this issue.