RUNMYBOT® Integration for HubSpot and SAP Business One
1 Usage of this Document
This document serves as a reference for implementing a data synchronisation layer between HubSpot CRM and SAP Business One ERP systems using the RUNMYBOT platform. It defines how each module is synchronised, how authentication is managed, and how data conflicts and errors are handled, while keeping the middleware layer completely transparent to end users.
2 Purpose
The purpose of this document is to present a detailed solution design for implementing a middleware orchestration layer using our internal low-code platform, RUNMYBOT, to integrate HubSpot CRM, the primary commercial system, with SAP Business One, the ERP and financial system of record. The proposed solution enables seamless, API-driven synchronization of key business data, including customer master data, contact records, sales orders, opportunities, product catalogs, invoices, and payments between the two systems. The integration is designed to minimize manual intervention, ensure reliable and consistent data exchange, and provide complete visibility and auditability through centralized logging and monitoring.
3 Objective
The HubSpot–SAP Business One integration enables secure, API-based orchestration of customers, contacts, sales orders, opportunities, products, invoices, and payments across both platforms. The objectives of this integration are to:
- Ensure customer and contact master data remains consistent across HubSpot and SAP Business One at all times.
- Enable synchronization of HubSpot Closed Won Deals to SAP Business One Sales Orders and Opportunities.
- Push Product master data, Sales Invoices, and Payment records from SAP Business One into HubSpot to give sales teams full commercial visibility.
- Maintain transaction consistency across systems using cross-reference key fields and upsert logic.
- Provide full monitoring, logging, retry handling, and audit tracking within RUNMYBOT.
4 Prerequisites
| Component | Requirement |
|---|---|
| HubSpot Edition | Professional, Enterprise, Unlimited, or Developer Edition |
| HubSpot API Access | API access must be enabled on the connected user profile |
| HubSpot User | Dedicated integration user with System Administrator or custom profile |
| HubSpot Connection | Either install the RUNMYBOT HubSpot App (recommended) or configure a customer-owned HubSpot OAuth application by providing the Client ID and Client Secret in the RUNMYBOT Connection module. |
| SAP B1 Version | SAP Business One (version 10.0 or later, with Service Layer enabled) |
| SAP B1 API Access | SAP Business One Service Layer API access must be enabled and available for the integration user. |
| SAP B1 User | Dedicated B1 API user with authorizations for Business Partners, Items, Orders, Opportunities, Invoices, and Payments. |
| Network | Outbound HTTPS (port 50000 / 443) access to SAP Business One Service Layer endpoint. |
| HubSpot Custom field and Object | Create necessary custom fields and custom objects for the synchronization of payment & sales invoice from SAP Business One to HubSpot. |
5 Connection Setup & Configuration
Connection setups inside the RUNMYBOT Unified API require setting up credentials, base URLs, and authentication configurations.
5.1 Reference Field Creation
Create a custom field for each module in HubSpot to maintain a permanent cross-reference between the integrated systems.
| Object | Field Name | Field Label | Data Type |
|---|---|---|---|
| Contact | sap_contact_id | SAP Contact ID | Text |
| Company | sap_company_id | SAP Company ID | Text |
| Product | sap_product_id | SAP Product ID | Text |
| Deal | sap_reference_id | SAP Reference ID | Text |
| Sales Invoice | external_ref_id | External Ref ID | Text |
| Customer Payment | external_ref_id | External Ref ID | Text |
5.2 Custom Object Creation
Create Custom Objects for **Sales Invoice** and **Customer Payments** in HubSpot.
Sales Invoice Object Name: p246208318_sales_invoices
| Field Label | Field Name | Field Type |
|---|---|---|
| Invoice Amount | invoice_amount | Number |
| External Ref ID | external_ref_id | Single-line text |
| Note | note | Multi-line text |
| Status | status | Dropdown |
| Invoice Number | invoice_number | Single-line text |
| Invoice Date | invoice_date | Date |
| Company | company_id | Association |
| Deal | deal_id | Association |
Customer Payment Object Name: p246208318_customer_payments
| Field Label | Field Name | Field Type |
|---|---|---|
| Amount Paid | amount_paid | Number |
| External Ref ID | external_ref_id | Single-line text |
| Note | note | Multi-line text |
| Status | status | Dropdown |
| Payment Number | payment_number | Single-line text |
| Total Amount | total_amount | Number |
| Transaction Date | transaction_date | Date |
| Company | company_id | Association |
| Invoice | invoice_id | Association |
6 System Overview
6.1 RUNMYBOT® Platform
A real-time orchestration engine that aggregates data across multiple systems and manages complex cross-platform transactions. Unlike a simple connector model, it functions as a real-time transaction orchestration layer between HubSpot and SAP Business One, making the integration layer completely invisible to end users.
6.2 HubSpot
Cloud-based CRM used as the primary commercial system and origin for customer relationship and sales pipeline management.
6.3 SAP Business One
SAP Business One is the ERP system used as the financial and operational system of record. It manages customer master data, material master data, sales order processing, billing documents, and accounting records.
7 Scope Requirements
| Use Case | Direction | Description |
|---|---|---|
| Customer & Contact Sync | HubSpot ↔ SAP B1 | Bi-directional sync of Business Partners and Contacts between HubSpot and SAP Business One. |
| Deal Sync | HubSpot → SAP B1 | Synchronize Closed Won HubSpot Deals to SAP B1 Sales Orders and Sales Opportunities. |
| Product Master Sync | SAP B1 → HubSpot | Sync items from SAP Business One to HubSpot product catalog. |
| Sales Invoice Sync | SAP B1 → HubSpot | Push posted Sales Invoices from SAP Business One to HubSpot custom objects. |
| Customer Payment Sync | SAP B1 → HubSpot | Push Customer Payments from SAP Business One to HubSpot customer payment custom objects. |
8 Process in Detail
8.1 Authentication
HubSpot: OAuth 2.0 Client Credentials or Private App authentication is used. RUNMYBOT handles secure token storage and refresh.
SAP Business One: Service Layer session-based authentication is used securely by requesting a B1SessionID using database, username, and password credentials.
8.2 Standard Workflows
The standard integration workflows between HubSpot and SAP Business One synchronize core business entities including Customers, Contacts, Products, and Sales Orders.
8.2.1 HubSpot Company to SAP Business One Business Partner
Company records created or updated in HubSpot, along with their associated Contacts, are synchronized with SAP Business One to maintain consistent customer master data across both systems.
Connection: <Select HubSpot Connection>
Resource: Companies, Associations: Contacts
Extract Type: All - Always extract all data, Include All Fields: True
Connection: <Select Business One Connection>
CompanyDB: <Fill CompanyDB>, Resource: Business Partner, Import Type: Upsert
Directly By ID: False, Lookup Condition 1: Lookup Field: CardCode, Operator: Equal, Source: Mapping
SAP Business One Business Partner Import Default Mapping
| Source Data | Target Data | Description / Rules |
|---|---|---|
| properties.sap_cardcode | CardCode | CardCode Reference |
| id | ID | HubSpot ID Reference |
| properties.name | CardName | Company Name |
| contacts["].properties.email | ContactEmployees[*].E_Mail | Email Address |
| contacts["].properties.hs_full_name_or_email | ContactEmployees[*].Name | Contact Name |
| contacts["].properties.phone | ContactEmployees[*].Phone1 | Phone Number |
| properties.address | Address | Street Address |
| properties.phone | Phone1 | Phone 1 |
| properties.description | Notes | Notes Memo |
| properties.domain | Website | Website URL |
| properties.country | Country | Lookup: United States - US, India - IN |
| properties.city | City | City Name |
| properties.zip | ZipCode | Zip Code |
| properties.state | BillToState | Lookup: British Columbia - BC, Pennsylvania - PA |
| properties.state | ShipToState | Lookup: British Columbia - BC, Pennsylvania - PA |
SAP Business One Business Partner Import Conditional Mapping (properties.sap_cardcode Equals Null)
| Source Data | Target Data | Description / Rules |
|---|---|---|
| CardType | Static: cCustomer | |
| CompanyPrivate | Static: cCompany | |
| FederalTaxID | Static: AAABC1234D | |
| BPFiscalTaxIDCollection[*].TaxId0 | Static: ABHHD2534C | |
| id | ID | HubSpot ID Reference |
| properties.name | CardName | Company Name |
| contacts[*].properties.email | ContactEmployees[*].E_Mail | Contact Email |
| contacts[*].properties.hs_full_name_or_email | ContactEmployees[*].Name | Contact Name |
| contacts[*].properties.phone | ContactEmployees[*].Phone1 | Contact Phone |
| properties.address | Address | Street Address |
| properties.phone | Phone1 | Phone 1 |
| properties.description | Notes | Notes Memo |
| properties.domain | Website | Website URL |
| properties.country | Country | Lookup: United States - US, India - IN |
| properties.city | City | City Name |
| properties.zip | ZipCode | Zip Code |
| properties.state | BillToState | Lookup: British Columbia - BC, Pennsylvania - PA |
| properties.state | ShipToState | Lookup: British Columbia - BC, Pennsylvania - PA |
Connection: <Select HubSpot Connection>, Resource: Companies, Method: Operation: Update, Directly By HubSpot ID: True
HubSpot Company Update Mapping
| Source Data | Target Data | Description / Rules |
|---|---|---|
| CardCode | properties.sap_cardcode | CardCode Reference |
| Reference_id | id | Record ID |
8.2.2 SAP Business One Business Partner to HubSpot Company - Contact
Business Partner records created or updated in SAP Business One are synchronized to HubSpot to ensure master data remains consistent across both systems.
Connection: <Select Business One Connection>, CompanyDB: <Fill CompanyDB>, Resource: Business Partner, Extract Type: All - Always extract all data
Connection: <Select HubSpot Connection>, Resource: Companies, Operation: Upsert, Directly By HubSpot ID: False, Lookup Field: properties.sap_cardcode, Operator: Equal
HubSpot Company Import Mapping
| Source Data (SAP B1) | Target Data (HubSpot) | Description / Rules |
|---|---|---|
| CardCode | properties.sap_cardcode | CardCode Reference |
| CardName | properties.name | Company Name |
| Phone1 | properties.phone | Phone Number |
| Website | properties.domain | Website Domain |
| Country | properties.country | Country Reference |
| City | properties.city | City Name |
| Address | properties.address | Street Address |
| ZipCode | properties.zip | Postal Code |
| Notes | properties.description | Description Notes |
Condition 1: Operation: Left Join, Split Field: id, Left Data: WITHOUT SPLIT KEY PRESENT, Group By Fields: CardCode
HubSpot Company to Data Preprocess Mapping
| Source Data | Target Data | Description / Rules |
|---|---|---|
| properties.sap_cardcode | CardCode | CardCode Reference |
| hs_object_id | id | HubSpot Object ID |
SAPB1 BusinessPartner to Data Preprocess Mapping
| Source Data | Target Data | Description / Rules |
|---|---|---|
| CardCode | ContactEmployees[*].CardCode | CardCode Reference |
| ContactEmployees[*].Name | ContactEmployees[*].Name | Contact Name |
| ContactEmployees[*].E_Mail | ContactEmployees[*].E_Mail | Contact Email |
| ContactEmployees[*].InternalCode | ContactEmployees[*].InternalCode | Internal Code |
| ContactEmployees[*].Phone1 | ContactEmployees[*].Phone1 | Contact Phone |
Connection: <Select HubSpot Connection>, Resource: Contacts, Operation: Upsert, Directly By HubSpot ID: False, Lookup Field: properties.sap_internalcode, Operator: Equal
HubSpot Contact Import Mapping
| Source Data | Target Data | Description / Rules |
|---|---|---|
| Name | properties.firstname | First Name |
| E_Mail | properties.email | Email Address |
| InternalCode | properties.sap_internalcode | Internal Code Reference |
| id | associations[*].to.id | Company Association ID |
| associations[*].types[*].associationCategory | Static: HubSpot_DEFINED | |
| associations[*].types[*].associationTypeId | Static: 1 | |
| Phone1 | properties.phone | Phone Number |
8.2.3 HubSpot Deal to SAP Business One Sales Order
Closedwon HubSpot Deals are synchronized to SAP Business One Sales Orders. RUNMYBOT retrieves Deal data through REST APIs, validates the payload, and performs required field mapping.
Connection: <Select HubSpot Connection>, Resource: Deals, Associations: Companies, Line Items
Extract Type: All - Always extract all data, Include All Fields: True, Enable Lookup: True
Lookup Condition: Lookup Field: dealstage, Operator: Equal, Source: Static, Value: closedwon
Condition 1: Operation: Filter, Field Name: properties.sap_docentry, Condition: Is EMPTY
Condition 2: Operation: Filter, Field Name: line_items, Condition: Is Not Empty
Condition 3: Operation: Filter, Field Name: companies, Condition: Is Not Empty
Condition 1: Operation: Filter, Field Name: id, Condition: Unique
Data Preprocess Filter 2 Mapping
| Source Data | Target Data | Description / Rules |
|---|---|---|
| companies | companies | Unique Companies Filter |
Connection: <Select Business One Connection>, CompanyDB: <Fill CompanyDB>, Resource: Business Partner, Import Type: Upsert, Lookup Field: CardCode, Operator: Equal
SAP Business One Company Import Default Mapping
| Source Data | Target Data | Description / Rules |
|---|---|---|
| properties.sap_cardcode | CardCode | CardCode Reference |
| id | ID | HubSpot ID Reference |
| properties.name | CardName | Company Name |
| properties.address | Address | Street Address |
| properties.phone | Phone1 | Phone 1 |
| properties.description | Notes | Notes Memo |
| properties.domain | Website | Website URL |
| properties.country | Country | Lookup: United States - US, India - IN |
| properties.city | City | City Name |
| properties.state | BillToState | Lookup: British Columbia - BC, Pennsylvania - PA |
| properties.state | ShipToState | Lookup: British Columbia - BC, Pennsylvania - PA |
SAP Business One Company Import Conditional Mapping (properties.sap_cardcode Equals Null)
| Source Data | Target Data | Description / Rules |
|---|---|---|
| CardType | Static: cCustomer | |
| CompanyPrivate | Static: cCompany | |
| FederalTaxID | Static: AAABC1234D | |
| BPFiscalTaxIDCollection[*].TaxId0 | Static: ABHHD2534C | |
| id | ID | HubSpot ID Reference |
| properties.name | CardName | Company Name |
Connection: <Select HubSpot Connection>, Resource: Companies, Operation: Update, Directly By HubSpot ID: True
HubSpot Company Update Mapping
| Source Data | Target Data | Description / Rules |
|---|---|---|
| CardCode | properties.sap_cardcode | CardCode Reference |
| Reference_id | id | Record ID |
Condition 1: Operation: Merge, Join Type: Left Join, Split Field: DocumentLines, Left Data: WITH SPLIT KEY PRESENT, Group By Fields: company_id
HubSpot Company to Data Preprocess Mapping
| Source Data | Target Data | Description / Rules |
|---|---|---|
| hs_object_id | company_id | Company ID Reference |
| properties.sap_cardcode | CardCode | CardCode Reference |
Data Preprocess Mapping Table
| Source Data | Target Data | Description / Rules |
|---|---|---|
| companies[*].id | company_id | Company ID |
| line_items | DocumentLines | Document Lines Array |
| properties.dealname | dealname | Deal Name |
| properties.sap_docentry | sap_docentry | DocEntry Reference |
| id | deal_id | Deal ID |
| properties.closedate | closedate | Close Date |
| properties.createdate | createdate | Create Date |
Connection: <Select Business One Connection>, CompanyDB: <Fill CompanyDB>, Resource: Orders, Import Type: Create
SAP Business One Sales Order Import Mapping
| Source Data | Target Data | Description / Rules |
|---|---|---|
| CardCode | CardCode | CardCode Reference |
| createdate | DocDate | Document Date |
| dealname | Comments | Comments Memo |
| DocumentLines[*].properties.sap_itemcode | DocumentLines[*].ItemCode | Item Code Reference |
| DocumentLines[*].properties.quantity | DocumentLines[*].Quantity | Quantity |
| DocumentLines[*].properties.price | DocumentLines[*].UnitPrice | Unit Price |
| Select Field | DocumentLines[*].WarehouseCode | Static: 01 |
| sap_docentry | DocEntry | DocEntry Reference |
| deal_id | ID | Deal ID Reference |
| closedate | DocDueDate | Due Date |
Connection: <Select HubSpot Connection>, Resource: Deal, Operation: Update, Directly By HubSpot ID: True
HubSpot Deal Update Mapping
| Source Data | Target Data | Description / Rules |
|---|---|---|
| Reference_id | id | Record ID |
| DocEntry | properties.sap_docentry | SAP DocEntry Reference |
8.2.4 HubSpot Deal to SAP Business One Opportunity
HubSpot Deals are synchronized to SAP Business One Sales Opportunities. RUNMYBOT retrieves Deal data through REST APIs, validates the payload, and performs required field mapping.
Connection: <Select HubSpot Connection>, Resource: Deals, Associations: Companies, Line Items
Extract Type: All - Always extract all data, Include All Fields: True
Condition 3: Operation: Filter, Field Name: companies, Condition: Is Not Empty
Condition 1: Operation: Filter, Field Name: id, Condition: Unique
Data Preprocess Filter 2 Mapping
| Source Data | Target Data | Description / Rules |
|---|---|---|
| companies | companies | Unique Companies Filter |
Connection: <Select Business One Connection>, CompanyDB: <Fill CompanyDB>, Resource: Business Partner, Import Type: Upsert, Lookup Field: CardCode, Operator: Equal, Source: Mapping
SAP Business One Company Import Default Mapping
| Source Data | Target Data | Description / Rules |
|---|---|---|
| properties.sap_cardcode | CardCode | CardCode Reference |
| id | ID | HubSpot ID |
| properties.name | CardName | Company Name |
| properties.address | Address | Street Address |
| properties.phone | Phone1 | Phone Number |
| properties.description | Notes | Notes |
| properties.domain | Website | Website Domain |
| properties.country | Country | Lookup: United States - US, India - IN |
| properties.city | City | City Name |
| properties.state | BillToState | Lookup: British Columbia - BC, Pennsylvania - PA |
| properties.state | ShipToState | Lookup: British Columbia - BC, Pennsylvania - PA |
SAP Business One Company Import Conditional Mapping (properties.sap_cardcode Equals Null)
| Source Data | Target Data | Description / Rules |
|---|---|---|
| CardType | Static: cCustomer | |
| CompanyPrivate | Static: cCompany | |
| FederalTaxID | Static: AAABC1234D | |
| BPFiscalTaxIDCollection[*].TaxId0 | Static: ABHHD2534C | |
| id | ID | HubSpot ID |
| properties.name | CardName | Company Name |
Connection: <Select HubSpot Connection>, Resource: Companies, Operation: Update, Directly By HubSpot ID: True
HubSpot Company Update Mapping
| Source Data | Target Data | Description / Rules |
|---|---|---|
| CardCode | properties.sap_cardcode | CardCode Reference |
| Reference_id | id | Record ID |
Condition 1: Operation: Merge, Join Type: Left Join, Split Field: DocumentLines, Left Data: WITH SPLIT KEY PRESENT, Group By Fields: company_id
HubSpot Company to Data Preprocess Mapping
| Source Data | Target Data | Description / Rules |
|---|---|---|
| hs_object_id | company_id | Company ID Reference |
| properties.sap_cardcode | CardCode | CardCode Reference |
Data Preprocess Mapping Table
| Source Data | Target Data | Description / Rules |
|---|---|---|
| companies[*].id | company_id | Company ID |
| line_items | DocumentLines | Document Lines Array |
| properties.dealname | dealname | Deal Name |
| properties.sap_docentry | sap_docentry | DocEntry Reference |
| id | deal_id | Deal ID |
| properties.closedate | closedate | Close Date |
| properties.createdate | createdate | Create Date |
Connection: <Select Business One Connection>, CompanyDB: <Fill CompanyDB>, Resource: Sales Opportunities, Import Type: Upsert, Lookup Field: SequentialNo, Operator: equals, Source: Mapping
SAP Business One Opportunity Import Default Mapping
| Source Data | Target Data | Description / Rules |
|---|---|---|
| CardCode | CardCode | CardCode Reference |
| dealname | OpportunityName | Opportunity Name |
| dealstage | SalesOpportunitiesLines['].StageKey | Stage Key |
| SalesOpportunitiesLines['].properties.amount | SalesOpportunitiesLines['].MaxLocalTotal | Max Local Total |
| sap_docentry | SequentialNo | Sequential Number |
| deal_id | ID | Deal ID |
| createdate | StartDate | Start Date |
| closedate | PredictedClosingDate | Predicted Closing Date |
SAP Business One Opportunity Import Conditional Mapping (sap_docentry Equals Null)
| Source Data | Target Data | Description / Rules |
|---|---|---|
| CardCode | CardCode | CardCode Reference |
| dealname | OpportunityName | Opportunity Name |
| dealstage | SalesOpportunitiesLines['].StageKey | Stage Key |
| SalesOpportunitiesLines['].properties.amount | SalesOpportunitiesLines['].MaxLocalTotal | Max Local Total |
| SequentialNo | Static: -1 | |
| deal_id | ID | Deal ID Reference |
| createdate | StartDate | Start Date |
| closedate | PredictedClosingDate | Predicted Closing Date |
Connection: <Select HubSpot Connection>, Resource: Deal, Method: Operation: Update, Directly By HubSpot ID: True
HubSpot Deal Update Mapping
| Source Data | Target Data | Description / Rules |
|---|---|---|
| Reference_id | id | Record ID |
| SequentialNo | properties.sap_sequential_no | SAP Sequential Number |
8.2.5 SAP Business One Sales Order to HubSpot Deal
SAP Business One Sales Orders are synchronized to HubSpot Deals. RUNMYBOT retrieves Sales Order data from SAP Business One through the Service Layer REST APIs, validates the payload, and performs the required field mapping and data transformation before creating the corresponding HubSpot Deals.
Connection: <Select Business One Connection>
CompanyDB: <Fill CompanyDB >
Resource: Orders
Extract Type: All - Always extract all data
Condition: Operation: Filter, Field Name: CardCode, Condition: Unique
Resource: Companies
Operation: Upsert
Lookup Field: properties.sap_cardcode
HubSpot Company Mapping Table
| Source Data (SAP B1) | Target Data (HubSpot) |
|---|---|
| CardCode | properties.sap_cardcode |
| CardName | properties.name |
| Phone1 | properties.phone |
| Website | properties.domain |
Left join, split company_id, group by CardCode
Resource: Deals
Operation: Create
Lookup Field: properties.sap_docentry
HubSpot Deal Mapping Table
| Source Data (SAP B1) | Target Data (HubSpot) |
|---|---|
| DocNum | properties.dealname |
| DocTotal | properties.amount |
| properties.dealstage | Static: closedwon |
| Comments | properties.description |
| DocEntry | properties.sap_docentry |
| company_id | associations[*].to.id |
| associations[*].types[*].associationCategory | Static: HUBSPOT_DEFINED |
| associations[*].types[*].associationTypeId | Static: 5 |
Resource: Deal Line Items
Operation: Create
HubSpot Deal Line Item Mapping Table
| Source Data (SAP B1) | Target Data (HubSpot) |
|---|---|
| ItemDescription | properties.name |
| Quantity | properties.quantity |
| product_id | properties.hs_product_id |
| ItemCode | properties.hs_sku |
| deal_id | associations[*].to.id |
| associations[*].types[*].associationCategory | Static: HUBSPOT_DEFINED |
| associations[*].types[*].associationTypeId | Static: 20 |
8.2.6 SAP Business One Product to HubSpot Product
Product master records created or updated in SAP Business One are synchronized to HubSpot to ensure that the CRM system maintains an up-to-date product catalog and pricing information.
Connection: <Select Business One Connection>, CompanyDB: <Fill CompanyDB>, Resource: Items, Extract Type: All - Always extract all data
Connection: <Select HubSpot Connection>, Resource: Product, Method: Operation: Upsert, Directly By HubSpot ID: False, Lookup Field: properties.sap_itemcode, Operator: Equal, Source: Mapping
Field Mapping Table
| Source Data (SAP B1) | Target Data (HubSpot) | Description / Rules |
|---|---|---|
| ItemName | properties.name | Product Name |
| ItemCode | properties.sap_itemcode | SAP ItemCode Reference |
| ItemType | properties.hs_product_type | Product Item Type |
| ItemCode | properties.hs_sku | SKU Reference |
| User_Text | properties.description | Product Description Notes |
| ItemPrices[*].price | properties.price | Unit Price |
8.3 Custom Workflows
Custom workflows extend the integration features for financial transactions such as invoices and payments.
8.3.1 SAP Business One Sales Invoice to HubSpot Sales Invoice
The SAP Business One Invoice to HubSpot integration is a structured, multi-step process. RUNMYBOT retrieves Sales Invoice data from SAP Business One, enriches it with corresponding HubSpot Deal and Company information, and imports the processed invoice into HubSpot custom objects.
Connection: <Select Business One Connection>, CompanyDB: <Fill CompanyDB>, Resource: Invoices, Extract Type: All - Always extract all data
Connection: <Select HubSpot Connection>, Resource: Deals, Associations: Companies, Extract Type: All - Always extract all data, Include All Fields: True, Enable Lookup: True
Lookup Condition: Lookup Field: sap_docentry, Operator: Equal, Source: Mapping
HubSpot Deal Export Mapping
| Source Data | Target Data | Description / Rules |
|---|---|---|
| sap_docentry | sap_docentry | Expression used |
| DocNum | prev_data.DocNum | Document Number |
Condition 1: Operation: Merge, Join Type: Left Join, Split Field: associations, Left Data: WITHOUT SPLIT KEY PRESENT, Group By Fields: DocNum
Condition 2: Operation: Filter, Field Name: associations, Condition: Is Not EMPTY
HubSpot Deal Export to Data preprocess Mapping
| Source Data | Target Data | Description / Rules |
|---|---|---|
| id | associations[*].to.id | HubSpot Deal ID Reference |
| properties.sap_docentry | DocEntry | DocEntry Reference |
| prev_data.DocNum | DocNum | Document Number Reference |
| associations[*].types[*].associationCategory | Static: USER_DEFINED | |
| associations[*].types[*].associationTypeId | Static: 21 |
SAP Business One Invoice Export to Data Preprocess Mapping
| Source Data | Target Data | Description / Rules |
|---|---|---|
| DocEntry | DocEntry | Expression used |
| OpenAmount | OpenAmount | Open Amount |
| DocTotal | DocTotal | Total Amount |
| DocDueDate | DocDueDate | Due Date |
| DocDate | DocDate | Document Date |
| DocNum | DocNum | Document Number |
| DocEntry | invoice_DocEntry | Invoice DocEntry |
Condition 1: Operation: Merge, Join Type: Full Join, Group By Fields: DocNum
Data Preprocess Mapping
| Source Data | Target Data | Description / Rules |
|---|---|---|
| companies[*].id | associations[*].to.id | Company ID Reference |
| companies[*].properties.name | company_name | Company Name Reference |
| prev_data.DocNum | DocNum | Document Number Reference |
| associations[*].types[*].associationCategory | Static: USER_DEFINED | |
| associations[*].types[*].associationTypeId | Static: 17 |
Connection: <Select HubSpot Connection>, Resource: Custom Object, Custom Object Name:
p246208318_sales_invoices, Operation: Upsert, Directly By HubSpot ID: FalseLookup Condition: Lookup Field: properties.external_ref_id, Operator: Equal, Source: Mapping
HubSpot Import Mapping
| Source Data | Target Data | Description / Rules |
|---|---|---|
| invoice_DocEntry | properties.external_ref_id | External Reference ID |
| OpenAmount | properties.outstanding_amount | Outstanding Amount |
| DocTotal | properties.invoice_amount | Total Invoice Amount |
| DocDueDate | properties.due_date | Due Date |
| DocDate | properties.invoice_date | Invoice Date |
| DocNum | properties.invoice_number | Invoice Number |
| associations | associations | Links to Deal & Company |
8.3.2 SAP Business One Customer Payment to HubSpot Payment
The Business One Customer Payment to HubSpot integration begins by exporting customer payment records from Business One, enriches payment data with HubSpot invoice and company context, and imports payment data into HubSpot.
Connection: <Select Business One Connection>, CompanyDB: <Fill CompanyDB>, Resource: Customer Payments, Extract Type: All - Always extract all data
Condition: Operation: Filter, Field Name: payment_number, Condition: Is Not Empty
Data Preprocess Filter Mapping
| Source Data | Target Data | Description / Rules |
|---|---|---|
| PaymentInvoices[*].DocEntry | PaymentInvoices[*].invoice_number | Invoice Number Reference |
| DocNum | PaymentInvoices[*].payment_number | Payment Number Reference |
| DocDate | PaymentInvoices[*].DocDate | Payment Date |
| CashSum | PaymentInvoices[*].amount_paid | Amount Paid Value |
| JournalRemarks | PaymentInvoices[*].note | Notes Memo |
| CardCode | PaymentInvoices[*].customer | Customer Code Reference |
| Cancelled | PaymentInvoices[*].status | Payment Status |
Condition: Operation: Filter, Field Name: invoice_number, Condition: Unique
Data Preprocess Filter Unique Invoice Mapping
| Source Data | Target Data | Description / Rules |
|---|---|---|
| invoice_number | invoice_number | Invoice Number Reference |
| payment_number | payment_number | Payment Number Reference |
Connection: <Select HubSpot Connection>, Resource: Custom Object, Custom Object Name:
p246208318_sales_invoices, Extract Type: All - Always extract all data, Include All Fields: True,
Enable Look Up: TrueLookup Condition 1: Lookup Field: external_ref_id, Operator: Equal, Source: Mapping
HubSpot Invoice Export Mapping
| Source Data | Target Data | Description / Rules |
|---|---|---|
| invoice_number | external_ref_id | External Reference ID |
| payment_number | prev_data.payment_number | Payment Number Reference |
Condition 1: Operation: Merge, Join Type: Left Join, Split Field: associations, Left Data: WITHOUT SPLIT KEY PRESENT, Group By Fields: payment_number, invoice_number
Condition 2: Operation: Filter, Field Name: associations, Condition: Is Not EMPTY
HubSpot Sales Invoice Export to Data preprocess Mapping
| Source Data | Target Data | Description / Rules |
|---|---|---|
| id | associations[*].to.id | HubSpot Invoice ID Reference |
| properties.external_ref_id | invoice_number | Invoice Number Reference |
| properties.invoice_amount | total_amount | Total Invoice Amount |
| associations[*].types[*].associationCategory | Static: USER_DEFINED | |
| associations[*].types[*].associationTypeId | Static: 39 | |
| prev_data.payment_number | payment_number | Payment Number Reference |
Condition: Operation: Filter, Field Name: customer, Condition: Unique
Data Preprocess Filter Unique Invoice Customer Mapping
| Source Data | Target Data | Description / Rules |
|---|---|---|
| customer | customer_id | Customer ID Reference |
| payment_number | prev_data.payment_number | Payment Number Reference |
| invoice_number | prev_data.invoice_number | Invoice Number Reference |
Connection: <Select HubSpot Connection>, Resource: Companies, Extract Type: All - Always extract all data, Include All Fields: True, Enable Look Up: True
Lookup Condition 1: Lookup Field: sap_cardcode, Operator: Equal, Source: Mapping
HubSpot Company Export Mapping
| Source Data | Target Data | Description / Rules |
|---|---|---|
| customer_id | sap_cardcode | CardCode Reference |
| payment_number | prev_data.payment_number | Payment Number Reference |
Condition: Operation: Merge, Join Type: Full Join, Group By Fields: payment_number, invoice_number
Data Preprocess Mapping
| Source Data | Target Data | Description / Rules |
|---|---|---|
| id | associations[*].to.id | Company ID Reference |
| associations[*].types[*].associationCategory | Static: USER_DEFINED | |
| associations[*].types[*].associationTypeId | Static: 48 | |
| prev_data.payment_number | payment_number | Payment Number Reference |
| properties.name | company_name | Company Name Reference |
| prev_data.invoice_number | invoice_number | Invoice Number Reference |
Connection: <Select HubSpot Connection>, Resource: Custom Object, Custom Object Name:
p246208318_customer_payments, Operation: Upsert, DirectlyBy Id: FalseLookup Condition: Lookup Field: properties.payment_number, Operator: Equal, Source: Mapping
HubSpot Customer Payment Import Mapping
| Source Data | Target Data | Description / Rules |
|---|---|---|
| amount_paid | properties.amount_paid | Amount Paid Value |
| payment_number | properties.external_ref_id | External Reference ID |
| DocDate | properties.transaction_date | Transaction Date |
| note | properties.note | Notes / Remarks |
| payment_number | properties.payment_number | Payment Number Reference |
| invoice_amount | properties.total_amount | Total Invoice Amount |
| associations | associations | Links to Invoice & Company |
9 Exception Handling
Error handling is implemented across trigger, transformation, and action stages of each flow to ensure reliable synchronization:
- Validation: Checks identify missing mandatory fields, invalid data formats, and incorrect reference mappings before processing.
- Duplicates: Managed using external identifiers and upsert logic to prevent duplicate record insertion.
- Retries: Automated retry schedules for network interruptions, API timeouts, rate limits, or temporary service unavailability.
- Logging: All integration activities, payloads, and errors are logged inside the RUNMYBOT monitoring dashboard.
