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:
- SAP Business Partner to HubSpot Company
- HubSpot Company to SAP Business Partner
- SAP Quote/ Order to HubSpot Deal
(Skip to the section of your choice, by clicking on it)
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.
The integration will be performed using HubSpot workflows and the SAP Integration Framework. The following image describes the overall structure of this integration:
- Establishing a two-way sync between SAP Business Partner and HubSpot Company.
- Establishing one-way sync from SAP Orders to HubSpot Orders.
- Establishing one-way sync from SAP Quotes to HubSpot Orders.
SAP Business Partner to HubSpot Company
Following is the workflow for setting up the integration from SAP Business Partner to the HubSpot Company:
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:
- Navigate to your SAP Integration Framework. Under the tab of SCENARIOS, select Setup.
- Click on the three dots under the Scenarios.
- Select the Entry from the dropdown and click on Select.
- Click on Step Design from the sidebar.
- 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.
- By clicking on Processing, you will be able to see the workflow followed for the processing.
- We are getting the business partner using the SQL call and checking if the business partner already exists in HubSpot or not.
- If the business partner exists, we’ll update it.
- And, if the business partner doesn’t exist, we will create a new one.
- We’ll access all the contacts associated with the particular business partner.
- Lastly, we’ll create those contacts in HubSpot.
- Navigate back to the SAP Integration Framework. Assign an ID and company domain for a business partner.
- Enter the Web Site for the business partner as well.
- Navigate to the Contact Persons.
- Create a contact by adding Contact ID, First Name, Last Name, E-Mail, and additional details.
- Click on Add.
- Once you navigate back to your HubSpot account, you will be able to see that the company has been created under the company list.
- 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.
HubSpot Company to SAP Business Partner
The workflow for establishing the integration from HubSpot Company to SAP Business Partner is as follows:
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:
- Navigate to your HubSpot dashboard and click on Create company.
- Add the Company domain name and the Company name.
- Click on Create company.
- Open the company page, and change the Lifecycle stage to Opportunity.
- Following is the HubSpot workflow for the integration process:
- Click on Details.
- Under Active enrolled, you can see that there is one active enrolment.
- Navigate to your SAP Integration framework, and click on Business Partner Master Data.
- Enter the Id of that particular company and you will be able to see that all the details are fetched automatically.
SAP Quote/ Order to HubSpot Deal
The workflow for quotes and orders is the same and shown below:
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:
- Navigate to your SAP dashboard and click on Sales Order from the sidebar.
- Enter the details of the Sales Order as in the Name, Contact Person, Status, Posting Date, Delivery Date, and Document Date.
- Under the Contents tab, enter Item No., Quantity, Unit Price, Discount %, Tax Code, Total, and such.
- Navigate to the Logistics
- Set the Shipping Type to LTL Hold.
- Now, if you go into the HubSpot account, you will be able to see this deal under the Deals.
Following are the steps for the integration of SAP Quote to HubSpot Deal:
- Navigate to the SAP dashboard and select Sales Quotation from the sidebar.
- Enter the Sales Quotation details as in the Name, Contact Person, Status, Posting Date, Valid (Url), Document Date, and such.
- Enter the details under the Contents tab, including Item No., Quantity, Unit Price, and more.
- Select the Step Design from the sidebar.
- Choose the required entry. Click on Processing.
- This is what the scenario design looks like:
- An SQL call is responsible for getting the Orders and Quotes from SAP.
- An HTTP call is made to HubSpot to check if the data already exists.
- If the deal doesn’t exist, a new deal is created.
- However, if the deal already exists, we will update the deal and remove the line items.
- All the line items associated with the quotes/order will be fetched.
- For each line item, we’ll check if we already have a product created in HubSpot.
- If the product does not exist, we create the product and the line item.
- Lastly, the line items are associated with the deal.
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.