CatalogItemVariations
Query the available item variations.
Table Specific Information
CatalogItemVariations returns only the ITEM_VARIATION objects in the Square catalog. These objects represent the different versions of a catalog item (for example, a shirt available in multiple sizes and colors).
The Catalog table is the generic counterpart. It returns objects of every catalog type in a single result set, and rather than giving each type its own columns it carries the type specific fields as a JSON document in the column matching the row type: ItemData for an item, ItemVariationData for an item variation, and so on. Use Catalog to search across types or when the type is not known in advance, and use CatalogItemVariations or another type specific table to work with one type through individual columns. Catalog is read-only, while the type specific tables also support INSERT, UPDATE, and DELETE.
Because CatalogItemVariations is restricted to ITEM_VARIATION objects, a search that matches only other catalog types returns no rows here. Run the same search against Catalog to see those matches.
Select
The connector uses the Square API to filter the results by the following columns and operators while the rest of the filter is executed client-side within the connector.
- Id supports the following operators: =, IN.
- IncludeDeletedObjects supports the following operator: =.
- Query supports the following operator: =.
- SearchText supports the following operators: =, IN.
- UpdatedAt supports the following operator: >.
Retrieve all catalog item variations:
SELECT * FROM CatalogItemVariations
Filter on Id to retrieve specific item variations. Id = fetches a single item variation directly. Id IN is served by the batch retrieve endpoint in a single request rather than one request per Id; the endpoint takes up to 1000 Ids per request, so a longer list is split across as many requests as needed.
SELECT Id, Name, ItemId, PricingType FROM CatalogItemVariations WHERE Id = 'variation_1'
SELECT Id, Name, ItemId, PricingType FROM CatalogItemVariations WHERE Id IN ('variation_1', 'variation_2')
UpdatedAt supports only the > operator, which Square applies as the start of the search window. Equality and the upper bound operators are not supported.
SELECT Id, Name, UpdatedAt FROM CatalogItemVariations WHERE UpdatedAt > '2025-01-01T00:00:00Z'
Set IncludeDeletedObjects to true to return item variations that have been deleted. A deleted item variation reports IsDeleted as true.
SELECT Id, Name, IsDeleted FROM CatalogItemVariations WHERE IncludeDeletedObjects = true
SearchText searches the searchable attributes, such as name, description, and SKU. Matching is case-insensitive, and keywords of fewer than three alphanumeric characters are ignored.
SELECT Id, Name FROM CatalogItemVariations WHERE SearchText = 'Small'
Use IN to supply up to three keywords. Square combines them with AND and matches them in any order. Square rejects a fourth keyword with the error ARRAY_LENGTH_TOO_LONG, reporting that the collection must have at most 3 items.
SELECT Id, Name FROM CatalogItemVariations WHERE SearchText IN ('Small', 'Blue')
The Query column takes a Square CatalogQuery object, supplied as JSON, and gives access to every search Square offers. The following search types are available.
- exact_query matches an attribute against an exact value. Takes attribute_name and attribute_value.
- prefix_query matches an attribute against a leading substring. Takes attribute_name and attribute_prefix.
- range_query matches a numeric attribute against a range. Takes attribute_name, attribute_min_value, and attribute_max_value.
- sorted_attribute_query orders the results by an attribute. Takes attribute_name, sort_order, and optionally initial_attribute_value.
- set_query matches an attribute against any value in a set. Takes attribute_name and attribute_values.
- items_for_tax_query returns the items that use the given taxes. Takes tax_ids.
- items_for_modifier_list_query returns the items that use the given modifier lists. Takes modifier_list_ids.
- items_for_item_options_query returns the items that use the given item options. Takes item_option_ids.
- item_variations_for_item_option_values_query returns the item variations that carry the given item option values. Takes item_option_value_ids.
- modifiers_for_child_list_query returns the modifiers that nest the given modifier lists, matching a modifier whose child_modifier_list_ids contains any of the supplied IDs. Takes child_modifier_list_ids. This search type is in beta.
exact_query, prefix_query, range_query, and sorted_attribute_query may be set together in a single CatalogQuery. Each of set_query, items_for_tax_query, items_for_modifier_list_query, items_for_item_options_query, item_variations_for_item_option_values_query, and modifiers_for_child_list_query must be the only search type in the object.
Do not set text_query in the Query column if SearchText is also set: both write to the same search, and connector rejects the combination with an error instead of merging them. Express the whole text_query search inside the Query value, or drop it and filter with SearchText alone.
Because this table returns only ITEM_VARIATION objects, a search type that yields another catalog type produces no rows here even when it matches. items_for_tax_query, items_for_modifier_list_query, items_for_item_options_query, item_variations_for_item_option_values_query, and modifiers_for_child_list_query return other catalog types, so run those against Catalog or the appropriate type-specific tables.
Match an attribute exactly, or by prefix:
SELECT Id, Name FROM CatalogItemVariations WHERE Query = '{"exact_query":{"attribute_name":"name","attribute_value":"Small"}}'
SELECT Id, Name FROM CatalogItemVariations WHERE Query = '{"prefix_query":{"attribute_name":"name","attribute_prefix":"Sma"}}'
Match a numeric attribute against a range. The attribute_name must be an attribute Square indexes for search, such as ordinal; Square reports Unknown attribute definition name for anything it does not recognize.
SELECT Id, Name FROM CatalogItemVariations WHERE Query = '{"range_query":{"attribute_name":"ordinal","attribute_min_value":0,"attribute_max_value":100}}'
Order the results by an attribute. Square preserves this ordering in the result set.
SELECT Id, Name FROM CatalogItemVariations WHERE Query = '{"sorted_attribute_query":{"attribute_name":"name","sort_order":"ASC"}}'
Match an attribute against a set of values. In Catalog the result set is the union of the matches across every type; here it is narrowed to the item variations among them.
SELECT Id, Name FROM CatalogItemVariations WHERE Query = '{"set_query":{"attribute_name":"name","attribute_values":["Small","Medium","Large"]}}'
Combine a filtering search with a sort in one CatalogQuery:
SELECT Id, Name FROM CatalogItemVariations WHERE Query = '{"prefix_query":{"attribute_name":"name","attribute_prefix":"Sma"},"sorted_attribute_query":{"attribute_name":"name","sort_order":"DESC"}}'
The filters can be combined in a single WHERE clause. The connector merges them into one request, with SearchText folded into the CatalogQuery next to whatever the Query column supplies.
SELECT Id, Name FROM CatalogItemVariations WHERE SearchText = 'Small' AND Query = '{"sorted_attribute_query":{"attribute_name":"name","sort_order":"ASC"}}' AND IncludeDeletedObjects = true
Insert
To create an item variation, you will need to specify the ItemId, PricingType, PriceMoneyAmount and PriceMoneyCurrency columns, or ItemId and PricingType if PricingType is set to VARIABLE_PRICING. All the fields that are not read-only can be specified.
INSERT INTO CatalogItemVariations (ItemId, PricingType, PriceMoneyAmount, PriceMoneyCurrency) VALUES ('2I2UELJL4543VQJF4D4EU3EJO', 'FIXED_PRICING', 1, 'USD')
Creating an item variation by specifying aggregate columns:
INSERT INTO CatalogItemVariations (ItemId, Name, PricingType, PriceMoneyAmount, PriceMoneyCurrency, SKU, Upc, Ordinal, LocationOverrides, TrackInventory, InventoryAlertType, InventoryAlertThreshold, UserData, ServiceDuration, PresentAtAllLocations, AbsentAtLocationIds) VALUES ('YC77SWXPJLTUFUHCCYSGYMYD', 'MyItemVariations14', 'FIXED_PRICING', 1, 'USD', 'testSKU', 'testUPC', '2', '[{"inventory_alert_threshold": 1, "location_id": "92BYHNBR6W77E"}]', true, 'LOW_QUANTITY', 3, 'test', 3, false, '["92BYHNBR6W77E"]')
Update
Modify an item variation by providing the Id:
UPDATE CatalogItemVariations SET Name = 'TestName1', PricingType = 'FIXED_PRICING', PriceMoneyAmount = 1010, PriceMoneyCurrency = 'USD', ItemId = 'OLCXWRVE7JD22TCS6NIRST6G', UserData = 'SEASONAL = TRUE' WHERE Id = 'WNT7535N7AEJHJBMLRGGZXIK'
Delete
Delete an item variation by providing the Id:
DELETE FROM CatalogItemVariations WHERE Id = '32123'
Bulk Delete
The maximum BatchSize supported by CatalogItemVariations for a delete is 200. Note that this is lower than the 1000 Ids a batch retrieve accepts, because Square caps its catalog batch delete separately.
Stage the Ids of the item variations to remove in a TEMP table, then delete them in a single request. Only the Id is needed on each staged row, and a row that supplies no Id is rejected before the request is sent.
INSERT INTO CatalogItemVariations#TEMP (Id) VALUES ('variation_1')
INSERT INTO CatalogItemVariations#TEMP (Id) VALUES ('variation_2')
DELETE FROM CatalogItemVariations WHERE EXISTS SELECT Id FROM CatalogItemVariations#TEMP
A catalog batch delete succeeds even when only some of the Ids could be removed, and Square answers with the Ids it actually deleted. The connector reports the outcome of every staged Id against that list, so query LastResultInfo#TEMP after the delete to see which rows were removed and which were not.
SELECT * FROM LastResultInfo#TEMP
Note: Deleting a catalog object also removes the objects that belong to it, such as the variations of an item or the modifiers of a modifier list. An Id staged alongside its parent can therefore report that it was not deleted, because the parent's removal had already taken it.
Note: The staged form shown above is required to reach the bulk delete endpoint. A DELETE FROM CatalogItemVariations WHERE Id = '...' statement removes the same item variation but issues one request per Id.
Columns
| Name | Type | ReadOnly | Description |
| Id [KEY] | String | False |
The item variation's ID. |
| ItemId | String | False |
The ID of the CatalogItem associated with this item variation. |
| Name | String | False |
The item variation's name. |
| UpdatedAt | Datetime | True |
Last modification timestamp. |
| IsDeleted | Boolean | False |
If true, the object has been deleted from the database. When deleted, the UpdatedAt field will equal the deletion time. |
| Sku | String | False |
The item variation's SKU. |
| Upc | String | False |
The item variation's UPC. |
| Ordinal | Integer | True |
The order in which this item variation should be displayed. |
| PricingType | String | False |
Indicates whether the item variation's price is fixed or determined at the time of sale. |
| PriceMoneyAmount | Integer | False |
The item variation's price amount, if fixed pricing is used. |
| PriceMoneyCurrency | String | False |
The item variation's price currency, if fixed pricing is used. |
| LocationOverrides | String | False |
Per-location price and inventory overrides. |
| TrackInventory | Boolean | False |
If true, inventory tracking is active for the variation. |
| InventoryAlertType | String | False |
Indicates whether the item variation displays an alert when its inventory quantity is less than or equal to its InventoryAlertThreshold. |
| InventoryAlertThreshold | Integer | False |
If the inventory quantity for the variation is less than or equal to this value and InventoryAlertType is LOW_QUANTITY, the variation displays an alert in the merchant dashboard. |
| UserData | String | False |
Arbitrary user metadata to associate with the item variation. |
| ServiceDuration | Integer | False |
If the CatalogItem that owns this item variation is of type APPOINTMENTS_SERVICE, then this is the duration of the service in milliseconds. |
| CatalogMeasurementUnitId | String | True |
Represents the unit used to measure a CatalogItemVariation and specifies the precision for decimal quantities. |
| MeasurementUnitId | String | False |
ID of the 'CatalogMeasurementUnit' that is used to measure the quantity sold of this item variation. If left unset, the item will be sold in whole quantities. |
| PresentAtAllLocations | Boolean | False |
If true, this object is present at all locations (including future locations), except where specified in the AbsentAtLocationIds field. If false, this object is not present at any locations (including future locations), except where specified in the PresentAtLocationIds field. If not specified, defaults to true. |
| PresentAtLocationIds | String | False |
A list of locations where the object is present, even if PresentAtAllLocations is false. |
| AbsentAtLocationIds | String | False |
A list of locations where the object is not present, even if PresentAtAllLocations is true. |
| Version | Int64 | False |
The version of the object. When updating an object, the version supplied must match the version in the database, otherwise the write will be rejected as conflicting. |
| Type | String | False |
The item variation's type. |
| CreatedAt | Datetime | True |
Created timestamp. |
| CatalogV1Ids | String | True |
The Connect v1 IDs for this object at each location where it is present, where they differ from the object's Connect V2 ID. |
| Channels | String | True |
A list of IDs representing channels, such as a Square Online site, where the item can be made visible or available. |
| Sellable | Boolean | False |
Whether this variation can be sold. The inventory count of a sellable variation reflects units available for sale. (Beta) |
| Stockable | Boolean | False |
Whether stock is counted directly on this variation. When true, inventory reflects units of this variation; when false, inventory is derived from its components. (Beta) |
| StockableConversionStockableItemVariationId | String | False |
The ID of the stockable item variation contained in the conversion. (Beta) |
| StockableConversionStockableQuantity | String | False |
The quantity of the stockable item variation equivalent to the non-stockable item variation quantity, expressed as a decimal string. (Beta) |
| StockableConversionNonstockableQuantity | String | False |
The quantity of the non-stockable item variation equivalent to the stockable item variation quantity, expressed as a decimal string. (Beta) |
| AvailableForBooking | Boolean | False |
Indicates whether this service variation can be booked through Square Appointments. Applies only to variations of type APPOINTMENTS_SERVICE. (Beta) |
| TeamMemberIds | String | False |
The IDs of employees who can perform this service variation. Applies only to variations of type APPOINTMENTS_SERVICE. (Beta) |
| ItemOptionValues | String | False |
A list of item option values associated with this variation, listed in the same order as the parent item options. |
| ImageIds | String | False |
The IDs of images associated with this item variation. |
| KitchenName | String | False |
An alternate name for this item variation displayed to kitchen staff instead of the customer-facing name. (Beta) |
Pseudocolumns
Pseudo column fields are used in the WHERE clause of SELECT statements (unless stated otherwise) and offer a more granular control over the tuples that are returned from the data source.
| Name | Type | Description |
| IncludeDeletedObjects | Boolean |
If true, deleted objects are included in results. |
| SearchText | String |
A keyword to search for across the searchable attributes of a catalog object, such as name, description, and SKU. Matching is case-insensitive, and keywords of fewer than three alphanumeric characters are ignored. Use IN to supply up to three keywords, which are combined with AND in any order; Square rejects a fourth. |
| Query | String |
A Square CatalogQuery object, supplied as JSON, giving full access to every search Square offers. Any of exact_query, prefix_query, range_query, sorted_attribute_query, and text_query may be set together. Each of set_query, items_for_tax_query, items_for_modifier_list_query, items_for_item_options_query, item_variations_for_item_option_values_query, and modifiers_for_child_list_query must be the only search set. This table returns only ITEM_VARIATION objects, so a search that matches other catalog types returns no rows. Do not set text_query here; this table builds it from the SearchText column. |