Add Quantity On Hand in Initial Add

sormunirsormunir Member Posts: 3

I have a very simple store structure and am trying to add initial quantity of certain items. What am I doing wrong? I am adding the qoh field when I put in something like this, but it doesn't update. I am confused with the purpose of itemShopsID.


product = {

  "defaultCost": "0",

  "discountable": "true",

  "tax": "true",

  "itemType": "default",

  "Note": description,

  "serialized": "false",

  "description": name,

  "modelYear": "0",

"qoh": "5",

  "upc": "",

  "ean": "",

  "customSku": barcode,

  "manufacturerSku": "",

  "publishToEcom": "true",

  "categoryID": categoryID,

  "taxClassID": "1",

  "departmentID": "0",

  "Prices": {

    "ItemPrice": [

      {

        "amount": price,

        "useTypeID": "1",

        "useType": "Default"

      }

    ]}

}

1 comment

  • LucienVersendaalLucienVersendaal Moderator, Lightspeed Staff Posts: 351 moderator

    Hi @sormunir ,

    Thank you for contacting us.

    When you want to create a new Item you will need to add the following arguments:


    "ItemShops": {
    			      "ItemShop": [
    			        {
    			          "qoh": "5",
    			          "backorder": "0",
    			          "componentQoh": "0",
    			          "componentBackorder": "0",
    			          "reorderPoint": "0",
    			          "reorderLevel": "0",
    			          "shopID": "1"
    			        }
                	]
                },
    

    When you do this your payload will look likes this:

    {
                "defaultCost": "14",
                "discountable": "true",
                "tax": "true",
                "itemType": "default",
                "serialized": "false",
                "description": "Green T-shirt",
                "modelYear": "0",
                "upc": "",
                "ean": "",
                "customSku": "summer",
                "manufacturerSku": "",
                "publishToEcom": "true",
                "categoryID": "0",
                "taxClassID": "1",
                "departmentID": "0",
                "itemMatrixID": "0",
                "manufacturerID": "0",
                "seasonID": "0",
                "defaultVendorID": "0",
                "ItemShops": {
    			      "ItemShop": [
    			        {
    			          "qoh": "5",
    			          "backorder": "0",
    			          "componentQoh": "0",
    			          "componentBackorder": "0",
    			          "reorderPoint": "0",
    			          "reorderLevel": "0",
    			          "shopID": "1"
    			        }
                	]
                },
                "Prices": {
                    "ItemPrice": [
                        {
                            "amount": "100",
                            "useTypeID": "1",
                            "useType": "Default"
                        },
                        {
                            "amount": "100",
                            "useTypeID": "2",
                            "useType": "MSRP"
                        },
                        {
                            "amount": "100",
                            "useTypeID": "3",
                            "useType": "Online"
                        },
                        {
                            "amount": "100",
                            "useTypeID": "4",
                            "useType": "New Shop"
                        }
                    ]
                }
            }
    

    I hope this will help.

    Kind regards,


    Lucien Versendaal

Sign In or Register to comment.