Announcement

Collapse
No announcement yet.

JSON API & product inventory - retrieving total, available, and basket reserved

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    JSON API & product inventory - retrieving total, available, and basket reserved

    I'm trying to re-write some functions for our ERP tie-in using the JSON API vs. our current standalone .mvc code that doesn't work with the database encryption implemented several months ago. We currently pull 3 values for product inventory into our system. These values are pulled on a single product at a time.

    Total Inventory
    Available Inventory
    Quantity currently in customer's baskets

    What I have found so far is:
    The value returned from the ProductList_Load_Query is Available Inventory
    The value set by the Product_Update is Total Inventory

    I have been unable to find a way to determine the quantity of a product reserved by customer's baskets, either directly or indirectly, or even retrieve the Total Inventory. Am I missing something? I had hoped that the Inventory returned by the ProductList_Load_Query would be more of a structure vs. a single value, but sadly it isn't.

    So far, the only way I see is to move our current MivaScript code to our in-store module, and add the recently introduced Module Integration features to it. But would rather use the API if possible.

    #2
    Miva does not have a way to pull that data using the JSON API however Miva does have the ability to deduct inventory when the product is added to the basket. Under Catalog > Inventory there is a setting labeled "Remove Product from Available Inventory" which can be updated to "When Added to Basket". Will using this setup elevate the need to determine the inventory in the basket?
    Nicholas Adkins
    Technical Training Specialist / Miva, Inc.
    [email protected]
    https://www.miva.com/mivalearn

    Comment


      #3
      We have that set as you suggested. That works well for in store inventory management for low stock items to ensure customers can't order more than what is available. But in this case we are working on our code to post additions (or deductions) to inventory such as a return or new stock that has arrived. We always query the inventory level in Miva before posting the update just to be safe, and as a flag in case our ERP's inventory count doesn't match Miva's. That way we can make the adjustment in our ERP, and our backend code posts the same update to Miva.

      Comment

      Working...
      X