question

shopventory avatar image
shopventory asked shopventory answered

Can an item be removed from or moved from one item group to another?

Hi there, as the title says, we are seeing some items that were in item groups that appear to:

  • Case 1: No longer be in an item group
  • Case 2: Have moved to a new item group

Is this possible? The only question/answer I found is from 2016, so I am wondering if anything has changed?

Much appreciated,

-Rares @ Shopventory

REST API
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
shopventory avatar image
shopventory answered

Just to expand on this with a hard example.

We have an item group in Clover:

{
    "attributes": {
        "elements": [
            {
                "id": "89QJTP2WAENYG",
                "itemGroup": {
                    "id": "0K0JYMJ4GJVKG"
                },
                "name": "Variant"
            }
        ]
    },
    "id": "0K0JYMJ4GJVKG",
    "items": {
        "elements": []
    },
    "name": "Standard Round Bend Treble"
}

We have an item in Clover:

{
    "autoManage": false,
    "available": true,
    "categories": {
        "elements": [
            {
                "id": "86JGCR9QJZ0D6",
                "name": "Trapper",
                "sortOrder": 87
            }
        ]
    },
    "code": "818396020409",
    "cost": 450,
    "defaultTaxRates": false,
    "hidden": false,
    "id": "5RBQ01FBHGH56",
    "isRevenue": true,
    "itemStock": {
        "item": {
            "id": "5RBQ01FBHGH56"
        },
        "modifiedTime": 1551542955000,
        "quantity": "4.0",
        "stockCount": 4
    },
    "modifiedTime": 1512754406000,
    "modifierGroups": {
        "elements": []
    },
    "name": "#1",
    "options": {
        "elements": [
            {
                "attribute": {
                    "id": "89QJTP2WAENYG"
                },
                "id": "KGE74QVECA4ZJ",
                "items": {
                    "elements": [
                        {
                            "id": "5RBQ01FBHGH56"
                        }
                    ]
                },
                "name": "#1"
            }
        ]
    },
    "price": 899,
    "priceType": "FIXED",
    "sku": "T1701",
    "stockCount": 0,
    "tags": {
        "elements": []
    },
    "taxRates": {
        "elements": [
            {
                "id": "0J555HFNKPRT2",
                "isDefault": true,
                "items": {
                    "elements": [
                        {
                            "id": "5RBQ01FBHGH56"
                        }
                    ]
                },
                "name": "Sales Tax",
                "rate": 725000
            }
        ]
    }
}

As you can see from above, the item has an option with attribute_id

89QJTP2WAENYG

and the item group also has this attribute on it.


However, the item does not belong to the item group? I thought this is not possible, but here it looks like on the Clover side this item was once part of this group and now it is not. Shedding any light on this would be much appreciated.

Also, any attempts to re-associate the item with the group fail. If I go at it from the item group side, there is no error but nothing happens:

>>> pp(payload)
{
    "items": [
        {
            "id": "5RBQ01FBHGH56"
        }
    ],
    "name": "Standard Round Bend Treble"
}
>>> p.client.update_itemgroup('0K0JYMJ4GJVKG', payload)
{'id': '0K0JYMJ4GJVKG', 'name': 'Standard Round Bend Treble'}

If I go at it from the item side I get the error:

{"message":"Existing item cannot be added to item group"}

Again, please advise as this is causing a lot of sync issues for us currently and I don't know how things got in this state.

Much appreciated,

-Rares @ Shopventory

10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community