Any way to upload CatalogItem and CatalogImage instances simultaneously?

Hello Square,

I am studying the CreateCatalogImage endpoint of the API, and, in particular, the Java SDK. Based on what I am seeing, if we have a certain image to associate with a CatalogItem that we want to POST, we would first have to make a CreateCatalogImage API call, retrieve the ID provided to us by Square, build a CatalogItemVariation from it, and make an UpsertCatalogObject request, where we have prepared a CatalogItemVariation for every returned image ID.

This means that, for a CatalogItem that we want to create from scratch, for which we want n images, this would result in n + 1 API calls.

I just wanted to confirm that there is no way to make a single API call for all of those images.

Yes, unfortunately since CreateCatalogImage is its own separate endpoint, it can’t be utilized with the BatchUpsertCatalogObjects endpoint to create images and items at the same time. Thus, for each image, you’ll need to hit the CreateCatalogImage endpoint, and then for each item make another API call to attach the image.

1 Like

Thank you for the info!