Skip to main content

Setup Guide

This guide walks you through creating a HubSpot developer app and obtaining the OAuth 2.0 credentials required to use the HubSpot CRM Commerce Taxes connector.

Prerequisites​

Step 1: Log in to the HubSpot developer portal​

Log in to your HubSpot developer account.

Step 2: Create a HubSpot app​

  1. Select Create app from the developer portal.

    Create public appCreate public app
  2. Select Create app on the next screen.

    Create appCreate app
  3. Under App Info, enter a public app name and an optional logo and description.

    Enter app detailsEnter app details
  4. Go to the Auth tab and add your redirect URLs.

    Auth pageAuth page
  5. Select Create app.

Step 3: Get the client ID and client secret​

In the Auth tab, copy the Client ID and Client Secret.

Client ID and client secretClient ID and client secret

Step 4: Get the refresh token​

  1. In the Auth tab, add the required scopes based on the HubSpot API reference:

    • crm.objects.line_items.read
    • crm.objects.line_items.write
    • oauth
    API reference for scopesAPI reference for scopes
  2. Under Sample install URL (OAuth), copy the full URL and open it in a browser.

  3. Select the account to authorize.

    Choose accountChoose account
  4. Copy the authorization code from the redirect URL.

  5. Exchange the code for tokens:

    curl --request POST \
    --url https://api.hubapi.com/oauth/v1/token \
    --header 'content-type: application/x-www-form-urlencoded' \
    --data 'grant_type=authorization_code&code=<CODE>&redirect_uri=<YOUR_REDIRECT_URI>&client_id=<YOUR_CLIENT_ID>&client_secret=<YOUR_CLIENT_SECRET>'
  6. Copy the refresh_token from the response.

tip

Store the client ID, client secret, and refresh token securely. Use Ballerina's configurable feature and a Config.toml file to supply them at runtime.