UpdateCatalogImage
Uploads a new image file to replace the existing one in the specified CatalogImage object.
Stored Procedure Specific Information
Execute
To execute this stored procedure, you need to provide the ImageId of the CatalogImage to update and the file path of the new image.
EXECUTE UpdateCatalogImage ImageId = 'CGCQTHTETQQ4LNSWQSAX3ZBW', ImageFile = 'C:\\Pictures\\new-image.png', ImageDataCaption = 'Updated caption'
In place of 'ImageFile', you can also provide 'FileData' and 'FileName'. The 'FileData' parameter must be populated with the Base64 representation of the file. The 'FileName' parameter must include the file's name, containing its extension.
EXECUTE UpdateCatalogImage ImageId = 'CGCQTHTETQQ4LNSWQSAX3ZBW', FileName = 'new-image.png', FileData = 'iVBORw0KGgoAAAANSUhEUgAAAw8AAAFoCAMAAAAmbDcvAAAABGdBTUEAALGPC=='
You can also provide an instance of an input stream where the file data will be read from, using the 'Content' parameter. You must also provide a value to the 'FileName' parameter.
Input
| Name | Type | Required | Description |
| ImageId | String | True | The ID of the CatalogImage object whose encapsulated image file is to be replaced. |
| ObjectId | String | False | The ID of the CatalogObject to attach this image to. Leave empty to update the image without changing its attachment. |
| ImageFile | String | False | An image file in JPEG, PJPEG, PNG, or GIF format. |
| ImageDataCaption | String | False | A caption that describes what is shown in the image. Displayed in the Square Online Store. |
| ImageDataName | String | False | The internal name to identify this image in calls to the Square API. |
| ObjectVersion | Integer | 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. |
| FileName | String | False | The file name including extension when using Content. |
| FileData | String | False | Base64 string representation of the image content to be used along with FileName. Only used if ImageFile and Content are not set. |
Result Set Columns
| Name | Type | Description |
| Success | Boolean | Whether the image was successfully updated. |
| ImageId | String | The ID of the updated image. |
| ImageUrl | String | The URL of the updated image. |
| ImageCaption | String | The caption of the updated image. |
| Type | String | The type of the updated image. |
| CreatedAt | Datetime | The time at which the image was created. |
| UpdatedAt | Datetime | The time at which the image was updated. |
| IsDeleted | Boolean | Whether the image is deleted or not. |
| PresentAtAllLocations | Boolean | Whether the updated image is present at all locations or not. |
| Version | Int64 | The version of the updated image. |