1. Help
  2. HubSpot Integrations

HubSpot and SAP B1 Integration

This article discusses the best practices and process for setting up an integration between HubSpot and SAP Business One (SAP B1) using Operations Hub.

HubSpot is a comprehensive CRM that brings together marketing, sales, and customer service teams in one platform. SAP B1, on the other hand, is an Enterprise Resource Planning (ERP) software for small to medium-sized businesses. In this article, we will integrate SAP Business Partner to HubSpot Company, HubSpot Company to SAP Business Partner, and SAP Quote/Order to HubSpot Deals and custom objects. 

The article covers the following key topics: 

(Skip to the section of your choice, by clicking on it)

Pre-requisites

Following are the pre-requisites to perform this integration, successfully:

  • You should have admin access to the SAP Integration Framework and the HANA database.
  • You should also have access to your event monitoring system to monitor all the events recorded in SAP.

Workflow

The integration will be performed using HubSpot workflows and the SAP Integration Framework. The following image describes the overall structure of this integration:

  1. Establishing a two-way sync between SAP Business Partner and HubSpot Company.
  2. Establishing one-way sync from SAP Orders to HubSpot Orders.
  3. Establishing one-way sync from SAP Quotes to HubSpot Orders.

    SAP-B1-SAPtoHubSpot.drawio

SAP Business Partner to HubSpot Company

Following is the workflow for setting up the integration from SAP Business Partner to the HubSpot Company:

_Order to HubSpot Deal.drawio

The workflow checks if a new Business partner is created or Updated in SAP, then it triggers the SAP Integration Framework. It sends an API request to check the business partner in HubSpot.

If the business partner does not exist, it creates a new one. And, if it already exists, an API request is sent for its update. Lastly, both of them are associated with creating or updating contact in HubSpot.

Following are the steps for the integration of SAP Business Partner to HubSpot Company:

  1. Navigate to your SAP Integration Framework. Under the tab of SCENARIOS, select Setup.
  2. Click on the three dots under the Scenarios.
  3. Select the Entry from the dropdown and click on Select.

    integration of SAP
  4. Click on Step Design from the sidebar.
  5. You will be able to see the defined triggers of Inbound, Processing, and Outbound. The inbound trigger is set to be a B1 event that we’ll be listening through the SAP application. The Processing succeeds Inbound and the last one is Outbound.

    Inbound, Processing, and Outbound
  6. By clicking on Processing, you will be able to see the workflow followed for the processing.

    Processing
    1. We are getting the business partner using the SQL call and checking if the business partner already exists in HubSpot or not.
    2. If the business partner exists, we’ll update it.
    3. And, if the business partner doesn’t exist, we will create a new one.
    4. We’ll access all the contacts associated with the particular business partner.
    5. Lastly, we’ll create those contacts in HubSpot. 

  7. Navigate back to the SAP Integration Framework. Assign an ID and company domain for a business partner.
  8. Enter the Web Site for the business partner as well.

    SAP Integration Framework
  9. Navigate to the Contact Persons.
  10. Create a contact by adding Contact ID, First Name, Last Name, E-Mail, and additional details.
  11. Click on Add.

    Contact Persons
  12. Once you navigate back to your HubSpot account, you will be able to see that the company has been created under the company list.

    company
  13. If you open the company page, you can also see that the contact has been created and associated with it. This completes SAP Business Partner to HubSpot Company integration process.

    contact

HubSpot Company to SAP Business Partner

The workflow for establishing the integration from HubSpot Company to SAP Business Partner is as follows:

HubSpotSAPB1-Page-5.drawio-1

It’s a linear workflow. The HubSpot workflow is triggered upon creating or updating a Business Partner in SAP. From HubSpot workflow, the associated contact is fetched, and the request is sent to the integration framework.

Further, the integration framework is triggered that creates or updates the business partner and based on that creates or updates contacts as well. Lastly, the SAP Business Partner Id is sent back to HubSpot for the association.

Following are the steps for the integration of HubSpot Company to SAP Business Partner:

  1. Navigate to your HubSpot dashboard and click on Create company.

    Create company 
  2. Add the Company domain name and the Company name
  3. Click on Create company.

    Create company
  4. Open the company page, and change the Lifecycle stage to Opportunity.

    Lifecycle stage to Opportunity
  5. Following is the HubSpot workflow for the integration process:

    HubSpot workflow
  6. Click on Details.

    Details
  7. Under Active enrolled, you can see that there is one active enrolment.

    Active enrolled
  8. Navigate to your SAP Integration framework, and click on Business Partner Master Data.

    Business Partner Master Data
  9. Enter the Id of that particular company and you will be able to see that all the details are fetched automatically.

    fetched automatically.

SAP Quote/ Order to HubSpot Deal

The workflow for quotes and orders is the same and shown below:

 

SAP Quote/ Order to HubSpot Deal

The Integration Framework is triggered once the new order or quote is created in HubSpot. It sends the API request to HubSpot to check the deal. If the deal does not exist, a new one is created. However, if the deal exists, it’s updated, and the previously associated line items are deleted.

Afterwards, the API request is sent to create the line items. The line items are associated with the deal, triggering the HubSpot workflow that associates the company with the deal.

Following are the steps for the integration of SAP Order to HubSpot Deal:

  1. Navigate to your SAP dashboard and click on Sales Order from the sidebar.

    Sales Order
  2. Enter the details of the Sales Order as in the Name, Contact Person, Status, Posting Date, Delivery Date, and Document Date.
  3. Under the Contents tab, enter Item No., Quantity, Unit Price, Discount %, Tax Code, Total, and such.

    Contents tab
  4. Navigate to the Logistics
  5. Set the Shipping Type to LTL Hold.

    Shipping Type to LTL Hold
  6. Now, if you go into the HubSpot account, you will be able to see this deal under the Deals.

    Deals

 

Following are the steps for the integration of SAP Quote to HubSpot Deal:

  1. Navigate to the SAP dashboard and select Sales Quotation from the sidebar.
  2. Enter the Sales Quotation details as in the Name, Contact Person, Status, Posting Date, Valid (Url), Document Date, and such.
  3. Enter the details under the Contents tab, including Item No., Quantity, Unit Price, and more.

    Item No., Quantity, Unit Price, and more
  4. Select the Step Design from the sidebar.
  5. Choose the required entry. Click on Processing.

    Processing
  6. This is what the scenario design looks like:

    scenario design
    scenario design looks like 
    1. An SQL call is responsible for getting the Orders and Quotes from SAP.
    2. An HTTP call is made to HubSpot to check if the data already exists.
    3. If the deal doesn’t exist, a new deal is created.
    4. However, if the deal already exists, we will update the deal and remove the line items.
    5. All the line items associated with the quotes/order will be fetched.
    6. For each line item, we’ll check if we already have a product created in HubSpot.
    7. If the product does not exist, we create the product and the line item.
    8. Lastly, the line items are associated with the deal.

Conclusion

In this article, we went through the detailed steps for integrating HubSpot with SAP Business One. We established the two-way connection between SAP Business Partner and HubSpot Company; a one-way connection from SAP orders to HubSpot orders; and SAP Quotes to HubSpot Orders.