Skip to main content

Actions

The ballerinax/hubspot.crm.commerce.quotes package exposes the following clients:

ClientPurpose
ClientManage HubSpot CRM quote objects: CRUD, batch operations, and search.

Client

Manage HubSpot CRM quote objects: CRUD, batch operations, and search.

Configuration

FieldTypeDefaultDescription
authhttp:BearerTokenConfig|OAuth2RefreshTokenGrantConfig|ApiKeysConfigRequiredAuthentication configuration: OAuth 2.0 refresh token, bearer token, or API keys.
httpVersionhttp:HttpVersionhttp:HTTP_2_0HTTP protocol version.
timeoutdecimal30Maximum time to wait for a response in seconds.
retryConfighttp:RetryConfig()Retry configuration for failed requests.
secureSockethttp:ClientSecureSocket()SSL/TLS configuration.
proxyhttp:ProxyConfig()Proxy server configuration.
compressionhttp:Compressionhttp:COMPRESSION_AUTOCompression handling configuration.
circuitBreakerhttp:CircuitBreakerConfig()Circuit breaker configuration for fault tolerance.
validationbooleantrueEnable inbound payload validation.

Initializing the client

import ballerinax/hubspot.crm.commerce.quotes as quotes;

configurable string clientId = ?;
configurable string clientSecret = ?;
configurable string refreshToken = ?;

quotes:Client quotesClient = check new ({
auth: {
clientId: clientId,
clientSecret: clientSecret,
refreshToken: refreshToken,
credentialBearer: oauth2:POST_BODY_BEARER
}
});

Operations

Quote CRUD

List

Signature: get /

Retrieves a paginated list of quotes with optional property selection and association expansion.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoOptional HTTP headers.
queriesGetCrmV3ObjectsQuotesGetPageQueriesNoQuery parameters including limit, after, properties, associations, and archived.

Returns: CollectionResponseSimplePublicObjectWithAssociationsForwardPaging|error

Sample code:

CollectionResponseSimplePublicObjectWithAssociationsForwardPaging response =
check quotesClient->/.get();

Sample response:

{
"results": [
{
"id": "12345678901",
"properties": {
"hs_title": "Annual SEO Package",
"hs_expiration_date": "2026-12-31",
"hs_currency": "USD",
"hs_createdate": "2026-01-15T10:30:00.000Z",
"hs_lastmodifieddate": "2026-01-15T10:30:00.000Z"
},
"createdAt": "2026-01-15T10:30:00.000Z",
"updatedAt": "2026-01-15T10:30:00.000Z",
"archived": false
}
],
"paging": {
"next": {
"after": "12345678902"
}
}
}
Create

Signature: post /

Creates a new quote with specified properties and optional associations to other CRM objects.

Parameters:

NameTypeRequiredDescription
payloadSimplePublicObjectInputForCreateYesQuote properties and associations.
headersmap<string|string[]>NoOptional HTTP headers.

Returns: SimplePublicObject|error

Sample code:

SimplePublicObject response = check quotesClient->/.post({
properties: {
"hs_title": "Annual SEO Audit Package",
"hs_expiration_date": "2026-12-31",
"hs_currency": "USD"
},
associations: []
});

Sample response:

{
"id": "12345678901",
"properties": {
"hs_title": "Annual SEO Audit Package",
"hs_expiration_date": "2026-12-31",
"hs_currency": "USD",
"hs_createdate": "2026-03-18T08:00:00.000Z",
"hs_lastmodifieddate": "2026-03-18T08:00:00.000Z"
},
"createdAt": "2026-03-18T08:00:00.000Z",
"updatedAt": "2026-03-18T08:00:00.000Z",
"archived": false
}
Read

Signature: get /[string quoteId]

Retrieves a single quote by its ID with optional property selection and association expansion.

Parameters:

NameTypeRequiredDescription
quoteIdstringYesThe ID of the quote to retrieve.
headersmap<string|string[]>NoOptional HTTP headers.
queriesGetCrmV3ObjectsQuotesQuoteIdGetByIdQueriesNoQuery parameters including properties, associations, and archived.

Returns: SimplePublicObjectWithAssociations|error

Sample code:

SimplePublicObjectWithAssociations response =
check quotesClient->/[quoteId].get();

Sample response:

{
"id": "12345678901",
"properties": {
"hs_title": "Annual SEO Audit Package",
"hs_expiration_date": "2026-12-31",
"hs_currency": "USD",
"hs_createdate": "2026-03-18T08:00:00.000Z",
"hs_lastmodifieddate": "2026-03-18T08:00:00.000Z"
},
"createdAt": "2026-03-18T08:00:00.000Z",
"updatedAt": "2026-03-18T08:00:00.000Z",
"archived": false
}
Update

Signature: patch /[string quoteId]

Updates an existing quote's properties by its ID.

Parameters:

