HubSpot: Retrieve price books
HubSpot priceBooks.getPriceBooks: arguments, response, policy and SDK examples.
← Price books operations · Get started
Operation hubspot.price_books_get_price_books
Provider route: GET /commerce/price-books/2026-09/price-books. Alter supplies the connection’s credentials and routing.
Call through Alter
Section titled “Call through Alter”Install @alter-ai/sdk @alter-ai/hubspot with npm, or alter-sdk-hubspot with pip. Supply your connected customer’s grant ID and the arguments described below.
import { App } from "@alter-ai/sdk";import { HubSpotIntegration } from "@alter-ai/hubspot";
async function execute(input: Parameters<HubSpotIntegration["priceBooks"]["getPriceBooks"]>[0]) { const app = new App({ apiKey: process.env.ALTER_API_KEY! }); try { const provider = new HubSpotIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! }); const call = await provider.priceBooks.getPriceBooks(input); const result = await call.wait(); return result.bodyJson(); } finally { await app.close(); }}import osfrom alter_sdk import Appfrom alter_sdk_hubspot import HubSpotIntegration
async def execute(arguments): async with App(api_key=os.environ["ALTER_API_KEY"]) as app: provider = HubSpotIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]}) call = await provider.price_books.get_price_books(arguments) result = await call.wait() return result.body_json()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
query | object | Optional | Additional keys: not allowed |
query.after | string | Optional | |
query.archived | boolean | Optional | |
query.limit | integer | Optional | Format: int32 |
Response
Section titled “Response”Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | Model | Root | Expand Retrieve price books — response body |
Referenced models: Retrieve price books — response body
Schemas
Section titled “Schemas”Retrieve price books — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
paging | Model | Optional | Expand Retrieve price books — response body — paging |
results | array | Required within parent | An array of price book objects, each represented by the PriceBookResponse schema. |
results[] | Model | Each item | Expand Create price book — response body |
Referenced models: Create price book — response body, Retrieve price books — response body — paging
Create price book — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
archived | boolean | Optional | A boolean indicating whether this price book is archived. |
archivedAt | string | Optional | The date and time when this price book was archived. Format: date-time |
autoAssignmentEnabled | boolean | Required within parent | Indicates whether auto-assignment is enabled for the price book. A boolean value. |
countOfIncludedProducts | JSON | Required within parent | |
countOfIncludedProducts (anyOf 1) | integer | Alternative | The number of products included in this price book. Format: int32 |
countOfIncludedProducts (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
createdAt | string | Optional | The date and time when this price book was created. Format: date-time |
customProperties | object | Required within parent | A map of custom property names to their values for this price book. Additional keys: see wildcard field |
customProperties.* | string | Additional keys | |
description | string | Optional | A description of the price book. |
id | string | Required within parent | The unique identifier for this price book. |
name | string | Optional | The name of the price book. |
status | string | Required within parent | The current status of the price book. Valid values include 'ACTIVE' and 'INACTIVE'. Known values: ACTIVE, INACTIVE |
supportedCurrencies | array | Required within parent | An array of currency codes that this price book supports. |
supportedCurrencies[] | string | Each item | |
updatedAt | string | Optional | The date and time when this price book was last updated. Format: date-time |
Retrieve price books — response body — paging
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Paging information for forward-only pagination. Contains the next page reference when more results are available; omitted or empty on the last page. |
next | Model | Optional | Expand Retrieve price books — response body — paging next |
Referenced models: Retrieve price books — response body — paging next
Retrieve price books — response body — paging next
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Specifies the paging information needed to retrieve the next set of results in a paginated API response |
after | string | Required within parent | A string token used as a cursor for pagination to retrieve the next set of results. |
link | string | Optional | A string URL that provides a direct link to the next page of results. |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: hubspot.price_books_get_price_books. Catalog operation: price_books_get_price_books. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.
Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.
Required provider scopes: ["cpq.price_books.read"]