Skip to main content
The HubSpot connection links Flexprice to your HubSpot account through a HubSpot legacy private app. Flexprice uses the app’s access token to read deals and contacts and to create invoices, quotes, and line items in HubSpot. It uses the app’s client secret to verify the deal events that HubSpot sends to Flexprice.

What the HubSpot integration syncs

Flexprice does not sync payments, plans, or prices with HubSpot, and it does not read invoices back from HubSpot.

Before you connect HubSpot

  • HubSpot super admin access. HubSpot only lets super admins create private apps.
  • The Flexprice environment for the connection. The webhook URL that HubSpot calls contains the tenant and environment IDs of that environment, so create the connection in the environment you want customers to land in.
  • A HubSpot quote template, if you plan to use quote sync. HubSpot only publishes quotes that have a template, and Flexprice attaches the first template in your account.

Step 1: Create a HubSpot legacy private app

1

Open legacy apps in HubSpot

In your HubSpot account, go to Development, then click Legacy apps in the left sidebar.The page encourages you to build new apps on HubSpot’s newer developer platform instead. Create a legacy app anyway: the Flexprice connection uses a legacy private app’s access token and client secret.
2

Create a private app

Click Create legacy app, then select Private. On the Basic info tab, enter a name such as Flexprice.
3

Add the scopes

On the Scopes tab, click Add new scope and select the scopes for the syncs you plan to use, listed in the table below. Click Update.
4

Create the app

Click Create app, review the notice about the access token, then click Continue creating.

HubSpot scopes for each Flexprice sync

The Connect HubSpot sheet in Flexprice only reminds you to create a private app with the CRM contacts, line items, deals, and quotes scopes. Use the table above for the exact scopes each sync needs. Customer sync needs crm.objects.deals.read even when deal sync is off, to read each deal and its contacts. HubSpot prompts you to add it when you subscribe to deal events in Step 4.

Step 2: Copy the HubSpot access token and client secret

Open your app from Development → Legacy apps, then click the Auth tab.
Auth tab of the Flexprice legacy app in HubSpot, with the masked access token and client secret and their Show and Copy buttons

Step 3: Create the HubSpot connection in Flexprice

Connecting HubSpot from the Flexprice dashboard

1

Open the HubSpot integration

In the Flexprice dashboard, open Integrations and click Connect on the HubSpot card.
2

Enter the credentials

Fill in Connection name, then paste the Private app access token and Client secret from Step 2. Click Continue.
Connect HubSpot sheet on the Credentials step with the connection name, masked access token, and client secret
3

Choose what Flexprice pushes to HubSpot

On the Sync step, turn on Push invoices, Push deals, and Push quotes for the syncs you want. All three are off by default. Click Continue.
Sync step with the Push invoices, Push deals, and Push quotes switches
4

Copy the webhook URL

The Webhook step shows the webhook URL and the deal event HubSpot needs to send. Click the copy icon next to Webhook URL: you paste it into HubSpot in Step 4.
Webhook step with the Flexprice webhook URL and the dealstage deal.propertyChange event to subscribe to
5

Save the connection

Click Connect HubSpot. The HubSpot card moves under Connected on the Integrations page.
Integrations page with the HubSpot card under Connected

Creating the HubSpot connection with the API

If you leave out sync_config, every sync is off. Deals and quotes only sync outbound, so Flexprice rejects inbound: true for either of them.

Step 4: Subscribe HubSpot to deal events

Customer sync starts when HubSpot sends a deal event to Flexprice. Set this up in the same private app:
1

Open the webhook settings

In HubSpot, open your app, click Edit app in the top right, then open the Webhooks tab.
2

Set the target URL

Under Target URL, paste the webhook URL you copied in Step 3. It has this format:
Copy it from the connection drawer rather than typing it, because the host depends on your Flexprice region. HubSpot already shows https:// in front of the field, so paste the rest of the URL after it.
3

Subscribe to deal stage changes

Click Create subscription. In the panel, choose Deal under Which object types?, Property changed under Listen for which events?, and dealstage under Which properties?. Click Subscribe.Leave Use expanded object support? off. It switches HubSpot to generic event types, and Flexprice only reads deal.propertyChange and deal.creation.
Create new webhook subscriptions panel in HubSpot, with Deal, Property changed, and dealstage selected
4

Commit the changes

The subscription appears under Event subscriptions as dealstage changed, with the subscription type deal.propertyChange. Click Commit changes in the top right.
Webhooks tab of the HubSpot app, with the Flexprice target URL and an active dealstage changed subscription on Deal

HubSpot deal events Flexprice handles

The connection drawer asks for the deal stage subscription only. Add the Created subscription if you want customers in Flexprice for every new deal, not only for won deals.
Flexprice matches the stage whose internal value is closedwon, which is the Closed won stage of HubSpot’s default sales pipeline. Deals that close in other pipelines have different stage IDs, so Flexprice does not import their contacts.
Flexprice answers every request from HubSpot with 200 OK, including requests it ignores or rejects, so HubSpot never retries them. A passing Test in HubSpot’s webhook panel only shows that the URL is reachable. To confirm that deal events are processed, close a test deal and check that its contacts appear as customers in Flexprice.

Changing HubSpot connection settings and credentials

To change the connection name or turn syncs on or off, open Integrations in the Flexprice dashboard and click Configure on the HubSpot card. The settings sheet does not show the access token or client secret.
HubSpot connection settings with the connection name, sync switches, webhook, and Disconnect, but no access token or client secret fields
To use a new access token or client secret, click Disconnect HubSpot in the same sheet, then connect HubSpot again with the new values. Links between Flexprice customers and HubSpot contacts, invoices, and line items are stored separately from the connection, so they are kept.
When you rotate the access token in HubSpot, choose Rotate and expire later. The old token keeps working for 7 days, which gives you time to recreate the connection before it expires.

Troubleshooting the HubSpot connection

To see what HubSpot sent and how Flexprice responded, open your app in HubSpot, click the Logs tab, then click Webhooks.

HubSpot sync guides

Customer sync

How contacts on HubSpot deals become Flexprice customers.

Quote sync

How draft subscriptions become draft HubSpot quotes.

Deal sync

How subscription line items and the deal amount reach the HubSpot deal.

Invoice sync

How finalized invoices are pushed to HubSpot.