• Resolved paulvc

    (@paulvc)


    We’re using API to update stock quentity. Request is:

    https://www.oursite.com/nz/wp-json/wc/v2/products/23724/variations/batch?consumer_key=ck_<OUR_KEY>&consumer_secret=cs_<OUR_SECRET&gt;, {“update”:[“id”:”23732″,”stock_quantity”:”1.0″},{“id”:”23731″,”stock_quantity”:”5.0″}]}

    And response is returned:

    {
        "update": [
            {
                "id": 23732,
                "date_created": "2020-02-11T13:06:18",
                "date_created_gmt": "2020-02-11T00:06:18",
                "date_modified": "2021-02-25T17:09:38",
                "date_modified_gmt": "2021-02-25T04:09:38",
                "description": "<p><strong>40L</strong> &nbsp;520 (D) x 920 (H) mm; 20kg</p>\n",
                "permalink": "https://www.oursite.com/nz/product/hydropress-20l-40l/?attribute_sizes=40L",
                "sku": "SP22600-01",
     ...
                "tax_status": "taxable",
                "tax_class": "",
                "manage_stock": "parent",
                "stock_quantity": 0,
                "in_stock": false,
                "backorders": "no",
                "backorders_allowed": false,
                "backordered": false,
                "weight": "",
                "dimensions": {
                    "length": "",
                    "width": "",
                    "height": ""
                },
                "shipping_class": "nz-freight-included",
                "shipping_class_id": 178,
                "image": {
    ...            },
                "attributes": [
                    {
    ...
                }
            },
            {
                "id": 23731,
                "date_created": "2020-02-11T13:06:17",
                "date_created_gmt": "2020-02-11T00:06:17",
                "date_modified": "2021-02-25T17:09:38",
                "date_modified_gmt": "2021-02-25T04:09:38",
                "description": "<p><strong>20L</strong> &nbsp;440 (D) x 830 (H) mm; 14kg</p>\n",
                "permalink": "https://www.oursite.com/nz/product/hydropress-20l-40l/?attribute_sizes=20L",
                "sku": "SP22620-01",
    ...
                "tax_class": "",
                "manage_stock": "parent",
                "stock_quantity": 0,
                "in_stock": false,
                "backorders": "no",
                "backorders_allowed": false,
                "backordered": false,
                "weight": "",
                "dimensions": {
                    "length": "",
                    "width": "",
                    "height": ""
                },
                "shipping_class": "nz-freight-included",
                "shipping_class_id": 178,
                "image": {
    ...            },
                "attributes": [
    ...
                }
            }
        ]
    }

    ie response is valid but stock remains at zero.

    Why?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Damianne P (a11n)

    (@drwpcom)

    Hi @paulvc. Sorry that we missed your post. If you are trying to set the stock_quantity, then manage_stock should be true.

    I hope that helps!

    Thread Starter paulvc

    (@paulvc)

    We figured it out. manage_stock was set on the parent but not on the variations.
    But thanks.

    • This reply was modified 3 years, 11 months ago by paulvc.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘stock_quantity not updating’ is closed to new replies.