NameTypeRequiredDescription
quoteIdstringYesThe ID of the quote to update.
payloadSimplePublicObjectInputYesQuote properties to update.
headersmap<string|string[]>NoOptional HTTP headers.
queriesPatchCrmV3ObjectsQuotesQuoteIdUpdateQueriesNoQuery parameters including idProperty.

Returns: SimplePublicObject|error

Sample code:

SimplePublicObject response = check quotesClient->/[quoteId].patch({
properties: {
"hs_title": "Updated SEO Audit Package",
"hs_expiration_date": "2027-06-30"
}
});

Sample response:

{
"id": "12345678901",
"properties": {
"hs_title": "Updated SEO Audit Package",
"hs_expiration_date": "2027-06-30",
"hs_currency": "USD",
"hs_createdate": "2026-03-18T08:00:00.000Z",
"hs_lastmodifieddate": "2026-03-18T09:15:00.000Z"
},
"createdAt": "2026-03-18T08:00:00.000Z",
"updatedAt": "2026-03-18T09:15:00.000Z",
"archived": false
}
Archive

Signature: delete /[string quoteId]

Archives (soft-deletes) a quote by its ID.

Parameters:

NameTypeRequiredDescription
quoteIdstringYesThe ID of the quote to archive.
headersmap<string|string[]>NoOptional HTTP headers.

Returns: error?

Sample code:

check quotesClient->/[quoteId].delete();

Batch operations

Read a batch of quotes by internal ID, or unique property values

Signature: post /batch/read

Reads multiple quotes by their IDs or unique property values in a single request.

Parameters:

NameTypeRequiredDescription
payloadBatchReadInputSimplePublicObjectIdYesBatch read input with quote IDs, properties to return, and optional ID property.
headersmap<string|string[]>NoOptional HTTP headers.
queriesPostCrmV3ObjectsQuotesBatchReadReadQueriesNoQuery parameters including archived.

Returns: BatchResponseSimplePublicObject|BatchResponseSimplePublicObjectWithErrors|error

Sample code:

BatchResponseSimplePublicObject|BatchResponseSimplePublicObjectWithErrors response =
check quotesClient->/batch/read.post({
inputs: [
{id: quoteId1},
{id: quoteId2}
],
properties: ["hs_title", "hs_expiration_date", "hs_currency"],
propertiesWithHistory: []
});

Sample response:

{
"status": "COMPLETE",
"results": [
{
"id": "12345678901",
"properties": {
"hs_title": "Annual SEO Audit Package",
"hs_expiration_date": "2026-12-31",
"hs_currency": "USD"
},
"createdAt": "2026-03-18T08:00:00.000Z",
"updatedAt": "2026-03-18T08:00:00.000Z",
"archived": false
},
{
"id": "12345678902",
"properties": {
"hs_title": "Quarterly Content Package",
"hs_expiration_date": "2026-06-30",
"hs_currency": "USD"
},
"createdAt": "2026-03-18T08:00:00.000Z",
"updatedAt": "2026-03-18T08:00:00.000Z",
"archived": false
}
],
"startedAt": "2026-03-18T08:00:00.000Z",
"completedAt": "2026-03-18T08:00:00.100Z"
}
Create a batch of quotes

Signature: post /batch/create

Creates multiple quotes in a single request.

Parameters:

NameTypeRequiredDescription
payloadBatchInputSimplePublicObjectInputForCreateYesBatch input containing an array of quote creation payloads.
headersmap<string|string[]>NoOptional HTTP headers.

Returns: BatchResponseSimplePublicObject|BatchResponseSimplePublicObjectWithErrors|error

Sample code:

BatchResponseSimplePublicObject|BatchResponseSimplePublicObjectWithErrors response =
check quotesClient->/batch/create.post({
inputs: [
{
properties: {
"hs_title": "Q1 Marketing Package",
"hs_expiration_date": "2026-06-30",
"hs_currency": "USD"
},
associations: []
},
{
properties: {
"hs_title": "Q2 Consulting Package",
"hs_expiration_date": "2026-09-30",
"hs_currency": "USD"
},
associations: []
}
]
});

Sample response:

{
"status": "COMPLETE",
"results": [
{
"id": "12345678903",
"properties": {
"hs_title": "Q1 Marketing Package",
"hs_expiration_date": "2026-06-30",
"hs_currency": "USD"
},
"createdAt": "2026-03-18T08:00:00.000Z",
"updatedAt": "2026-03-18T08:00:00.000Z",
"archived": false
},
{
"id": "12345678904",
"properties": {
"hs_title": "Q2 Consulting Package",
"hs_expiration_date": "2026-09-30",
"hs_currency": "USD"
},
"createdAt": "2026-03-18T08:00:00.000Z",
"updatedAt": "2026-03-18T08:00:00.000Z",
"archived": false
}
],
"startedAt": "2026-03-18T08:00:00.000Z",
"completedAt": "2026-03-18T08:00:00.100Z"
}
Update a batch of quotes by internal ID, or unique property values

Signature: post /batch/update

Updates multiple quotes' properties in a single request.

Parameters:

