Problem updating or deleting contacts using Ecom Bridge API


#1

Using the Ecom Bridge API, we've tried to send sync messages to update and delete contacts but don't manage to get it right. When we sent a call to update the contact's email address, a new contact was created with the new email address. This happened even though we referenced the same integratorObjectId. The same happened when we sent a call with the delete action. Now we have four different contacts with the same integratorObjectId:
https://app.hubspot.com/contacts/4943257/contact/801/
https://app.hubspot.com/contacts/4943257/contact/851/
https://app.hubspot.com/contacts/4943257/contact/901/
https://app.hubspot.com/contacts/4943257/contact/1001/

The calls look like this:
UPDATE
[{"integratorObjectId":"LSC100092","action":"UPSERT","changeOccurredTimestamp":1541068310242,"propertyNameToValues":{"id":"LSC100092","email":"wewgggggggg2@istone.com","firstname":"Test121","lastname":"Test2","phone":"","customertemplate":"B2CPersonTemplate","address1":"A1","zipcode":"50124","city":"Bor","country":""}}]

DELETE
[{"integratorObjectId":"LSC100092","action":"DELETE","changeOccurredTimestamp":1541068653748,"propertyNameToValues":{}}]

Doing this for other objects, for example products, works fine.


#2

@Isaac_Takushi do you have any input? Very thankful for any guidance! :pray:


#4

Hey, @shamash

Your question was actually at the top of my to-do list!

I've been having issues upserting contacts in my own test account, so I believe I'll have to dig in further. Apologies for the inconvenience here.


#5

Great, thank you! I need to get back to our client tomorrow with some kind of response on how to deal with this so any help or suggestions on workarounds are highly appreciated. Thanks again


#6

Hey, @shamash,

Apologies. Something on our side seems to be preventing email property values from being updated with UPSERT sync message (other contact properties like lastname are successfully updated, though).

Additionally, I have yet to successfully delete a contact with a DELETE sync message.

I'm sharing all the tests I've done with the team and hopefully we'll have a resolution for you soon. I don't know of any workarounds at this time.


#7

Thanks for the update @Isaac_Takushi

That confirms our experiences.


#9

Hi @shamash,

I spoke with @Llewellyn_Smith, who confirmed that neither of the actions you're attempting are possible:

  • The email contact property is exempted from UPSERT actions.
  • Contacts cannot be deleted through DELETE sync messages.

The Ecommerce Bridge API's contact model is more conservative than the Contacts API to avoid the deleting or overwriting of crucial contact information that existed prior to an ecommerce application syncing to a given contact.

If you need to do either of these actions, you must use the Contacts API methods below, which rely on vid, rather than Ecommerce Bridge sync messages:

I will be the first to admit that our existing Ecommerce Bridge documentation is grossly misleading in this regard. I will immediately look into having the articles updated.

Sincere apologies for the inconvenience and confusion. Please let me know if I can clarify further.


#10

Ok, @Isaac_Takushi and @Llewellyn_Smith thank you for clarifying. However, we don't see the reason why the bridge api should be restricted that way. The only effect is that we need to use the Contacts API and we can still delete or overwrite crucial information..?

That said, now that we've switched to the Contacts API, the hs_assoc__contact_ids can't be populated with an external id since the contacts are created "outside" the bridge... So we can't associate our deals with contacts - which is crucial. How should we do this?

We're lost and way behind schedule now. So.. quick replies are appreciated.


#11

Hi @Isaac_Takushi,

So, using the ecom bridge, we would reference the external ID to identify the contact in HubSpot. But if a contact's email address is changed or if the contact is deleted from the ecom system we can't use the bridge's sync message endpoint because it doesn't allow these actions. So we need to use the Contacts API for these events, by referencing the contact's vid.

What is your recommendation here? That contacts should be created using the bridge but updated and deleted using the contacts api? If so, do we need to store the external ID in Hubspot and the vid in the external system? It doesn't seem like a very solid solution so I'm guessing we're not understanding this fully. Guidance, please.

