HubSpot by IV-Lead

Integration Specification Document: HubSpot CRM & Priority ERP

Written by Ohad Peter | Sep 3, 2024 11:00:33 AM
1. Overview

This document outlines the technical requirements, steps, and field mapping necessary to integrate HubSpot CRM and Priority ERP. The integration enables a two-way data sync between HubSpot Deals, Contacts, and Company objects with Priority ERP's Invoices, Shipping, and Customer databases. The objective is to streamline sales operations, manage customer data, and ensure seamless data flow between the CRM and ERP systems.

2. Integration Objectives

  • Two-Way Sync: Synchronize HubSpot Deals, Contacts, and Companies with Priority ERP's database.
  • Sales to ERP Workflow: Automate the transfer of sales quotes and orders from HubSpot to Priority for invoicing and shipping.
  • Centralized Data: Ensure both systems have up-to-date customer data, preventing duplication.
  • Reporting: Enable real-time reporting and visibility into sales and finance data.

3. Integration Workflow

1. HubSpot to Priority ERP

 - Sales Quotes → Sales Orders → Invoices  

Sales quotes generated in HubSpot are converted to sales orders in Priority ERP. Once approved, these orders are invoiced, and shipping details are added in Priority.

2. Priority ERP to HubSpot

- Invoices and Shipping Information: Once invoices and shipping details are updated in Priority ERP, these changes reflect in the relevant HubSpot deal, providing the sales team with real-time data.

4. Field Mapping

HubSpot CRM to Priority ERP Field Mapping:

HubSpot Object

HubSpot Field

Priority ERP Field

Description

Deals

Deal ID

Order Number

Unique identifier for orders/deals in both systems.

 

Amount

Total Value

Total deal amount in HubSpot to the sales order value in ERP.

 

Close Date

Order Date

Deal close date as sales order date.

Contacts

Contact ID

Customer Code

Unique identifier for customer in both systems.

 

First Name, Last Name

Customer Name

Maps the contact name to the customer record in Priority.

 

Email Address

Email

Syncs email addresses between HubSpot and Priority.

Companies

Company ID

Customer Account ID

Company identifier in both systems.

 

Company Name

Account Name

Syncs the company name between HubSpot and Priority.

Line Items

Product Name

Item Code

Syncs products/line items from HubSpot deals to Priority ERP.

 

Quantity

Quantity

Quantity of items in a sales order.

 

Price

Unit Price

Product price from HubSpot to Priority ERP.

Priority ERP to HubSpot Field Mapping:

Priority ERP Object

Priority Field

HubSpot Field

Description

Sales Order

Order Number

Deal ID

Sales order reference in Priority, synced to HubSpot Deal.

 

Shipping Status

Custom Deal Field

Shipping status visible on the HubSpot deal.

Invoice

Invoice Number

Custom Deal Field

Invoice number on the deal record in HubSpot.

 

Invoice Date

Custom Date Field

Date of invoice issuance on HubSpot.

5. Technical Requirements

  1. HubSpot API Access:
2. Priority ERP API Access:
3. Data Transfer Method:
  • Use RESTful API for data transfer between systems.
  • Authentication using OAuth 2.0 for secure API access to both systems.
4. Middleware/Integration Platform:
  • Recommended Middleware: Zapier, Integromat, or custom-built middleware using Node.js or Python.
  • Utilize middleware to handle API requests, transform data between formats, and manage error handling and retries.
6. Implementation

Step 1: Authentication and Access:

1. Obtain API Keys/Access Tokens:
  • From HubSpot, generate API keys or use OAuth 2.0 for access to necessary scopes (Deals, Contacts, Companies).
  • From Priority ERP, generate API keys or access tokens with the required permissions for accessing sales orders, invoices, and customer data.
2. Set up Middleware or Integration Platform:
  • If using a middleware platform (e.g., Zapier or Integromat), connect both HubSpot and Priority ERP APIs.
  • For custom-built integration, set up a Node.js or Python environment and configure OAuth tokens for both APIs.

