Method Community

 

Using Method API to update ecommerce site

Last post 08-03-2012 10:10 AM by Method_David. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 08-01-2012 5:10 PM

    Using Method API to update ecommerce site

    We are in the process of evaluating a new e-commerce store hosting software. My question is that can we use Method API to link up with an store’s API? Here are what we would like to do. Initial: Transfer all of product data from our current store to the new store via file export/import. We then would like to use the APIs to turn off all products that has qty of 0 in method. After the new store is build out use Method API to dynamically control the quantity and price in the new store so basically Method will control our inventory. We have already use Method to build a portal for our wholesale customer and would like to have our retail operation to be more tightly control by method. Thank you.

    Jason
    Chowrentoys.com
  • 08-03-2012 10:10 AM In reply to

    Re: Using Method API to update ecommerce site

    Answer

    Hi Chowrentoys.com

    You cannot use Method API to invoke the functions of another API. What you need to do is invoke each API's functions as needed.

    I'll illustrate with a brief example in C#(assuming you have all the webservice references added already)

    MethodAPI to get products with quantity of 0

    MethodAPI.MethodAPISelect_DataSetV2(CompanyAccount, Login, Password, ref InventoryDS, "", "YourInventoryTable", "Recordid", "qty = 0", "", "", "");

    When processing this dataset you would then invoke the Store API to turn off each item in the dataset.

     

    The same sort of set up is needed when you process an order.

    Use the Store API  to get what was sold

    Use MethodAPI to update quantiy on hand (for let's say product 75, you now have 5 items left)

    string[ arrUpdateFieldsArray = new string[ { "Quantity on hand" };
    string[ arrUpdateValueArray = new string[ { "5" };   

    MethodAPI.MethodAPIUpdateV2(CompanyAccount, Login, Password, "", "YourInventoryTable", arrUpdateFieldsArray, arrUpdateValueArray, "75")

     

    Dave

Page 1 of 1 (2 items)