Solved

Updating Attributes for a StockItem (REST)

  • 1 December 2023
  • 3 replies
  • 60 views

Userlevel 2
Badge

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": [

        {

            "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?

icon

Best answer by jinin 1 December 2023, 11:34

View original

3 replies

Userlevel 7
Badge +5

Does this discussion help?

 

Userlevel 7
Badge +11

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"

            }

        }

    ]

}

Userlevel 2
Badge

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


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved