Hubspot Ecommerce Bridge API Integration with Magento
The Hubspot eCommerce bridge API is built to allow you to create a functional application or integration quickly and easily. All of the HubSpot APIs are organized around REST. The Ecommerce Bridge provides a process for syncing eCommerce data into HubSpot. It handles much of the work of syncing data. Using the Ecommerce Bridge API, you avoid all the little gotchas encountered when writing data directly to Contacts and the CRM objects. The Ecommerce Bridge allows HubSpot to provide common eCommerce functionality. We have synced Magento orders, products, and customers with this API. Other Hubspot APIs are paid that’s why we integrate this API with our Magento store.
Integration with Magento
When a customer’s eCommerce data in Magento changes, we’ve updated the data in Hubspot CRM as well by then. To implement the Ecommerce Bridge we need to map the structure of data in our eCommerce domain (Magento) onto objects in the HubSpot CRM.
The Ecommerce Bridge allows us to map to properties of the following objects:
- Contacts: Standard HubSpot contacts
- Deals: HubSpot deals used in the CRM i.e. Magento Orders
- Products: A new object in the CRM. This allows customers to define their product catalog in the CRM.
- Line Items: A new object in the CRM. This object represents a line-item of a deal. It is associated with a deal (order) and a product.
We used the Sync Messages API to send HubSpot notifications of all creations, updates, and deletes of eCommerce objects. After we’ve defined how your system’s properties map into HubSpot, and after a user has installed Hubspot integration, we’re ready to send sync messages to HubSpot notifying HubSpot of changes to eCommerce objects. We’ve sync three types of objects i.e. order, products, and customers from Magento. Whenever there is any change in Magento data, the Ecommerce Bridge API will apply changes from sync messages to HubSpot. We’ve used the following API for syncing Magento data to Hubspot:
Here object type can be PRODUCT, CONTACT, DEAL or LINEITEM.
By using this endpoint, we’ve synced our customers with Hubspot. Every time when a customer registers or submits a contact form, we have built the data for sending it to Hubspot.
DEALS are Magento orders which we synced with Hubspot using this endpoint:
Whenever a user placed an order in Magento, we’ve synced that order with Hubspot. We have synced not only the order attributes provided by Magento but also other extension attributes like delivery dates etc. Also with the order’s data, we also send customer’s data to Hubspot using the above CONTACT API.
With order’s data sync, we also send the associated products with that order using this endpoint:
4- LINE ITEMS
Line items are used to associate any product with the order in Hubspot or any customer with a deal or order. As we synced the customers and products data with orders, we used line-items API for associating them with each other:
Import Historical Data
Not only real-time orders are syncing, but we’ve also imported our old eCommerce data using the same Hubspot eCommerce bridge API. Although Hubspot provides import API that’s a paid service. We have managed to integrate this API to import our previous data easily.