The Innovative Marketer's Blog

HubSpot API Enables Coupon Solution for B2B e-Commerce

Posted by Kevin Jorgensen on Aug 5, 2015 8:32:52 AM

Inbound marketing can create the kind of great online shopping experience that builds lasting satisfied customer relationships, but there are some current challenges to using the best tools, like HubSpot, to create an inbound-style online shopping experience. Great online shopping solutions seem to anticipate your needs and have the facilities and information to take the next step toward purchase just a click away when you need them. HubSpot doesn’t offfer a Business-to-business shopping cart solution that provides necessary functionality for B2B e-commerce:

1)      Secure shopping cart for credit cards, request for quotes and purchase orders

2)      Scalable, responsive e-catalog that handles complex, configurable products

3)      Order fulfillment integrated with enterprise ERP systems like SAP

4)      Inbound marketing lead nurturing for abandoned carts, upselling and cross-selling

5)      Top-of the-funnel offers like coupons designed around business customers


I've discussed the unique requirements of a B2B e-commerce solution in a previous blog post which you will find here and these were exactly the kind of challenges that Endress + Hauser, a global manufacturer of precision sensors and measurement equipment for process automation, faced while preparing to launch a HubSpot marketing solution to grow its online business ( Working with our inbound marketing agency, Innovative Marketing Resources*, Endress + Hauser wanted to create a business-to-business e-commerce solution with an inbound marketing customer experience to meet these challenges:

1)      Seamless integration with HubSpot analytics, lead nurturing and workflows

2)      A scalable, mobile-friendly, responsive catalog

3)      Secure, SSL credit card processing and flexible purchase order transactions

4)      Order fulfillment through the SAP corporate ERP system

5)      Coupon solution built around HubSpot’s inbound marketing best practices

The result of our work together was commercial software integration between HubSpot and a cloud-based B2B e-commerce back-end that can be re-used for other clients and offers all the modern functionality, security and analytic data to attract, educate, specify and transact business for complex B2B products.

To describe every aspect of the integration between a modern B2B e-commerce back end and HubSpot is beyond the scope of this article. Instead, I’ll focus on one unique feature of the solution we created for Endress + Hauser, couponing, to show how HubSpot, integrated with a capable e-commerce back end, can help marketers create top-of-the-funnel e-commerce offers to stimulate business and encourage repeat purchases through cross-selling and upselling in a way consistent with inbound marketing best practices.

Requirements for Couponing

Coupons are a proven way to encourage new prospective customers to engage and to stimulate repeat business. The concept of a coupon is simple, however, once you consider all the requirements for promotion, redemption, security and analysis, the simple coupon requires complex real-time communication between various different pieces of software and the customer.

If coupon analytics are gathered and tracked, information about coupon use can be used to profile customer preferences, which enables further personalize the shopping experience and facilitates cross-selling and upselling without being disruptive. However, to create a sense of urgency around coupon use and to prevent abuse of coupons that decrease sales margin on the store, it’s important for coupon use to be restricted and tracked without making redemption difficult.

As a result, coupons require tight integration between the shopping cart where they are redeemed and the marketing front-end of an e-commerce web store where they are promoted and assigned to prospective and current customers.

For our integration with Endress + Hauser, we wanted to create a coupon solution that operated in the context of other customer engagement campaigns conducted using HubSpot (e.g., promoting a discount on purchases of liquid measuring devices to customers who purchased liquid control valves), but at the same time, make the redemption easy and in-line with the standard checkout process for either credit cards or purchase orders. These requirements set up the need for particular real-time communication and integration between a website built using HubSpot COS HTTP web assets and a secure HTTPS, SSL compliant catalog, shopping cart and customer management dashboard.

Working with the HubSpot API – Which Ones?

To create real-time communication between HubSpot and other software requires the use of the HubSpot Application Programming Interface (API). There are many different APIs available from HubSpot. Each has its own particular function. While the creation of a complete inbound marketing driven e-commerce solution requires many of the HubSpot APIs, for the purpose of implementing a coupon function we used the Workflow, Forms and Contacts APIs. Using these three APIs together enabled the bi-directional integration necessary to create a seamless, real-time customer experience between the shopping cart and HubSpot.

The HubSpot API is uniquely keyed to each HubSpot instance. Using the HubSpot API key for a particular portal allows our  e-commerce solution to be used with multiple HubSpot clients simultaneously without the possibility that data from one client will end up in another client’s HubSpot portal. In this way our agency can use its e-commerce application to implement B2B e-commerce securely for multiple clients using HubSpot. 

Creating the Coupon

The coupon is a great top-of-the-funnel (TOFU) offer. The prospect gets something for nothing and because the coupon only requires an email address for delivery, can be specific to a particular product and is low risk, it presents a great way to stimulate activity at the top of the funnel and measure results.

But before we can deploy a coupon in the HubSpot COS, the secure shopping cart must know what coupon information HubSpot will be attaching to a contact record. So the first step in creating a coupon is to build the coupon template in the shopping cart admin.


