How to update “inventory_level” of product by sku id in Bigcommerce?

前端 未结 2 403
名媛妹妹
名媛妹妹 2021-01-01 03:20

I am trying to update the inventory level of a products but unfortunately not getting success.Here is my code. I want to update product\'s "inventory_level" but e

相关标签:
2条回答
  • 2021-01-01 03:33

    I am trying to do the same thing (different programming language). I have a call into their support. It seems like you still must reference the product_id.

    You cannot update simply by SKU. You must know the product_id. I got around this by requesting all products and loading the response into an array (product_id, sku, etc.). I then read thru the array, get the quantity from our system using the SKU, and post (PUT) the inventory_level using the associated product_id.

    IMHO this is a huge oversight on their part. Who cares what the product_id is on the website?

    I have asked for an enhancement that allows updating by SKU.

    0 讨论(0)
  • 2021-01-01 03:49

    No need to download ALL products, why not retrieve JUST the product that has the sku you need?

    GET: /api/v2/products?sku=sku-that-I'm-interested-in
    

    parse the response for the id (that's the product ID for the product with that SKU)

    Then do a PUT using that product ID.

    0 讨论(0)
提交回复
热议问题