APIs & Integrations

Gemma
Member

Ecommerce Bridge Sync Messages - how to ensure reliability

Since Sync Messages in the Ecommerce Bridge API is asynchronous, we are expected to query Sync Errors periodically to find out if anything failed.

However, it is not sufficient to assume everything succeeds unless told otherwise; there could be some other issue that prevents the error message from ever getting to the sync errors response object. At minimum there needs to be a way to determine if a request completed. Perhaps a transaction id associated with the syncs that we could check.

Are there any suggested work-arounds to providing more accurate or real-time data?

I did notice in the Ecommerce Bridge docs that

The Ecommerce Bridge will also be adding performance and reliability monitoring to this process as well as giving customers troubleshooting capabilities for sync issues.

Any insight on to what these changes will be and when they will be released?

In the meantime, one thing we considered was the Webhooks API, but it is not clear if this would even work. From the webhook payload, we could use hubspot's internal objectId to look up which sync message to mark as complete. This means, we would have to include the objectId in our original sync message, so that the webhook will fire with one that we recognize. But in order to do that, we would have to, say, create a Deal from the Deals API first so we can get the objectId (dealId), and then include it in Ecom Bridge sync message api along with our own integratorObjectId. Based on this line in the documentation, it looks like a duplicate deal would be created due to the inclusion of our integratorObjectId "If the Ecommerce Bridge API sees a new integratorObjectId it will create a new object in HubSpot". Is there a way to, say, create a Deal from the Deals API and then reference that same deal in an Ecom Bridge sync message api? Would this use of the Webhooks API be a recommended pairing with the Ecommerce Bridge API? If so, do the webhooks fire for both complete updates and errors? There are a bunch of other concerns with this approach as well, and it would only theoretically work for Contacts and Deals at the moment, not Products or Line Items. So, really hoping for other advice! Thank you!

0 Upvotes
2 Replies 2
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

Ecommerce Bridge Sync Messages - how to ensure reliability

Hi @Gemma,

Apologies for the delay here: You're correct that it's not technically possible to guarantee success; only to know that there was no failure. In general the sync is very stable, but I completely understand the distinction between "seeing failures" and "confirming success" and see your use case.

This design pattern (checking the status of asynchronous tasks) isn't currently implemented in the Ecommerce Bridge API, and it's not something that HubSpot does in other APIs either. It's certainly something the team is thinking about going forward; this topic has been used in a number of conversations among HubSpotters. That said, I don't have any specific information on this front. For the time being, I'm happy to continue pass this along internally, and I encourage you to post this idea in the Ideas Forum of the HubSpot Community.

0 Upvotes
sduane
HubSpot Product Team
HubSpot Product Team

Ecommerce Bridge Sync Messages - how to ensure reliability

@Gemma
There's a new endpoint available that will be documented/announced next week, but I wanted to let you know now since this may help.
This was built with the intention of helping someone set up their ecommbridge, and not to be used programmatically, but alas I cannot control how one chooses to use it.

/v1/sync-status/{objectType}/{integratorObjectId} will return, amongst other items, the hubspotId that is linked to that objectId.
If no hubspotId is present, then the object has either not been sync successfully, or has been deleted.
See the swagger docs at the bottom for more info http://petstore.swagger.io/?url=https://api.hubapi.com/api-catalog/v0/apis/extensions/v1/ecomm/#/def...

Let me know if this helps out, and expect the official update/docs next week.

0 Upvotes