And again, how do we associate contacts with deals if we're not using the bridge to handle contacts?

Thank you


#12

Hey, @shamash.

I appreciate your patience while I was out of office over the Thanksgiving holiday.

While I still wish to confirm with Llewellyn, I believe best practice is to do everything you can through the Ecommerce Bridge. As you note, creating contacts through sync messages allows you to leverage external IDs to associate deals without involving the CRM Associations API.

If you need to update a contact's email address or delete a record, however, you must use the Contacts API at this time. As I currently understand it, you wouldn't need to store the external ID in HubSpot since the Ecommerce Bridge handles the external ID-to-vid lookup, but you may wish to store a contact's vid in your system if you aren't interested in querying this or similar endpoints every time you need to retrieve a contact's vid to update its email or delete it via the Contacts API.


#13

Hey, @shamash.

I confirmed everything above with Llewellyn!

Regarding your first question, there are two main reasons why the Ecommerce Bridge's contacts model is more limited than the Contacts API:

  1. The team did not wish to replicate the CRM's contacts logic for sync messages; it would necessitate supporting many more complicated situations including merging contacts and changing email identities.
  2. The current model meets the needs of most ecommerce integrators, who generally make fewer changes to their customers' data than other types of integrators, such as CRMs. The team currently views the guardrail making data that existed prior to any integration more difficult to mutate as appropriate.

I understand your use case may not fit the mold we've designed the current Bridge around, however. If you would like to see email editing and contact record deletion support added, please posting your request on the HubSpot Community Ideas Forum and share it here. I will be happy to upvote it.


#14

Thanks @Isaac_Takushi,

I understand. So we've done some changes, using the bridge as far as possible and relying on the Contacts API to edit emails or deleting contacts. We just ran into an issue trying to create a contact using the bridge. We ran the following JSON request:

[{"integratorObjectId":"LSC100137","action":"UPSERT","changeOccurredTimestamp":1543409170601,"propertyNameToValues":{"id":"LSC100137","email":"sddgs78632874g@istone.com","firstname":"nvbhhgfh","lastname":"fghfghfgh","phone":"","customertemplate":"B2CPersonTemplate"}}]

It gave us a successful response (204 No Content) from the bridge and no sync errors using the sync-status endpoint: https://api.hubapi.com/extensions/ecomm/v1/sync-status/CONTACT/LSC100137?hapikey=[HAPIKEY]

But no contact was created... Any ideas?


#15

Hey, @shamash.

I sent a similar sync message to my own account:

[
  {
    "integratorObjectId": "LSC100137",
    "action": "UPSERT",
    "changeOccurredTimestamp": 1543590051000,
    "propertyNameToValues": {
      "firstname": "nvbhhgfh",
      "lastname":"fghfghfgh",
      "email": "sddgs78632874g@istone.com"
    }
  }
]

And it also failed to create a contact.

I ran the email sddgs78632874g@istone.com through our system's email validator and it failed a third-party vendor's check (StrikeIron, which I describe in this post).

To my knowledge, this check occurs after the sync message is received but before the process which actually creates contact records executes. That's why the Ecommerce Bridge call returned a 204.

After running more tests, the issue seems to be that StrikeIron doesn't trust istone.com is a legitimate domain. I'll reach out to the team to see if we can close the loop with the vendor on this, but I unfortunately can't guarantee an outcome here, since their list is outside of our team's control.


#17

Hey, @shamash.

Alright, I can ask the team to whitelist the istone.com domain (not guaranteed), but I will need some evidence that there are legitimate, active inboxes on that domain to bring it up.

sddgs78632874g@istone.com seems like a test address. Do you (or your client, if that's who you're working with) have screenshots of emails received from an istone.com address? I'll need at least one of these to start the conversation.

If you have one, let me know and we'll open a direct message so that the email isn't exposed.

Appreciate your understanding!