NameTypeRequiredDescription
payloadBatchInputSimplePublicObjectBatchInputYesBatch input containing an array of quote update payloads with IDs.
headersmap<string|string[]>NoOptional HTTP headers.

Returns: BatchResponseSimplePublicObject|BatchResponseSimplePublicObjectWithErrors|error

Sample code:

BatchResponseSimplePublicObject|BatchResponseSimplePublicObjectWithErrors response =
check quotesClient->/batch/update.post({
inputs: [
{
id: quoteId1,
properties: {
"hs_title": "Updated Q1 Marketing Package"
}
},
{
id: quoteId2,
properties: {
"hs_title": "Updated Q2 Consulting Package"
}
}
]
});

Sample response:

{
"status": "COMPLETE",
"results": [
{
"id": "12345678903",
"properties": {
"hs_title": "Updated Q1 Marketing Package",
"hs_expiration_date": "2026-06-30",
"hs_currency": "USD"
},
"createdAt": "2026-03-18T08:00:00.000Z",
"updatedAt": "2026-03-18T09:30:00.000Z",
"archived": false
},
{
"id": "12345678904",
"properties": {
"hs_title": "Updated Q2 Consulting Package",
"hs_expiration_date": "2026-09-30",
"hs_currency": "USD"
},
"createdAt": "2026-03-18T08:00:00.000Z",
"updatedAt": "2026-03-18T09:30:00.000Z",
"archived": false
}
],
"startedAt": "2026-03-18T09:30:00.000Z",
"completedAt": "2026-03-18T09:30:00.100Z"
}
Create or update a batch of quotes by unique property values

Signature: post /batch/upsert

Creates or updates multiple quotes in a single request based on unique property values.

Parameters:

NameTypeRequiredDescription
payloadBatchInputSimplePublicObjectBatchInputUpsertYesBatch input containing an array of quote upsert payloads.
headersmap<string|string[]>NoOptional HTTP headers.

Returns: BatchResponseSimplePublicUpsertObject|BatchResponseSimplePublicUpsertObjectWithErrors|error

Sample code:

BatchResponseSimplePublicUpsertObject|BatchResponseSimplePublicUpsertObjectWithErrors response =
check quotesClient->/batch/upsert.post({
inputs: [
{
id: "unique-quote-ref-001",
idProperty: "hs_unique_id",
properties: {
"hs_title": "Upserted SEO Package",
"hs_expiration_date": "2026-12-31",
"hs_currency": "USD"
}
}
]
});

Sample response:

{
"status": "COMPLETE",
"results": [
{
"id": "12345678905",
"properties": {
"hs_title": "Upserted SEO Package",
"hs_expiration_date": "2026-12-31",
"hs_currency": "USD"
},
"createdAt": "2026-03-18T10:00:00.000Z",
"updatedAt": "2026-03-18T10:00:00.000Z",
"archived": false,
"new": true
}
],
"startedAt": "2026-03-18T10:00:00.000Z",
"completedAt": "2026-03-18T10:00:00.100Z"
}
Archive a batch of quotes by ID

Signature: post /batch/archive

Archives multiple quotes in a single request.

Parameters:

NameTypeRequiredDescription
payloadBatchInputSimplePublicObjectIdYesBatch input containing an array of quote IDs to archive.
headersmap<string|string[]>NoOptional HTTP headers.

Returns: error?

Sample code:

check quotesClient->/batch/archive.post({
inputs: [
{id: quoteId1},
{id: quoteId2}
]
});
Search

Signature: post /search

Searches for quotes using filters, query strings, sorting, and property selection.

Parameters:

NameTypeRequiredDescription
payloadPublicObjectSearchRequestYesSearch request with optional query, filters, sorts, properties, limit, and pagination.
headersmap<string|string[]>NoOptional HTTP headers.

Returns: CollectionResponseWithTotalSimplePublicObjectForwardPaging|error

Sample code:

CollectionResponseWithTotalSimplePublicObjectForwardPaging response =
check quotesClient->/search.post({
filterGroups: [
{
filters: [
{
propertyName: "hs_currency",
operator: "EQ",
value: "USD"
}
]
}
],
properties: ["hs_title", "hs_expiration_date", "hs_currency"],
limit: 10
});

Sample response:

{
"total": 2,
"results": [
{
"id": "12345678901",
"properties": {
"hs_title": "Annual SEO Audit Package",
"hs_expiration_date": "2026-12-31",
"hs_currency": "USD"
},
"createdAt": "2026-03-18T08:00:00.000Z",
"updatedAt": "2026-03-18T08:00:00.000Z",
"archived": false
},
{
"id": "12345678903",
"properties": {
"hs_title": "Q1 Marketing Package",
"hs_expiration_date": "2026-06-30",
"hs_currency": "USD"
},
"createdAt": "2026-03-18T08:00:00.000Z",
"updatedAt": "2026-03-18T08:00:00.000Z",
"archived": false
}
],
"paging": {
"next": {
"after": "12345678904"
}
}
}