Step 2: Sync HubSpot Deals with Priority ERP Orders:

1. Trigger on Deal Creation/Update:
  • Set up a trigger when a deal is created or updated in HubSpot.
  • Map HubSpot deal fields (Deal ID, Amount, Line Items, etc.) to Priority ERP fields (Order Number, Total Value, etc.) as per the field mapping table.
2. Create/Update Sales Order in Priority ERP:
  • Send a POST request to the Priority ERP API endpoint to create a new sales order with the relevant fields mapped from HubSpot.
  • Handle any API responses and log errors or success messages.
3. Sales Order Approval in Priority:
  • Once a sales order is approved in Priority, update the relevant HubSpot deal by marking it as "Closed-Won" or "Closed-Lost" based on the ERP response.
  • Add custom fields in HubSpot to track sales order status and shipping information.

Step 3: Sync HubSpot Contacts and Companies with Priority ERP Customers

1. Trigger on Contact or Company Creation/Update:
  • Set up a trigger when a contact or company is created or updated in HubSpot.
2. Create/Update Customer in Priority ERP:
  • Sync HubSpot contact fields (First Name, Last Name, Email, etc.) to Priority ERP customer fields (Customer Name, Email).
  • For companies, map HubSpot company fields (Company Name, Industry, etc.) to the Priority ERP account.
3. Priority Customer to HubSpot:
  • Sync any new or updated customer records from Priority ERP to HubSpot to ensure a two-way sync of customer data.

Step 4: Sync Invoices and Shipping Data

1. Trigger on Invoice Creation in Priority ERP:
  • When an invoice is created in Priority ERP, use a trigger to update the relevant HubSpot deal with the invoice number and date.
2. Sync Shipping Information:
  • After the shipment is processed in Priority, update the HubSpot deal with the shipping status and details, such as tracking numbers or delivery confirmation.
3. Real-time Updates:
  • Ensure that shipping statuses in Priority ERP trigger real-time updates to HubSpot deals, so the sales team is always informed.

Step 5: Error Handling and Data Validation

1. Data Validation:
  • Ensure all required fields (like Deal ID, Customer Code, etc.) are present before syncing.
  • Use data validation scripts to check for duplicates, missing information, or incorrect formats.
2. Error Logging:
  • Set up logging and notification systems for any failed API requests or data mismatches.
  • Implement retry mechanisms in the integration flow to handle temporary failures.

Step 6: Testing and Deployment

1. Test the Integration:
  • Perform unit and integration tests to ensure the data is syncing correctly between HubSpot and Priority ERP.
  • Create test deals, contacts, companies, and invoices in both systems to validate the field mapping and workflows.
2. Deploy the Integration:
  • Once testing is complete, deploy the integration in the production environment.
  •  Monitor the integration for the first few weeks to ensure smooth operation and handle any edge cases or unexpected behaviors.

Step 7: Use Cases

1. Sales Quote to Invoice Workflow:
  • A sales representative creates a quote in HubSpot. Once the deal is approved, it is automatically converted to a sales order in Priority ERP. Upon fulfillment, Priority generates an invoice and sends shipping information, updating HubSpot accordingly.
2. Real-time Customer Sync:
  • A new customer is added to HubSpot, and the customer details (name, email, phone number) are automatically synced with Priority ERP, creating a new customer record in both systems.
3. Two-Way Deal and Order Sync:
  • Sales deals created in HubSpot reflect as sales orders in Priority ERP, and any updates to the orders (like shipping status or invoices) are synced back to HubSpot.

Step 8. Post-Deployment Support and Maintenance

  • Monitor Sync Logs: Regularly check sync logs for errors and data mismatches.
  • API Updates: Stay informed about API changes or updates from HubSpot and Priority ERP.
  • Error Handling: Implement alerts for failed transactions and develop a process for manual intervention in case of persistent failures.

This specification provides a comprehensive guide for integrating HubSpot CRM with Priority ERP, ensuring seamless synchronization of sales, customer, and order data.