Square: Create Catalog Image
Square catalog.createCatalogImage: arguments, response, policy and SDK examples.
← Catalog operations · Get started
Operation square.createcatalogimage
Provider route: POST /v2/catalog/images. 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"]["createCatalogImage"]>[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.createCatalogImage(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.create_catalog_image(arguments) result = await call.wait() return result.body_json()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
body | object | Required within parent | |
body.request | Model | Required within parent | Expand Create Catalog Image — request body — body request |
body.file | object | Required within parent | Additional keys: not allowed |
body.file.filename | string | Required within parent | Minimum length: 1 |
body.file.content_type | string | Required within parent | One of: image/gif, image/jpeg, image/pjpeg, image/png |
body.file.content_base64 | string | Required within parent |
Referenced models: Create Catalog Image — request body — body request
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 Create Catalog Image — response body |
Referenced models: Create Catalog Image — response body
Schemas
Section titled “Schemas”86 more schemas are linked from the tables above, on the schema pages.
Create Catalog Image — request body — body request
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
idempotency_key | string | Required within parent | A unique string that identifies this CreateCatalogImage request. Keys can be any valid string but must be unique for every CreateCatalogImage request. See [Idempotency keys](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) for more information. Maximum length: 128 Minimum length: 1 |
image | Model | Required within parent | Expand Upsert Catalog Object — request body — body object The new `CatalogObject` of the `IMAGE` type, namely, a `CatalogImage` object, to encapsulate the specified image file. |
is_primary | boolean | Optional | If this is set to `true`, the image created will be the primary, or first image of the object referenced by `object_id`. If the `CatalogObject` already has a primary `CatalogImage`, setting this field to `true` will replace the primary image. If this is set to `false` and you use the Square API version 2021-12-15 or later, the image id will be appended to the list of `image_ids` on the object. With Square API version 2021-12-15 or later, the default value is `false`. Otherwise, the effective default value is `true`. |
object_id | string | Optional | Unique ID of the `CatalogObject` to attach this `CatalogImage` object to. Leave this field empty to create unattached images, for example if you are building an integration where an image can be attached to catalog items at a later time. |
Referenced models: Upsert Catalog Object — request body — body object
Create Catalog Image — 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 |
image | Model | Optional | Expand Create Catalog Image — response body — image The newly created `CatalogImage` including a Square-generated URL for the encapsulated image file. |
Referenced models: Create Catalog Image — response body — image, Get Shift — response body — errors item
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
Upsert Catalog Object — request body — body object availability period data Represents a time period of availability
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents a time period of availability. |
day_of_week | JSON | Optional | |
day_of_week (anyOf 1) | string | Alternative | Indicates the specific day of the week. The day of the week for this availability period. See [DayOfWeek](#type-dayofweek) for possible values One of: SUN, MON, TUE, WED, THU, FRI, SAT |
day_of_week (anyOf 2) | null | Alternative | |
end_local_time | JSON | Optional | |
end_local_time (anyOf 1) | string | Alternative | The end time of an availability period, specified in local time using partial-time RFC 3339 format. For example, `21:00:00` for a period ending at 9:00 in the evening. Note that the seconds value is always :00, but it is appended for conformance to the RFC. |
end_local_time (anyOf 2) | null | Alternative | |
start_local_time | JSON | Optional | |
start_local_time (anyOf 1) | string | Alternative | The start time of an availability period, specified in local time using partial-time RFC 3339 format. For example, `8:30:00` for a period starting at 8:30 in the morning. Note that the seconds value is always :00, but it is appended for conformance to the RFC. |
start_local_time (anyOf 2) | null | Alternative |
Upsert Catalog Object — request body — body object category data availability period ids, category type, channels, ecom seo data, image ids, is top level, name, online visibility, parent category, path to root, root category
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | A category to which a `CatalogItem` instance belongs. |
availability_period_ids | JSON | Optional | |
availability_period_ids (anyOf 1) | array | Alternative | The IDs of the `CatalogAvailabilityPeriod` objects associated with the category. |
availability_period_ids (anyOf 1)[] | string | Each item | |
availability_period_ids (anyOf 2) | null | Alternative | |
category_type | JSON | Optional | |
category_type (anyOf 1) | string | Alternative | Indicates the type of a category. The type of the category. See [CatalogCategoryType](#type-catalogcategorytype) for possible values One of: REGULAR_CATEGORY, MENU_CATEGORY, KITCHEN_CATEGORY |
category_type (anyOf 2) | null | Alternative | |
channels | JSON | Optional | |
channels (anyOf 1) | array | Alternative | A list of IDs representing channels, such as a Square Online site, where the category can be made visible. |
channels (anyOf 1)[] | string | Each item | |
channels (anyOf 2) | null | Alternative | |
ecom_seo_data | JSON | Optional | |
ecom_seo_data (anyOf 1) | Model | Alternative | Expand Create Catalog Image — response body — image category data availability period ids, category type, channels, ecom seo data, image ids, is top level, name, online visibility, parent category, path to root, root category ecom seo data SEO data for for a seller's Square Online store The SEO data for a seller's Square Online store. |
ecom_seo_data (anyOf 2) | null | Alternative | |
image_ids | JSON | Optional | |
image_ids (anyOf 1) | array | Alternative | The IDs of images associated with this `CatalogCategory` instance. Currently these images are not displayed by Square, but are free to be displayed in 3rd party applications. |
image_ids (anyOf 1)[] | string | Each item | |
image_ids (anyOf 2) | null | Alternative | |
is_top_level | JSON | Optional | |
is_top_level (anyOf 1) | boolean | Alternative | Indicates whether a category is a top level category, which does not have any parent_category. |
is_top_level (anyOf 2) | null | Alternative | |
name | JSON | Optional | |
name (anyOf 1) | string | Alternative | The category name. This is a searchable attribute for use in applicable query filters, and its value length is of Unicode code points. Maximum length: 255 |
name (anyOf 2) | null | Alternative | |
online_visibility | JSON | Optional | |
online_visibility (anyOf 1) | boolean | Alternative | Indicates whether the category is visible (`true`) or hidden (`false`) on all of the seller's Square Online sites. |
online_visibility (anyOf 2) | null | Alternative | |
parent_category | JSON | Optional | |
parent_category (anyOf 1) | Model | Alternative | Expand Upsert Catalog Object — request body — body object category data availability period ids, category type, channels, ecom seo data, image ids, is top level, name, online visibility, parent category, path to root, root category parent category id, ordinal The parent category of this category instance. This includes the parent category ID and an ordinal value that determines the category's relative position among sibling categories with the same parent. |
parent_category (anyOf 2) | null | Alternative | |
path_to_root | JSON | Optional | |
path_to_root (anyOf 1) | array | Alternative | The path from the category to its root category. The first node of the path is the parent of the category and the last is the root category. The path is empty if the category is a root category. |
path_to_root (anyOf 1)[] | Model | Each item | Expand Create Catalog Image — response body — image category data availability period ids, category type, channels, ecom seo data, image ids, is top level, name, online visibility, parent category, path to root, root category path to root array item |
path_to_root (anyOf 2) | null | Alternative | |
root_category | string | Optional | The top-level category in a category hierarchy. Read only: true |
Referenced models: Create Catalog Image — response body — image category data availability period ids, category type, channels, ecom seo data, image ids, is top level, name, online visibility, parent category, path to root, root category ecom seo data SEO data for for a seller's Square Online store, Upsert Catalog Object — request body — body object category data availability period ids, category type, channels, ecom seo data, image ids, is top level, name, online visibility, parent category, path to root, root category parent category id, ordinal, Create Catalog Image — response body — image category data availability period ids, category type, channels, ecom seo data, image ids, is top level, name, online visibility, parent category, path to root, root category path to root array item
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: square.createcatalogimage. Catalog operation: CreateCatalogImage. 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_WRITE"]
Pinned headers: {"Square-Version": "2026-11-18"}