HubSpot - Plug In or API Calls?

What is the best practice for extracting Product purchases from HubSpot? We’ve set up a few Products, as “Credits” for Users and we have Fields in our User Table which need to be incremented when they are purchased. Basically, we need to capture the Product Name, Quantity, Date Purchased and the Customer Email.

Why plugin?
I don’t see any reason to use a plugin when this can be done with API Connector…

So are you saying the Best Practice is to use an API Connector? I tried that and it led to having to create multiple calls between Bubble and HubSpot to GET a multitude of ID’s for various elements, to try to piece together the 4 Fields I needed and it did not seem very elegant - hence my question.

Maybe your settings in API Connector is not correct? Hard to know.

This is why I was asking why do you think a plugin is better?

But pretty sure it can be done with API Connector… And maybe doing 4 call is what you need to do… but in this case, this will not be different in a plugin…

It would be helpful if someone who has achieved something similar could provide those API calls Steps.

I’m bringing up this post in the hope that someone can assist in the formulation of either API Calls or Private / Connected Apps in HubSpot to extract a product and quantity purchase for a Customer, into the Bubble Data Table Structure.

Start first by doing simple call in Hubspot with API connector to understand how it work. For example

you will need to first create a private app to get the private access token. (I understand that you want to connect your own hubspot account only.)

I appreciate you comments but I am looking for guidance from someone who has successfully achieved the goal I have described. Thanks

This is your goal. Start from what other did and create your own solution. Because hubspot allow customization, there’s no specific answer to give. I suggest you to start first by doing API call. GET request are easy. If you are able to do that first, continue with call to update your user fields.

Something that can you understand how it work is to check free hubspot plugin code
Example: Bubble Plugin Editor - HubSpot

When you are able to use the hubspot API, post a screenshot of your settings and what you tried. It will be easier to help you.

I appreciate your comments but they were not helpful.

I have fully investigated and here is the solution, should anyone find the need:

  1. Create a Webhook in Stripe, to Bubble, whenever there is a checkout.session.completed
  2. Create a backend Workflow in Bubble, to capture the checkout.session.completed payload from Stripe.
  3. In the same Bubble backend Workflow, create a Step to fire off an API Call to Stripe, using the data>object>id from the checkout.session.completed
  4. Create another Step in the Bubble backend Workflow and use the data values from the Previous Step to extract the Product, Quantity, CustomerID and Date of Purchase.
  5. Add any subsequent Steps in your workflow to insert those Values anywhere you need to within Bubble. I am using a Table called “Stripe Transactions” with Fields that hold these details, as an audit trail of credit purchases and other processes.

If anyone gets stuck on this - give me a shout - it was a nightmare! :slight_smile:

1 Like

Stripe or hubspot?..

Maybe rename your post?