No announcement yet.

Product Quantity with the REST API

  • Filter
  • Time
  • Show
Clear All
new posts

  • Product Quantity with the REST API

    One thing we still use the basic SOAP API for is the UpdateProductInventory call to change the quantity. The reason is that you just send the productid (our SKU) and the quantity and it doesn't matter if the quantity you are changing is for a regular product or you are changing quantities on and advanced option. Last I checked with the REST API there are different calls for updating the quantity depending on if it is a normal product, or has advanced options, etc.

    Does the REST API have the same functionality somewhere? Is there a single call that can be made to change the quantity of a product and not have to consider if it has advanced options or not?

  • #2
    We have to do different calls depending on the type of product, so when updating inventory I have to do it in 3 steps:

    1. Normal Items

    Send the PUT request to /Products with the SKU and the Quantity.

    2. Advanced Options

    Send the PUT request to /Products/{catalogid}/AdvancedOptions/{advancedoptioncode}

    3. Recalculate the Quantity for the Base product of the Advanced Options.

    The base item does not update it's quantity when you change the quantity of an advanced option. So I have to add up all the Quantity of all Advanced Options for the item then save that value using Step 1.

    That's the way we are currently doing it. If someone has a better way, let me know.