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

You are viewing an old version of the API
Create catalog image

POST /v2/catalog/images

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

A call to this endpoint can upload an image, link an image to a catalog object, or do both.

This CreateCatalogImage 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.

Additional information and an example cURL request can be found in the Create a Catalog Image recipe.


Permissions
ITEMS_WRITE
Try in API Explorer
Name Description
idempotency_key
string

Required

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

See Idempotency keys for more information.

Min Length 1
object_id
string

Unique ID of the CatalogObject to attach to this CatalogImage. Leave this field empty to create unattached images, for example if you are building an integration where these images can be attached to catalog items at a later time.

image
CatalogObject

The new IMAGE-type CatalogObject to be attached to this CatalogImage. If the CatalogObject already has a CatalogImage, this call will overwrite it.

Response Fields

Name Description
errors
Error [ ]

Information on any errors encountered.

image
CatalogObject

The newly created CatalogImage including a Square-generated URL for each image.

Examples

You are viewing an old version of the API
POST /v2/catalog/images
cURL
  • cURL
  • Ruby
  • Python
  • C#
  • Java
  • PHP
curl https://connect.squareup.com/v2/catalog/images \
  -X POST \
  -H 'Square-Version: 2020-08-12' \
  -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": {
      "id": "#TEMP_ID",
      "type": "IMAGE",
      "image_data": {
        "caption": "A picture of a cup of coffee"
      }
    }
  }'

Share Feedback

Thanks for visiting the Square API documentation. What's on your mind?