ballerinax/hubspot.crm.product Ballerina library

Deprecated2.4.0

Deprecation Notice: This connector is deprecated and will no longer be maintained or updated. Use ballerinax/hubspot.crm.obj.products instead. For association operations, use ballerinax/hubspot.crm.associations.

Overview

The HubSpot connector(https://www.hubspot.com/) OpenAPI specification.

This API provides access to collections of CRM objects, which return a map of property names to values. Each object type has its own set of default properties, which can be found by exploring the CRM Object Properties API.

Key Features

  • Programmatic access to create and manage resources via REST API
  • Handle payments, billing, and financial transactions
  • Manage user accounts and profiles
  • Support for webhooks and event-driven workflows

Prerequisites

Before using this connector in your Ballerina application, complete the following:

  • Create a HubSpot developer account
  • Obtain tokens
    • Use this guide to obtain the credentials which are needed to create the <CLIENT_ID> and <CLIENT_SECRET>

Quickstart

To use the HubSpot CRM Products connector in your Ballerina application, update the .bal file as follows:

Step 1 - Import connector

First, import the ballerinax/hubspot.crm.product module into the Ballerina project.

Copy
import ballerinax/hubspot.crm.product;

Step 2 - Create a new connector instance

You can now make the connection configuration using the access token.

Copy
product:ClientConfig clientConfig = {
    auth : {
        token: <ACCESS_TOKEN>
    }
};

product:Client baseClient = check new Client(clientConfig);

Step 3 - Invoke connector operation

  1. Create a product instance
Copy
product:SimplePublicObjectInput product = {
    properties : {
        "description": "Onboarding service for data product",
        "hs_cost_of_goods_sold": "600.00",
        "hs_recurring_billing_period": "P12M",
        "hs_sku": "191902",
        "name": "Implementation Service ",
        "price": "6000.00"
    }      
};

product:SimplePublicObject|error bEvent = baseClient->create(product);

if (bEvent is product:SimplePublicObject) {
    log:printInfo("Created the product" + bEvent.toString());
} else {
    log:printError(msg = bEvent.message());
}
  1. List product instances
Copy
product:SimplePublicObjectWithAssociationsArray|error bEvent = baseClient->getPage();

if (bEvent is product:SimplePublicObjectWithAssociationsArray) {
    log:printInfo("Product list" + bEvent.toString());
} else {
    log:printError(msg = bEvent.message());
}
  1. Use bal run command to compile and run the Ballerina program

Import

import ballerinax/hubspot.crm.product;Copy

Other versions

See more...

Metadata

Released date: 11 days ago

Version: 2.4.0

License: Apache-2.0


Compatibility

Platform: any

Ballerina version: 2201.8.0

GraalVM compatible: Yes


Pull count

Total: 22

Current verison: 0


Weekly downloads


Source repository


Keywords

Type/Connector

Vendor/HubSpot

Area/CRM & Sales

Sales & CRM/Customer Relationship Management

Cost/Freemium


Contributors