Skip to content

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.

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 os
from alter_sdk import App
from 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()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
bodyobjectRequired within parent
body.requestModelRequired within parentExpand Create Catalog Image — request body — body request
body.fileobjectRequired within parentAdditional keys: not allowed
body.file.filenamestringRequired within parentMinimum length: 1
body.file.content_typestringRequired within parentOne of: image/gif, image/jpeg, image/pjpeg, image/png
body.file.content_base64stringRequired within parent

Referenced models: Create Catalog Image — request body — body request

Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$ModelRootExpand Create Catalog Image — response body

Referenced models: Create Catalog Image — response body

86 more schemas are linked from the tables above, on the schema pages.

Create Catalog Image — request body — body request
FieldTypePresenceDescription and constraints
$objectRoot
idempotency_keystringRequired within parentA 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
imageModelRequired within parentExpand 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_primarybooleanOptionalIf 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_idstringOptionalUnique 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
FieldTypePresenceDescription and constraints
$objectRoot
errorsarrayOptionalAny errors that occurred during the request.
errors[]ModelEach itemExpand Get Shift — response body — errors item
imageModelOptionalExpand 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
FieldTypePresenceDescription and constraints
$objectRootRepresents 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.
categorystringRequired within parentIndicates 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
codeModelRequired within parentExpand Get Shift — response body — errors item code
The specific code of the error.
See [ErrorCode](#type-errorcode) for possible values
detailstringOptionalA human-readable description of the error for debugging purposes.
fieldstringOptionalThe 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
FieldTypePresenceDescription and constraints
$objectRootRepresents a time period of availability.
day_of_weekJSONOptional
day_of_week (anyOf 1)stringAlternativeIndicates 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)nullAlternative
end_local_timeJSONOptional
end_local_time (anyOf 1)stringAlternativeThe 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)nullAlternative
start_local_timeJSONOptional
start_local_time (anyOf 1)stringAlternativeThe 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)nullAlternative
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
FieldTypePresenceDescription and constraints
$objectRootA category to which a `CatalogItem` instance belongs.
availability_period_idsJSONOptional
availability_period_ids (anyOf 1)arrayAlternativeThe IDs of the `CatalogAvailabilityPeriod` objects associated with the category.
availability_period_ids (anyOf 1)[]stringEach item
availability_period_ids (anyOf 2)nullAlternative
category_typeJSONOptional
category_type (anyOf 1)stringAlternativeIndicates 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)nullAlternative
channelsJSONOptional
channels (anyOf 1)arrayAlternativeA list of IDs representing channels, such as a Square Online site, where the category can be made visible.
channels (anyOf 1)[]stringEach item
channels (anyOf 2)nullAlternative
ecom_seo_dataJSONOptional
ecom_seo_data (anyOf 1)ModelAlternativeExpand 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)nullAlternative
image_idsJSONOptional
image_ids (anyOf 1)arrayAlternativeThe 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)[]stringEach item
image_ids (anyOf 2)nullAlternative
is_top_levelJSONOptional
is_top_level (anyOf 1)booleanAlternativeIndicates whether a category is a top level category, which does not have any parent_category.
is_top_level (anyOf 2)nullAlternative
nameJSONOptional
name (anyOf 1)stringAlternativeThe 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)nullAlternative
online_visibilityJSONOptional
online_visibility (anyOf 1)booleanAlternativeIndicates whether the category is visible (`true`) or hidden (`false`) on all of the seller's Square Online sites.
online_visibility (anyOf 2)nullAlternative
parent_categoryJSONOptional
parent_category (anyOf 1)ModelAlternativeExpand 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)nullAlternative
path_to_rootJSONOptional
path_to_root (anyOf 1)arrayAlternativeThe 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)[]ModelEach itemExpand 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)nullAlternative
root_categorystringOptionalThe 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

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"}

Official provider source

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand how our website, product, and documentation are used.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

Advertising

Shares visits and sign-ups with Meta, Reddit, and X so we can measure which of our ads work.

You can change these choices at any time from Cookie settings.