APIs & Integrations

tallior
Participant

Update contacts

Hi there,

I'm trying to sync with our eCommerce process (WooCommerce) and our free Hubspot account. I have 2 questions-

1. We need to update contacts and I don't see an example of php code for updates - http://prntscr.com/pe8p55 Do you have some example to share with me?

2. The second question is about custom fields for contacts: We need to update for each contact product name, quantity, and date. How I can create custom fields for contacts in an account and use these custom fields for API requests?

0 Upvotes
5 Replies 5
WendyGoh
HubSpot Employee
HubSpot Employee

Update contacts

Hi @tallior,

 

Let's walk through your question one by one here:

 

1. When looking to update contacts using PHP, you can check out this PHP wrapper: https://github.com/ryanwinchester/hubspot-php and the following forum that discussed on this similar topic:

https://community.hubspot.com/t5/APIs-Integrations/Update-contact-batch/td-p/237134

https://community.hubspot.com/t5/APIs-Integrations/Unable-to-update-contact-property-using-PHP/td-p/...

 

2. You can create custom properties either within your HubSpot portal by following through this useful documentation: Create custom properties or using this endpoint: Create a contact property API.

 

Custom properties are being referred on API requests using their internal name.

 

tallior
Participant

Update contacts

it helped yes. but the category is still called "Lead" while it should be changed to "online purchase". is it possible to change the category filled? how? 

 

many thanks! 

Tal

0 Upvotes
WendyGoh
HubSpot Employee
HubSpot Employee

Update contacts

Hi @tallior,

 

Where are you seeing the category? Is that from a custom property? If so, can you share with me the custom property name and the portal ID in question?

0 Upvotes
tallior
Participant

Update contacts

Hey,  I'm referring to the Lifecycle, under "Contacts" - instead of being registered as a "lead", i need to change it to be "online purchase"

 

can i change the lifecycle name so that visitors that started the purchase process on our website will be listed differently then a lead?

 

plus - i didn't see that a deal was listed in the contact's card. why is that and how can i make sure that for every purchase online a deal will be recognized? 

 

many thanks!!!

0 Upvotes
WendyGoh
HubSpot Employee
HubSpot Employee

Update contacts

Hey @tallior,

 

Thanks for the further clarification. Currently the default HubSpot lifecycle stage property is non editable. That said, you can follow through this forum post: HubSpot Community - Quick Tip: How to create a custom Lifecycle Stage to create your own custom lifecycle stage. 

 

To your second question, when looking to associate a deal to a contact, you can check out the CRM associations endpoint; where you can use this endpoint: Associate CRM objects and set the definitionId to 3 (deal to contact) or 4 (contact to deal). 

0 Upvotes