x

Item's image not showing up in square register when set via Connect API's BatchUpsertCatalogObjects

I've created a job that syncs my item inventory via the Connect API v2's BatchUpsertCatalogObjects. I'm using the official square connect-python-sdk package to do so. The objects show up in the app just fine, but any images set on the item via image_url will not show up in the app. Here's a slightly anonymized object showing what the object looks like after syncing via API.

 

 {
            "type": "ITEM",
            "id": "HJVS{snip}",
            "updated_at": "2017-12-13T22:46:52.094Z",
            "version": 1513205212094,
            "is_deleted": false,
            "present_at_all_locations": true,
            "item_data": {
                "name": "Test Description",
                "category_id": "5XOK{snip}",
                "image_url": "https://my-publicly-accessible-bucket.s3.amazonaws.com/test.png",
                "variations": [
                    {
                        "type": "ITEM_VARIATION",
                        "id": "ZW6F{snip}",
                        "updated_at": "2017-12-13T22:46:52.094Z",
                        "version": 1513205212094,
                        "is_deleted": false,
                        "present_at_all_locations": true,
                        "item_variation_data": {
                            "item_id": "HJVS{snip}",
                            "name": "Test Description",
                            "ordinal": 0,
                            "pricing_type": "FIXED_PRICING",
                            "price_money": {
                                "amount": 2500,
                                "currency": "USD"
                            }
                        }
                    }
                ],
                "product_type": "REGULAR"
            }

 When I edit the item in the POS app the image will work, but it actually changes the object's IDs as well, so my sync process creates a duplicate item with no image the next time it runs.

 

{
            "type": "ITEM",
            "id": "FW5A{snip}",
            "updated_at": "2017-12-13T23:02:38.732Z",
            "version": 1513206158732,
            "is_deleted": false,
            "present_at_all_locations": true,
            "item_data": {
                "name": "Test Description",
                "visibility": "PRIVATE",
                "available_online": false,
                "available_for_pickup": false,
                "available_electronically": false,
                "category_id": "IB2R{snip}",
                "ordinal": 0,
                "image_url": "https://square-production.s3.amazonaws.com/files/281c{snip}/original.jpeg",
                "variations": [
                    {
                        "type": "ITEM_VARIATION",
                        "id": "CEAW{snip}",
                        "updated_at": "2017-12-13T23:02:38.732Z",
                        "version": 1513206158732,
                        "is_deleted": false,
                        "present_at_all_locations": true,
                        "item_variation_data": {
                            "item_id": "FW5A{snip}",
                            "name": "Test Description",
                            "ordinal": 0,
                            "pricing_type": "FIXED_PRICING",
                            "price_money": {
                                "amount": 2500,
                                "currency": "USD"
                            }
                        }
                    }
                ],
                "product_type": "REGULAR",
                "skip_modifier_screen": false
            }
        },

 So two questions:

  1. Why isn't the image working when set via the API?
  2. Why does modifying an item via the POS app completely change all the IDs for the item?
3,131 Views
Message 1 of 6
Report
1 Best Answer
Alumni

Best Answer

We were able to replicate this by adding an image to a variation, and confirmed that it does not show anywhere. Although the CreateCatalogImage endpoint allows you to add an image to most objects, only an object of type item will actually display it anywhere.

 

That being said, we can confirm that in order for the image to appear, you would need to reference it at the catalog item level instead of the catalog variation level. I hope this helps clear things up - please let me know if you'd like me to look into anything else for you, @donutshoppe!

Valentina
Community Moderator, Square
Sign in and click Mark as Best Answer if my reply answers your question.

View Best Answer >

2,212 Views
Message 6 of 6
Report
5 REPLIES 5
Square Community Moderator

Hi @phloopy

 

I reached out to our API Team, and they took a look at your post. 

 

I was able to gather the following information for you: 

 

  1. You can’t actually set a URL using that call. You’ll need to use the Connect v1 API to upload that image (https://docs.connect.squareup.com/api/connect/v1#post-image).
     
  2. The item with id “HJVS2CPV3YRSVKGZMJ3B2BPV” was created using Connect at 2017-12-13 22:46:52.094, then deleted by Connect about 2 minutes later. Next the item “FW5A6JJO3JGJVGSYG73MXMHS” was created by Connect immediately afterwards, and then modified by Point of Sale application. So your original item was deleted and then replaced with a new item before you used the Point of sale application to edit it.

I hope this helps, and let us know if you have any other questions 👍🏼

3,080 Views
Message 2 of 6
Report

Hi there. This still appears to be an issue and the link you provided to the v1 documentation does not appear to be active. As @phloopy mentioned, you can post images to the endpoint and the images are retrievable via the catalog list, but they are not visible within the point of sale app. 

 

endpoint we are posting images to: https://connect.squareup.com/v2/catalog/images

2,260 Views
Message 3 of 6
Report
Alumni

I reached out to one of our engineers, and they were able to test the v2 CreateCatalogImage endpoint that you referenced. The image did show up in SPOS when tested, so it would be helpful to get a bit more context about what you're experiencing on your end. If you are able to provide a catalog_object_id for an item where it didn’t work, we can definitely have our engineer look it up and see what the issue is.

 

I was also able to confirm that you are correct about the v1 link, as the v1 endpoint was deprecated in favor of the v2 endpoint, @donutshoppe.

Valentina
Community Moderator, Square
Sign in and click Mark as Best Answer if my reply answers your question.
2,243 Views
Message 4 of 6
Report

Here is a catalog item that has a corresponding IMAGE object that is referenced at the variation level. Does this image ID also need to be referenced at the catalog object level? 

 

Id: O5E3FPVXPA736VWEFNQIZCV6

2,239 Views
Message 5 of 6
Report
Alumni

Best Answer

We were able to replicate this by adding an image to a variation, and confirmed that it does not show anywhere. Although the CreateCatalogImage endpoint allows you to add an image to most objects, only an object of type item will actually display it anywhere.

 

That being said, we can confirm that in order for the image to appear, you would need to reference it at the catalog item level instead of the catalog variation level. I hope this helps clear things up - please let me know if you'd like me to look into anything else for you, @donutshoppe!

Valentina
Community Moderator, Square
Sign in and click Mark as Best Answer if my reply answers your question.
2,213 Views
Message 6 of 6
Report