Skip to content

HubSpot

Use LicenseKit with HubSpot when closed-won deals, line items, or workflow actions should issue and manage software licenses.

Who This Is For

  • sales and success teams working from HubSpot records
  • developers connecting HubSpot deal workflows to license fulfillment
  • operators who need license status visible on deals, companies, and contacts

When To Use This

Use the HubSpot integration when HubSpot should remain the CRM and workflow system while LicenseKit manages post-sale access.

Do not use it as a billing engine or generic digital-download workflow.

How It Works

The HubSpot integration can provision licenses from closed-won deals and mapped line items.

It can also expose workflow actions for lifecycle operations:

  • issue license
  • renew license
  • suspend license
  • reinstate license
  • sync license

Provisioning behavior:

  • one LicenseKit customer is created or reused from the company, contact, or deal context
  • one LicenseKit order is linked to the HubSpot deal
  • one LicenseKit license is created per mapped line item
  • quantity can map to seats unless a mapping or line-item metadata overrides it
  • HubSpot deal properties can store LicenseKit identifiers
  • CRM cards show linked LicenseKit state on deal, company, and contact records

The repo includes:

  • cmd/hubspot-integration
  • internal/integrations/hubspot
  • integrations/hubspot-project

The main serve command can mount these routes when HUBSPOT_INTEGRATION_ENABLED=true or the HubSpot integration environment is configured.

Key Routes

  • GET /hubspot/oauth/install
  • GET /hubspot/oauth/callback
  • POST /hubspot/webhook
  • POST /hubspot/workflows/issue-license
  • POST /hubspot/workflows/renew-license
  • POST /hubspot/workflows/suspend-license
  • POST /hubspot/workflows/reinstate-license
  • POST /hubspot/workflows/sync-license
  • GET /hubspot/cards/deal
  • GET /hubspot/cards/company
  • GET /hubspot/cards/contact
  • GET /hubspot/admin/mappings
  • POST /hubspot/admin/mappings

Configuration Shape

bash
HUBSPOT_INTEGRATION_ENABLED=true
HUBSPOT_PUBLIC_BASE_URL="https://api.licensekit.dev"
HUBSPOT_CLIENT_ID="..."
HUBSPOT_CLIENT_SECRET="..."
HUBSPOT_REDIRECT_URL="https://api.licensekit.dev/hubspot/oauth/callback"

LICENSEKIT_BASE_URL="https://api.licensekit.dev"
LICENSEKIT_API_TOKEN="..."
LICENSEKIT_DEFAULT_TERM_DAYS="365"
LICENSEKIT_APP_URL="https://app.licensekit.dev"

Use admin Basic auth for mapping routes. HubSpot-originated cards, workflows, and webhooks should use HubSpot request signature validation in production.

Common Mistakes

  • provisioning every closed-won deal without requiring a mapped product, SKU, or line item
  • using an oversized admin token permanently instead of narrowing scopes once the workflow is stable
  • skipping signature validation for production HubSpot calls
  • assuming CRM status protects the product without runtime validation inside the protected application

Prototype docs shell for the rewrite workspace.