Excel Add-In for Square

Build 22.0.8479

CreateCatalogImage

Uploads an image file to be represented by a CatalogImage object linked to an existing CatalogObject instance.

Table Specific Information

If you want to create an image without attaching to any Catalog Object

EXECUTE CreateCatalogImage ImageFile='C:\\users\\image.png', ImageDataCaption='Test Image'

You can upload and attach image to a catalog object by specifying the objectid.

EXECUTE CreateCatalogImage ImageFile='C:\\users\\image.png', ImageDataCaption='Test Image', ObjectId='KGV3QARAJSYCIX4VUJZX64ZX'

In order to specify the value for ImageCatalogV1Ids, you need to create a well defined JSON structure

 
EXECUTE CreateCatalogImage ImageFile='C:\\users\\image.png', ImageDataCaption='Test Image', ImageCatalogV1Ids='[{"catalog_v1_id":"KGV3QARAJSYCIX4VUJZX64ZX","location_id":"29BYHNBR6W77E"}]'

Input

Name Type Required Accepts Input Streams Description
ImageFile String False False An image file in JPEG, PJPEG, PNG, or GIF format.
ObjectId String False False Unique ID of the CatalogObject to attach to this CatalogImage. Leave this field empty to create unattached images
ImageAbsentAtLocationIds String False False A comma separated list of locations where the object is not present, even if present_at_all_locations is true. This can include locations that are deactivated.
ImageCatalogV1Ids String False False The Connect v1 IDs for this object at each location where it is present, where they differ from the object's Connect V2 ID. The field will only be present for objects that have been created or modified by legacy APIs.
ImageDataCaption String True False A caption that describes what is shown in the image.
ImageDataName String False False The internal name to identify this image in calls to the Square API.
ImageDataUrl String False False The URL of this image, generated by Square after an image is uploaded using the CreateCatalogImage endpoint.
PresentAtAllLocations Boolean False False If true, this object is present at all locations (including future locations), except where specified in the absent_at_location_ids field. If false, this object is not present at any locations (including future locations), except where specified in the present_at_location_ids field. If not specified, defaults to true.
PresentAtAllLocationIds String False False A comma separated list of locations where the object is present, even if present_at_all_locations is false. This can include locations that are deactivated.
ObjectVersion Integer False 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.
Content String False True The content as InputStream to be uploaded when ImageFile is not specified.

Result Set Columns

Name Type Description
Success Boolean Whether or not the image was attached to the item.
ImageId String Id of the Image.
ImageUrl String The url of the uploaded image.

Copyright (c) 2023 CData Software, Inc. - All rights reserved.
Build 22.0.8479