Overview
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 got Chas 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.
- 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.
Sync Messages
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:
PUT /extensions/ecomm/v1/sync-messages/:object_type?hapikey=demo
Here object type can be PRODUCT, CONTACT, DEAL or LINEITEM.
PUT /extensions/ecomm/v1/sync-messages/:CONTACT?hapikey=demo
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:
PUT /extensions/ecomm/v1/sync-messages/:DEAL?hapikey=demo
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:
PUT /extensions/ecomm/v1/sync-messages/:PRODUCT?hapikey=demo
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:
PUT /extensions/ecomm/v1/sync-messages/:LINEITEM?hapikey=demo
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.
Esparks is a leading web development agency with expertise in Designing, Digital Marketing, and Business Intelligence as well.