Tips, Tricks & Best Practices

MSchallinger
Participant

Automatic Product Price Update for Multiple Currencies

SOLVE

Hi all,

 

Wondering if anybody has found a way to use a workflow to update multiple currencies on products. Basically to use the base price/currency and then re-calculate the additional currencies based on the exchange rate set in the HubSpot currency settings. 

 

Of course this can be done via bulk export, update, import (great guide here) but that's manual and a bit of a pain. 

 

Cheers,

Mike

0 Upvotes
2 Accepted solutions
HubDoPete
Solution
Guide | Gold Partner
Guide | Gold Partner

Automatic Product Price Update for Multiple Currencies

SOLVE

Thanks Mike 🙂

 

Mike I've set this up in multiple portals using custom coded actions in an Ops Hub HubSpot workflow:

1. There are no product-based workflows so create a Company-based workflow, scheduled to run daily for a single company object.

2. Create one action to read each HubSpot Currency rate via the API (install DoCurrencies free if you need HubSpot rates auto-updated daily)

2. Create one action to take the above rates(s) and loop through all products in batches of 100 at a time, updating all selling prices via API. If not updating every product, segment products using the search API.

 

note: if updating more than 3.000 products, replicate the update action to handle subsets of products using the search API, as each workflow action must complete in under 20secs.

Also be sure to handle rate limiting, as the search API cannot exceed 4 calls per second.


Let me know if you need a hand to set this up.

best

Pete

 

View solution in original post

HubDoPete
Solution
Guide | Gold Partner
Guide | Gold Partner

Automatic Product Price Update for Multiple Currencies

SOLVE

Hi all, I have received a few private messages from people asking for more details about my custom code comments above and the possible use cases. 

 

We often custom-code workflows for customers, related to products and prices including currency rates. Normally the customer installs our free DoCurrencies app, which keeps all HubSpot currencies updated daily.

 

Then using custom-coded workflows in Ops Hub, we write workflow actions to read HubSpot currency rates and then use them in later actions.

 

The later actions are typically use cases like:

  • For all the products that I buy in USD, update the CAD selling price based on the current USD/CAD rate
  • For all products that are in stock (not yet sold), update the USD and GBP selling price based on the EUR price

In some cases customers need us to update the exchange rate in deals, for example:

  • For all our historic closed-won deals, update the correct exchange rate that applied on the date the deal was closed-won (that's a one-time data cleanup)
  • or, Every day, update all non-USD closed-won deals that are recurring revenue, with the current exchange rate from deal currency to USD, so our MRR is valid.

Some of the complex areas that need special attention when custom coding:

  • Deal-based workflows can handle deal-by-deal updates,
  • but updating products requires code that loops through all records in < 20 seconds, as HubSpot has no product-based workflows.
  • You also must not exceed HubSpot's rate limits on each API, as you have to handle back-off and retries, which also adds delay that can exceed 20 seconds.

Hopefully, that spurs on ideas for others, to deliver even more value from Operations Hub.

best

Pete

View solution in original post

0 Upvotes
4 Replies 4
HubDoPete
Solution
Guide | Gold Partner
Guide | Gold Partner

Automatic Product Price Update for Multiple Currencies

SOLVE

Thanks Mike 🙂

 

Mike I've set this up in multiple portals using custom coded actions in an Ops Hub HubSpot workflow:

1. There are no product-based workflows so create a Company-based workflow, scheduled to run daily for a single company object.

2. Create one action to read each HubSpot Currency rate via the API (install DoCurrencies free if you need HubSpot rates auto-updated daily)

2. Create one action to take the above rates(s) and loop through all products in batches of 100 at a time, updating all selling prices via API. If not updating every product, segment products using the search API.

 

note: if updating more than 3.000 products, replicate the update action to handle subsets of products using the search API, as each workflow action must complete in under 20secs.

Also be sure to handle rate limiting, as the search API cannot exceed 4 calls per second.


Let me know if you need a hand to set this up.

best

Pete

 

HubDoPete
Solution
Guide | Gold Partner
Guide | Gold Partner

Automatic Product Price Update for Multiple Currencies

SOLVE

Hi all, I have received a few private messages from people asking for more details about my custom code comments above and the possible use cases. 

 

We often custom-code workflows for customers, related to products and prices including currency rates. Normally the customer installs our free DoCurrencies app, which keeps all HubSpot currencies updated daily.

 

Then using custom-coded workflows in Ops Hub, we write workflow actions to read HubSpot currency rates and then use them in later actions.

 

The later actions are typically use cases like:

  • For all the products that I buy in USD, update the CAD selling price based on the current USD/CAD rate
  • For all products that are in stock (not yet sold), update the USD and GBP selling price based on the EUR price

In some cases customers need us to update the exchange rate in deals, for example:

  • For all our historic closed-won deals, update the correct exchange rate that applied on the date the deal was closed-won (that's a one-time data cleanup)
  • or, Every day, update all non-USD closed-won deals that are recurring revenue, with the current exchange rate from deal currency to USD, so our MRR is valid.

Some of the complex areas that need special attention when custom coding:

  • Deal-based workflows can handle deal-by-deal updates,
  • but updating products requires code that loops through all records in < 20 seconds, as HubSpot has no product-based workflows.
  • You also must not exceed HubSpot's rate limits on each API, as you have to handle back-off and retries, which also adds delay that can exceed 20 seconds.

Hopefully, that spurs on ideas for others, to deliver even more value from Operations Hub.

best

Pete

0 Upvotes
MSchallinger
Participant

Automatic Product Price Update for Multiple Currencies

SOLVE

Thank you Mike and Pete!

 

Pete, custom code is not in my skillset, I'll see if our implementation partners can help as we're currently still implementing, but will reach out if not. 

 

Thank you! 

Mike_Eastwood
Key Advisor | Gold Partner
Key Advisor | Gold Partner

Automatic Product Price Update for Multiple Currencies

SOLVE

Hi @MSchallinger 

 

I recommend you talk to @HubDoPete at https://www.hubdo.com he's the expert!

 

Have fun

Mike

 

Here to learn more about HubSpot and share my HubSpot Knowledge. I'm the founder of Webalite a Gold HubSpot Partner Agency based in Wellington, New Zealand and the founder of Portal-iQ the world's first automated HubSpot Portal Audit that helps you work smarter with HubSpot.