Actions
The ballerinax/hubspot.crm.commerce.quotes package exposes the following clients:
| Client | Purpose |
|---|---|
Client | Manage HubSpot CRM quote objects: CRUD, batch operations, and search. |
Client
Manage HubSpot CRM quote objects: CRUD, batch operations, and search.
Configuration
| Field | Type | Default | Description |
|---|---|---|---|
auth | http:BearerTokenConfig|OAuth2RefreshTokenGrantConfig|ApiKeysConfig | Required | Authentication configuration: OAuth 2.0 refresh token, bearer token, or API keys. |
httpVersion | http:HttpVersion | http:HTTP_2_0 | HTTP protocol version. |
timeout | decimal | 30 | Maximum time to wait for a response in seconds. |
retryConfig | http:RetryConfig | () | Retry configuration for failed requests. |
secureSocket | http:ClientSecureSocket | () | SSL/TLS configuration. |
proxy | http:ProxyConfig | () | Proxy server configuration. |
compression | http:Compression | http:COMPRESSION_AUTO | Compression handling configuration. |
circuitBreaker | http:CircuitBreakerConfig | () | Circuit breaker configuration for fault tolerance. |
validation | boolean | true | Enable 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:
| Name | Type | Required | Description |
|---|---|---|---|
headers | map<string|string[]> | No | Optional HTTP headers. |
queries | GetCrmV3ObjectsQuotesGetPageQueries | No | Query 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:
| Name | Type | Required | Description |
|---|---|---|---|
payload | SimplePublicObjectInputForCreate | Yes | Quote properties and associations. |
headers | map<string|string[]> | No | Optional 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:
| Name | Type | Required | Description |
|---|---|---|---|
quoteId | string | Yes | The ID of the quote to retrieve. |
headers | map<string|string[]> | No | Optional HTTP headers. |
queries | GetCrmV3ObjectsQuotesQuoteIdGetByIdQueries | No | Query 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:
| Name | Type | Required | Description |
|---|---|---|---|
quoteId | string | Yes | The ID of the quote to update. |
payload | SimplePublicObjectInput | Yes | Quote properties to update. |
headers | map<string|string[]> | No | Optional HTTP headers. |
queries | PatchCrmV3ObjectsQuotesQuoteIdUpdateQueries | No | Query 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:
| Name | Type | Required | Description |
|---|---|---|---|
quoteId | string | Yes | The ID of the quote to archive. |
headers | map<string|string[]> | No | Optional 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:
| Name | Type | Required | Description |
|---|---|---|---|
payload | BatchReadInputSimplePublicObjectId | Yes | Batch read input with quote IDs, properties to return, and optional ID property. |
headers | map<string|string[]> | No | Optional HTTP headers. |
queries | PostCrmV3ObjectsQuotesBatchReadReadQueries | No | Query 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:
| Name | Type | Required | Description |
|---|---|---|---|
payload | BatchInputSimplePublicObjectInputForCreate | Yes | Batch input containing an array of quote creation payloads. |
headers | map<string|string[]> | No | Optional 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:
| Name | Type | Required | Description |
|---|---|---|---|
payload | BatchInputSimplePublicObjectBatchInput | Yes | Batch input containing an array of quote update payloads with IDs. |
headers | map<string|string[]> | No | Optional 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:
| Name | Type | Required | Description |
|---|---|---|---|
payload | BatchInputSimplePublicObjectBatchInputUpsert | Yes | Batch input containing an array of quote upsert payloads. |
headers | map<string|string[]> | No | Optional 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:
| Name | Type | Required | Description |
|---|---|---|---|
payload | BatchInputSimplePublicObjectId | Yes | Batch input containing an array of quote IDs to archive. |
headers | map<string|string[]> | No | Optional HTTP headers. |
Returns: error?
Sample code:
check quotesClient->/batch/archive.post({
inputs: [
{id: quoteId1},
{id: quoteId2}
]
});
Search
Search
Signature: post /search
Searches for quotes using filters, query strings, sorting, and property selection.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
payload | PublicObjectSearchRequest | Yes | Search request with optional query, filters, sorts, properties, limit, and pagination. |
headers | map<string|string[]> | No | Optional 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"
}
}
}