Square: Batch Retrieve Catalog Objects
Square catalog.batchRetrieveCatalogObjects: arguments, response, policy and SDK examples.
← Catalog operations · Get started
Operation square.batchretrievecatalogobjects
Provider route: POST /v2/catalog/batch-retrieve. Alter supplies the connection’s credentials and routing.
Call through Alter
Section titled “Call through Alter”Install @alter-ai/sdk @alter-ai/square with npm, or alter-sdk-square with pip. Supply your connected customer’s grant ID and the arguments described below.
import { App } from "@alter-ai/sdk";import { SquareIntegration } from "@alter-ai/square";
async function execute(input: Parameters<SquareIntegration["catalog"]["batchRetrieveCatalogObjects"]>[0]) { const app = new App({ apiKey: process.env.ALTER_API_KEY! }); try { const provider = new SquareIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! }); const call = await provider.catalog.batchRetrieveCatalogObjects(input); const result = await call.wait(); return result.bodyJson(); } finally { await app.close(); }}import osfrom alter_sdk import Appfrom alter_sdk_square import SquareIntegration
async def execute(arguments): async with App(api_key=os.environ["ALTER_API_KEY"]) as app: provider = SquareIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]}) call = await provider.catalog.batch_retrieve_catalog_objects(arguments) result = await call.wait() return result.body_json()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
body | Model | Required within parent | Expand Batch Retrieve Catalog Objects — request body — body |
Referenced models: Batch Retrieve Catalog Objects — request body — body
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 Batch Retrieve Catalog Objects — response body |
Referenced models: Batch Retrieve Catalog Objects — response body
Schemas
Section titled “Schemas”49 more schemas are linked from the tables above, on the schema pages.
Batch Retrieve Catalog Objects — request body — body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
catalog_version | JSON | Optional | |
catalog_version (anyOf 1) | JSON | Alternative | |
catalog_version (anyOf 1) (anyOf 1) | integer | Alternative | The specific version of the catalog objects to be included in the response. This allows you to retrieve historical versions of objects. The specified version value is matched against the [CatalogObject](entity:CatalogObject)s' `version` attribute. If not included, results will be from the current version of the catalog. Format: int64 Minimum: -9223372036854775808 Maximum: 9223372036854775807 |
catalog_version (anyOf 1) (anyOf 2) | string | Alternative | Pattern: ^(?:-(?:1[0-9]{18}|[2-8][0-9]{18}|9(?:0[0-9]{17}|1[0-9]{17}|2(?:0[0-9]{16}|1[0-9]{16}|2(?:0[0-9]{15}|[1-2][0-9]{15}|3(?:0[0-9]{14}|[1-2][0-9]{14}|3(?:0[0-9]{13}|[1-6][0-9]{13}|7(?:0[0-9]{12}|1[0-9]{12}|20(?:0[0-9]{10}|[1-2][0-9]{10}|3(?:0[0-9]{9}|[1-5][0-9]{9}|6(?:0[0-9]{8}|[1-7][0-9]{8}|8(?:0[0-9]{7}|[1-4][0-9]{7}|5(?:0[0-9]{6}|[1-3][0-9]{6}|4(?:0[0-9]{5}|[1-6][0-9]{5}|7(?:0[0-9]{4}|[1-6][0-9]{4}|7(?:0[0-9]{3}|[1-4][0-9]{3}|5(?:0[0-9]{2}|[1-7][0-9]{2}|80[0-8]))))))))))))))))|-[1-9][0-9]{0,17}|0|(?:1[0-9]{18}|[2-8][0-9]{18}|9(?:0[0-9]{17}|1[0-9]{17}|2(?:0[0-9]{16}|1[0-9]{16}|2(?:0[0-9]{15}|[1-2][0-9]{15}|3(?:0[0-9]{14}|[1-2][0-9]{14}|3(?:0[0-9]{13}|[1-6][0-9]{13}|7(?:0[0-9]{12}|1[0-9]{12}|20(?:0[0-9]{10}|[1-2][0-9]{10}|3(?:0[0-9]{9}|[1-5][0-9]{9}|6(?:0[0-9]{8}|[1-7][0-9]{8}|8(?:0[0-9]{7}|[1-4][0-9]{7}|5(?:0[0-9]{6}|[1-3][0-9]{6}|4(?:0[0-9]{5}|[1-6][0-9]{5}|7(?:0[0-9]{4}|[1-6][0-9]{4}|7(?:0[0-9]{3}|[1-4][0-9]{3}|5(?:0[0-9]{2}|[1-7][0-9]{2}|80[0-7]))))))))))))))))|[1-9][0-9]{0,17})$(?!\n) |
catalog_version (anyOf 2) | null | Alternative | |
include_category_path_to_root | JSON | Optional | |
include_category_path_to_root (anyOf 1) | boolean | Alternative | Specifies whether or not to include the `path_to_root` list for each returned category instance. The `path_to_root` list consists of `CategoryPathToRootNode` objects and specifies the path that starts with the immediate parent category of the returned category and ends with its root category. If the returned category is a top-level category, the `path_to_root` list is empty and is not returned in the response payload. |
include_category_path_to_root (anyOf 2) | null | Alternative | |
include_deleted_objects | JSON | Optional | |
include_deleted_objects (anyOf 1) | boolean | Alternative | Indicates whether to include (`true`) or not (`false`) in the response deleted objects, namely, those with the `is_deleted` attribute set to `true`. |
include_deleted_objects (anyOf 2) | null | Alternative | |
include_options | JSON | Optional | |
include_options (anyOf 1) | Model | Alternative | Expand Search Catalog Items — request body — body include options Options to include related resources in the response. |
include_options (anyOf 2) | null | Alternative | |
include_related_objects | JSON | Optional | |
include_related_objects (anyOf 1) | boolean | Alternative | If `true`, the response will include additional objects that are related to the requested objects. Related objects are defined as any objects referenced by ID by the results in the `objects` field of the response. These objects are put in the `related_objects` field. Setting this to `true` is helpful when the objects are needed for immediate display to a user. This process only goes one level deep. Objects referenced by the related objects will not be included. For example, if the `objects` field of the response contains a CatalogItem, its associated CatalogCategory objects, CatalogTax objects, CatalogImage objects and CatalogModifierLists will be returned in the `related_objects` field of the response. If the `objects` field of the response contains a CatalogItemVariation, its parent CatalogItem will be returned in the `related_objects` field of the response. Default value: `false` |
include_related_objects (anyOf 2) | null | Alternative | |
object_ids | array | Required within parent | The IDs of the CatalogObjects to be retrieved. |
object_ids[] | string | Each item |
Referenced models: Search Catalog Items — request body — body include options
Batch Retrieve Catalog Objects — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
errors | array | Optional | Any errors that occurred during the request. |
errors[] | Model | Each item | Expand Get Shift — response body — errors item |
included_resources | Model | Optional | Expand Search Catalog Items — response body — included resources A list of [CatalogObject](entity:CatalogObject)s referenced by the object in the `objects` field and specifically requested. |
objects | array | Optional | A list of [CatalogObject](entity:CatalogObject)s returned. |
objects[] | Model | Each item | Expand Create Catalog Image — response body — image |
related_objects | array | Optional | A list of [CatalogObject](entity:CatalogObject)s referenced by the object in the `objects` field. |
related_objects[] | Model | Each item | Expand Create Catalog Image — response body — image |
Referenced models: Create Catalog Image — response body — image, Get Shift — response body — errors item, Search Catalog Items — response body — included resources
Search Catalog Items — request body — body include options
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Options to include related resources of the requested `CatalogObject`s. Related resources will be included in `IncludedResources` in the response. |
include | JSON | Optional | |
include (anyOf 1) | array | Alternative | Resources to include in the response. See [IncludeType](#type-includetype) for possible values |
include (anyOf 1)[] | string | Each item | Related resources of requested `CatalogObject`s to include as part of the response. One of: INCLUDE_NESTED_MODIFIERS, INCLUDE_ANCESTOR_MODIFIERS |
include (anyOf 2) | null | Alternative |
Get Shift — response body — errors item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents an error encountered during a request to the Connect API. See [Handling errors](https://developer.squareup.com/docs/build-basics/handling-errors) for more information. |
category | string | Required within parent | Indicates which high-level category of error has occurred during a request to the Connect API. The high-level category for the error. See [ErrorCategory](#type-errorcategory) for possible values Known values: API_ERROR, AUTHENTICATION_ERROR, INVALID_REQUEST_ERROR, RATE_LIMIT_ERROR, PAYMENT_METHOD_ERROR, REFUND_ERROR, MERCHANT_SUBSCRIPTION_ERROR, EXTERNAL_VENDOR_ERROR |
code | Model | Required within parent | Expand Get Shift — response body — errors item code The specific code of the error. See [ErrorCode](#type-errorcode) for possible values |
detail | string | Optional | A human-readable description of the error for debugging purposes. |
field | string | Optional | The name of the field provided in the original request (if any) that the error pertains to. |
Referenced models: Get Shift — response body — errors item code
Search Catalog Items — response body — included resources
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Related resources of the response `CatalogObject`s requested using `IncludeOptions` |
ancestor_modifiers | JSON | Optional | |
ancestor_modifiers (anyOf 1) | array | Alternative | Ancestor `CatalogModifierList`s as requested via INCLUDE_ANCESTOR_MODIFIERS |
ancestor_modifiers (anyOf 1)[] | Model | Each item | Expand Create Catalog Image — response body — image |
ancestor_modifiers (anyOf 2) | null | Alternative | |
nested_modifiers | JSON | Optional | |
nested_modifiers (anyOf 1) | array | Alternative | Nested `CatalogModifierList`s as requested via `INCLUDE_NESTED_MODIFIERS`. |
nested_modifiers (anyOf 1)[] | Model | Each item | Expand Create Catalog Image — response body — image |
nested_modifiers (anyOf 2) | null | Alternative |
Referenced models: Create Catalog Image — response body — image
Create Catalog Image — response body — image type
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | string | Root | Possible types of CatalogObjects returned from the catalog, each containing type-specific properties in the `*_data` field corresponding to the specified object type. Known values: ITEM, IMAGE, CATEGORY, ITEM_VARIATION, TAX, DISCOUNT, MODIFIER_LIST, MODIFIER, PRICING_RULE, PRODUCT_SET, TIME_PERIOD, MEASUREMENT_UNIT, SUBSCRIPTION_PLAN_VARIATION, ITEM_OPTION, ITEM_OPTION_VAL, CUSTOM_ATTRIBUTE_DEFINITION, QUICK_AMOUNTS_SETTINGS, SUBSCRIPTION_PLAN, AVAILABILITY_PERIOD |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: square.batchretrievecatalogobjects. Catalog operation: BatchRetrieveCatalogObjects. 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: ["ITEMS_READ"]
Pinned headers: {"Square-Version": "2026-11-18"}