In the above screen shot from the Endress + Hauser shopping cart administrator, you can see how a coupon template is defined and given a name. In the example we have created a coupon for a % discount on a product purchase. So we have named the specific product for which a discount will be given.

In the example, we are offering a 10% discount on the purchase of a Liquiphant T FTL20. We could have created coupons for entire categories or for all items in a shopping cart. These other discounting strategies, particularly the discount on the cart contents, are great ways to begin using coupons to stimulate demand where the product discounts tend to be most effective at driving cross or up sales. We also have the ability to define use as single or multiple use for each coupon template. By using the start and expired dates we can associate coupons with campaigns we are running and schedule campaigns with events like trade shows without having to manually deactivate coupons before or after the event date. Once a template is created, it may be used within the HubSpot COS to create the virtual coupons. 

In the context of the HubSpot inbound marketing platform, the Call-to-Action seemed to be the element most closely related to a 'brick and mortar' coupon. Using the CTA and HubSpot form enables the coupon to be graphical, clickable, trackable and edited easily within HubSpot. It is also flexible with regard to where it can be used on web properties.

In true inbound marketing style, we linked the coupon-CTA to a HubSpot form. A sample coupon form is shown below. The form includes the most basic information necessary to deliver a coupon to the prospect, email address. We tested whether, in the case of B2B e-commerce, first and last name significantly reduced form submission and found that it did not. We included these fields so that we could personalize follow-up marketing to the coupon recipient but made the fields smart so that on future coupon requests, only email is needed. However, it’s likely that in a B2C e-commerce situation, requesting anything more than email will negatively impact participation rates.)


You can see on the form we also include, as hidden fields, the aspects of the coupon that define the value and expiration dates. The combination of the CTA and form enable the marketer to define a coupon and place it where-ever they choose on a web property. When the coupon is requested, all the necessary properties except a unique identification code are loaded into the contact properties for the user who requested the coupon.

So here you can see the need for integration with the secure shopping cart back end. Because the unique identification number (coupon code) must be paired with the expiration date and value set by the marketer and the prospect ID so that this unique combination can be recognized at checkout, the shopping cart must record the information captured on the HubSpot form, create the unique identification and load this information into its database for retrieval when the coupon code is entered and then push the coupon code back to the HubSpot contact record so that it can be included in emails and promotions using the coupon.

Promoting the Coupon

Once a coupon has been requested by the user or once a list of users has been issued a coupon, the contact record will have data similar to this added:


You can see how this information can be used to create additional segmentation of the user population. One simple segmentation is based on whether or not the coupon has been redeemed and when the coupon will expire. You can imagine an email reminder campaign whether the user who has the coupon receives an email reminding them that their coupon for 10% off their next purchase expires in two days. You can also imagine an email campaign that triggers on the presence of the redeemed date, and sends another coupon to stimulate repeat purchases from good customers or simply thanks the customer for using their coupon. In HubSpot we use lists to create these segmentations. One sample list from a 10% discount promotion is shown below. 


These various upsell and cross-sell campaigns can be implemented easily within HubSpot using workflows. The couponing solution uses the work flow API to create workflows that trigger on coupon issue and on coupon redemption. The shell workflows look like this:


The marketer can add various actions such as email notices, including the personalization information created by the coupon application in each contact record (a sample of which is shown below), to create customized upsell and cross-sell campaigns for each coupon.


Analyzing Coupon Use

In addition to using the standard HubSpot analytics tools to track form and CTA performance, the e-commerce back end has a comprehensive analytics package to monitor coupon performance, manage orders and track user behavior. The screen shot below shows a page from the coupon administrator dashboard in the e-commerce back end. 


Using this data in combination with HubSpot analytics data, it’s possible to answer questions such as whether or not single or multi-use coupons are more effective, how level of discount impacts redemption rates, or whether product-level or cart-level discounts are more effective at stimulating increased revenues.

Download the 10 things that make B2B ecommerce different than B2C


The HubSpot API enables real-time, seamless integration of a cloud-based, SSL-compliant back end to process transactions, manage sensitive customer information and fulfill orders with using integration to corporate ERP systems like SAP. 

This level of integration enabled Endress + Hauser to create a scalable, maintainable, mobile-friendly online business for complex products and fulfillment processes. The couponing feature addresses the problem of stimulating demand as organic reputation builds with e-commerce oriented top-of-the-funnel offers and enables directed cross and up-selling campaigns to expand customer engagement without being disruptive. By implementing coupons as HubSpot CTAs and forms, all the benefits of HubSpot's marketing automation platform are retained, making coupons a natural part of a larger inbound marketing program 


*Innovative Marketing Resources was a subcontractor to ThomasNet for this project. The resulting HubSpot  integration and e-commerce solution can be purchased through Innovative Marketing Resources.


Topics: B2B Sales and Marketing