Reading submitted form data using PHP


We are trying to incorporate purchase data with hubspot. We already have a full cart, back end, front end and administration system. We need to know that this contact purchased this item on this date. I am going to make a simple form with fields something like “service name, quantity, currency, purchase date.” Then when they check out, loop through the cart and submit to this hubspot form for each item in the cart.

The catch is that if our sales staff marks this item as unavailable, or the customer cancels it, we need to programmatically get that update into the hubspot data, but I need to know if it has been updated already. So I need to get data from hubspot about an item, check if it matches our data, and if not update it.

We are not replacing our cart, and this data will be strictly managed from our own systems. We want to get data into hubspot for marketing purposes but will not be using any kind of integration or outside product to handle our cart. I can get the forms submitted by a hubspot contact, I can get the fields in that form, but I cannot get the data the form contains.

Thoughts on how this would work?



Hi @Nick_Du_Bois,

If I understand you correctly I think what you are looking for contact properties. When a form is submitted, values in that form feed directly into contact properties.
form field === contact property

You can get the value of a property for a contact by using any of the three endpoints documented below:

All of them support the property parameter which allows you to ensure the response includes the property you care about checking. You can include the property parameter multiple times if you are interested in checking multiple properties at a time.



Ah yes! That was sort of what I was looking to do. That makes sense too. The only issue I see with this is that if they fill out the same form twice, the old data is over-written which will break what I am trying to do.

I need to track all form submissions. I think more and more, that this isn’t going to work the way I want it to.

Thanks for the reply!