• Example searches: “transaction”, “CreateOrder”, “/v2/locations”, “inventory”, “delete customer”

You are viewing an old version of the API
Update catalog image BETA

PUT /v2/catalog/images/{image_id}

Uploads a new image file to replace the existing one in the specified CatalogImage object.

This UpdateCatalogImage endpoint accepts HTTP multipart/form-data requests with a JSON part and an image file part in JPEG, PJPEG, PNG, or GIF format. The maximum file size is 15MB.


Permissions
ITEMS_WRITE
Try in API Explorer
Name Description
image_id
string

Required

The ID of the CatalogImage object to update the encapsulated image file.

Name Description
idempotency_key
string

Required

A unique string that identifies this UpdateCatalogImage request. Keys can be any valid string but must be unique for every UpdateCatalogImage request.

See Idempotency keys for more information.

Min Length 1

Response Fields

Name Description
errors
Error [ ]

Any errors that occurred during the request.

image
CatalogObject

The newly updated CatalogImage including a Square-generated URL for the encapsulated image file.

Examples

You are viewing an old version of the API
PUT /v2/catalog/images/{image_id}
cURL
  • cURL
  • Ruby
  • Python
  • C#
  • Java
  • PHP
  • Node.js
curl https://connect.squareup.com/v2/catalog/images/L52QOQN2SW3M5QTF9JOCQKNB \
  -X PUT \
  -H 'Square-Version: 2022-09-21' \
  -H 'Authorization: Bearer ACCESS_TOKEN' \
  -H 'Accept: application/json' \
  -F 'file=@/local/path/to/file.jpg' \
  -F 'request={
    "idempotency_key": "528dea59-7bfb-43c1-bd48-4a6bba7dd61f86",
    "object_id": "ND6EA5AAJEO5WL3JNNIAQA32",
    "image": {
      "type": "IMAGE",
      "image_data": {
        "name": "Coffee",
        "caption": "A picture of a cup of coffee"
      }
    }
  }'
Response JSON
{
  "image": {
    "id": "L52QOQN2SW3M5QTF9JOCQKNB",
    "type": "IMAGE",
    "image_data": {
      "name": "Coffee",
      "url": "https://...",
      "caption": "A picture of a cup of coffee"
    }
  }
}