Skip to content
Stripe

Parsing Stripe Metadata the Easy Way in HubSpot

If you're using saas•hapily to sync your Stripe account to HubSpot, you may want to parse your metadata for your subscriptions. I'll hapily show you how.

So you’re using saas•hapily to sync your Stripe account to your HubSpot account. You have chosen wisely! But say you’re using metadata to keep track of some additional information on your subscriptions. How does saas•hapily handle that?

It syncs it over into a subscription property called Subscription Metadata. Typically in the format of {“Key”:”Value”}.

 


Well that’s all fine and good, but how can this metadata be utilized now that it’s in your HubSpot? How do you parse the information from these key value pairs? The same way you get most other things done in HubSpot! That’s right. It’s workflow time!


How do you parse Stripe metedata?


To give you an example, let’s take a hypothetical scenario. On each subscription, you have a metadata key called Subscriptiontier that can be set to Regular or VIP. Useful information right? It lets you know if you need to go the extra mile for your customer. So how can we reflect that in HubSpot?

We can create a workflow that updates a property in that customer’s contact record based on that key value pair. For the purposes of this example, I created a custom contact property called Type to update.

1. Start by creating a contact based workflow.

2. Set the enrollment trigger to saas•hapily Subscription Metadata contains any of {“Subscriptiontier”:”VIP”} OR saas•hapily Subscription Metadata contains any of {“Subscriptiontier”:”Regular”}.

Make sure you include those curly braces and quotation marks. Your workflow will need them. Also make sure to turn re-enrollment on in case any updates are made to the metadata

Parsing Stripe Data in HubSpot

 


3. Click the “+” button beneath the enrollment trigger and select the If/then branch action.

4. Name the first branch VIP and set the filter to saas•hapily Subscription is equal to any of {“Subscriptiontier”:”VIP”}.

Parsing Stripe Data in HubSpot workflow



5. Add another branch and name it Regular and set the filter to saas•hapily Subscription is equal to any of {“Subscriptiontier”:”Regular”}.

Parsing Stripe Data in HubSpot Workflow If/then branch


6. Click the “+” button on the VIP branch and select the Set property value action.

7. Set the Target object to Contact. This will update the property within the contact going through this workflow.

8. Under Property to set, select Type.

9. Under the Type property field, type in VIP and click Save.

Parsing Stripe Data in HubSpot Set Property Value



10. Repeat steps 6-8 for the regular branch but have the Set property action set the Type property to Regular.

Parsing Stripe Data in HubSpot Set Property Value



11. Click Save and you’re done!


This method is great for when you need to identify things like subscription types or tiers. Create as many workflows as you like!

But what if you need to parse something a bit more specific than that? Perhaps you have a unique ID for each subscription in your metadata. Are you supposed to create an individual workflow for every single one of them?

Unless you’re immortal, The Flash, or immortal and The Flash, this probably isn’t going to work for you. But if you’re willing to get your hands dirty with some custom code, there’s a pretty quick workaround!


How do you parse Stripe metadata with custom code?


What you’ll essentially be doing, is creating a workflow that separates the key value pairs in the
Subscription metadata property for each subscription into two separate properties! This will allow you to access them a little more easily. And to do this, you’ll need to utilize some custom coding.

Custom coding. If you’re not a programmer, that might sound a little scary. Fortunately you don’t need to be a computer science wiz to get this done. Jonathan Stevens wrote a great blog post to teach you! He’ll walk you through each step of the process. Check it out here.

Isn’t that better?

Want to see what else the app can do? Check out this blog post on Calculating Net MRR With Custom Equations!

David Staat

David Staat

Helping users HubSpot hapily!

Latest Articles

Simplifying Tax Breakdown for Subscription Services Quotes

Simplifying Tax Breakdown for Subscription Services Quotes

Learn the benefits of providing efficient tax breakdowns in quotes for subscription services. Enhance customer satisfaction and streamline ...

Organize Your SaaS Business: Managing Multiple Stripe Accounts

Organize Your SaaS Business: Managing Multiple Stripe Accounts

Discover why managing multiple Stripe accounts can help SaaS companies organize different services more effectively. Learn how this strateg...

Why Offering Multiple Payment Options Boosts Your Business

Why Offering Multiple Payment Options Boosts Your Business

Learn about different payment methods, their benefits, and how they can expand your customer base. Explore insights on increasing conversio...