Square: Upsert Catalog Object
Square catalog.upsertCatalogObject: arguments, response, policy and SDK examples.
← Catalog operations · Get started
Operation square.upsertcatalogobject
Provider route: POST /v2/catalog/object. 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"]["upsertCatalogObject"]>[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.upsertCatalogObject(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.upsert_catalog_object(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 Upsert Catalog Object — request body — body |
Referenced models: Upsert Catalog Object — 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 Upsert Catalog Object — response body |
Referenced models: Upsert Catalog Object — response body
Schemas
Section titled “Schemas”83 more schemas are linked from the tables above, on the schema pages.
Upsert Catalog Object — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
catalog_object | Model | Optional | Expand Create Catalog Image — response body — image The successfully created or updated CatalogObject. |
errors | array | Optional | Any errors that occurred during the request. |
errors[] | Model | Each item | Expand Get Shift — response body — errors item |
id_mappings | array | Optional | The mapping between client and server IDs for this upsert. |
id_mappings[] | Model | Each item | Expand Upsert Catalog Object — response body — id mappings item |
Referenced models: Upsert Catalog Object — response body — id mappings item, Create Catalog Image — response body — image, Get Shift — response body — errors item
Upsert Catalog Object — request body — body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
idempotency_key | string | Required within parent | A value you specify that uniquely identifies this request among all your requests. A common way to create a valid idempotency key is to use a Universally unique identifier (UUID). If you're unsure whether a particular request was successful, you can reattempt it with the same idempotency key without worrying about creating duplicate objects. See [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) for more information. Maximum length: 128 Minimum length: 1 |
object | Model | Required within parent | Expand Upsert Catalog Object — request body — body object A CatalogObject to be created or updated. - For updates, the object must be active (the `is_deleted` field is not `true`). - For creates, the object ID must start with `#`. The provided ID is replaced with a server-generated ID. |
Referenced models: Upsert Catalog Object — request body — body object
Upsert Catalog Object — response body — id mappings item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | A mapping between a temporary client-supplied ID and a permanent server-generated ID. When calling [UpsertCatalogObject](api-endpoint:Catalog-UpsertCatalogObject) or [BatchUpsertCatalogObjects](api-endpoint:Catalog-BatchUpsertCatalogObjects) to create a [CatalogObject](entity:CatalogObject) instance, you can supply a temporary ID for the to-be-created object, especially when the object is to be referenced elsewhere in the same request body. This temporary ID can be any string unique within the call, but must be prefixed by "#". After the request is submitted and the object created, a permanent server-generated ID is assigned to the new object. The permanent ID is unique across the Square catalog. |
client_object_id | JSON | Optional | |
client_object_id (anyOf 1) | string | Alternative | The client-supplied temporary `#`-prefixed ID for a new `CatalogObject`. |
client_object_id (anyOf 2) | null | Alternative | |
object_id | JSON | Optional | |
object_id (anyOf 1) | string | Alternative | The permanent ID for the CatalogObject created by the server. |
object_id (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
Create Catalog Image — response body — image image data caption, name, photo studio order id, url
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | An image file to use in Square catalogs. It can be associated with `CatalogItem`, `CatalogItemVariation`, `CatalogCategory`, and `CatalogModifierList` objects. Only the images on items and item variations are exposed in Dashboard. Only the first image on an item is displayed in Square Point of Sale (SPOS). Images on items and variations are displayed through Square Online Store. Images on other object types are for use by 3rd party application developers. |
caption | JSON | Optional | |
caption (anyOf 1) | string | Alternative | A caption that describes what is shown in the image. Displayed in the Square Online Store. This is a searchable attribute for use in applicable query filters using the [SearchCatalogObjects](api-endpoint:Catalog-SearchCatalogObjects). |
caption (anyOf 2) | null | Alternative | |
name | JSON | Optional | |
name (anyOf 1) | string | Alternative | The internal name to identify this image in calls to the Square API. This is a searchable attribute for use in applicable query filters using the [SearchCatalogObjects](api-endpoint:Catalog-SearchCatalogObjects). It is not unique and should not be shown in a buyer facing context. |
name (anyOf 2) | null | Alternative | |
photo_studio_order_id | JSON | Optional | |
photo_studio_order_id (anyOf 1) | string | Alternative | The immutable order ID for this image object created by the Photo Studio service in Square Online Store. |
photo_studio_order_id (anyOf 2) | null | Alternative | |
url | JSON | Optional | |
url (anyOf 1) | string | Alternative | The URL of this image, generated by Square after an image is uploaded using the [CreateCatalogImage](api-endpoint:Catalog-CreateCatalogImage) endpoint. To modify the image, use the UpdateCatalogImage endpoint. Do not change the URL field. |
url (anyOf 2) | null | Alternative |
Create Catalog Image — response body — image time period data event
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents a time period - either a single period or a repeating period. |
event | JSON | Optional | |
event (anyOf 1) | string | Alternative | An iCalendar (RFC 5545) [event](https://tools.ietf.org/html/rfc5545#section-3.6.1), which specifies the name, timing, duration and recurrence of this time period. Example: ``` DTSTART:20190707T180000 DURATION:P2H RRULE:FREQ=WEEKLY;BYDAY=MO,WE,FR ``` Only `SUMMARY`, `DTSTART`, `DURATION` and `RRULE` fields are supported. `DTSTART` must be in local (unzoned) time format. Note that while `BEGIN:VEVENT` and `END:VEVENT` is not required in the request. The response will always include them. |
event (anyOf 2) | null | Alternative |
Create Catalog Image — response body — image catalog v1 ids array item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | A Square API V1 identifier of an item, including the object ID and its associated location ID. |
catalog_v1_id | JSON | Optional | |
catalog_v1_id (anyOf 1) | string | Alternative | The ID for an object used in the Square API V1, if the object ID differs from the Square API V2 object ID. |
catalog_v1_id (anyOf 2) | null | Alternative | |
location_id | JSON | Optional | |
location_id (anyOf 1) | string | Alternative | The ID of the `Location` this Connect V1 ID is associated with. |
location_id (anyOf 2) | null | Alternative |
Create Catalog Image — response body — image 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 Known values: 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 |
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.upsertcatalogobject. Catalog operation: UpsertCatalogObject. 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"}