Skip to main content

For some reason, I am required to pass the AttributeID when updating the value for a StockItem attribute. I’m using this URL:

https://site.com/entity/Default/22.200.001/StockItem

 

For example, when I want to update “Color”, I have to pass this in the JSON body

    "Attributes": t

        {

            "AttributeID": {

                "value": "A372"

            },

            "Value": {

                "value": "Black"

            }

        }

    ],

Instead of finding all the IDs, I want to be able to just pass this:

    "Attributes": /

        {

            "Attribute": {

                "value": "Color"

            },

            "Value": {

                "value": "Black"

            }

        }

    ],

Does anyone know how to do this?

Does this discussion help?

 


Hi @bpgraves 

In the JSON request, you can pass the 'AttributeID' as 'Color'; there is no need to include any 'Ids'


Sample JSON:
{

    "InventoryID": {

        "value": "AACOMPUT01"

    },

    "Description": {

        "value": "Acer Laptop Computer"

    },

    "Attributes": >

        {

            "AttributeID": {

                "value": "COLOR"

            },

            "Value": {

                "value": "BLUE"

            }

        },

        {

            "AttributeID": {

                "value": "WIDEANGLE"

            },

            "Value": {

                "value": "WIDE2"

            }

        }

    ]

}


Does this discussion help?

 

Actually this discussion is what caused my problem since using Attribute (unlike AttributeID) didn’t change any data.  In fact, using Attribute (like that discussion recommends) has no effect whatsoever on the Stock Item.  I was able to finally get it working using “Color” for AttributeID.


Reply