• Resolved Tushar Tajane

    (@tushonline)


    Case 1: Product A: Locations assigned manually to product with stock level 0. When we use the API to set the stock quantity – the response code is ‘1

    Case 2: Product B-Z: Locations assigned using csv upload using wp all import. The locations show as assigned in product edit screen. However, when we use the API to update stock levels, the response code shows ‘1823533’ or random

    Product edit screen set-up looks exactly the same. But Case1 works every time the stock update happens, but Case2 never goes through.

    Please advise

Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Author Fahad Mahmood

    (@fahadmahmood)

    Maybe you are not observing the column name for the stock. Please paste here the column name in the CSV file for the product you are importing.

    Thread Starter Tushar Tajane

    (@tushonline)

    We only used csv to assign multiple locations for products.

    For stock updates, we are trying to use the API

    Plugin Author Fahad Mahmood

    (@fahadmahmood)

    API endpoints are clear, so that method will work for sure but CSV import require correct meta keys to be updated against the product IDs.

    Thread Starter Tushar Tajane

    (@tushonline)

    Here is the csv header used https://paste.pics/d8a189bee877caf438ff62cf9e8321d1

    Anything else needed to be updated?

    Plugin Author Fahad Mahmood

    (@fahadmahmood)

    I don’t understand it exactly, I think you should export a file first having location selected, stock values entered so you can see the relevant column names exported. That would help you to understand what needs to import.

    Thread Starter Tushar Tajane

    (@tushonline)

    Sorry for any confusion. Let me rephrase.

    We have a few products for which we get the positive/correct API response and, for some products we see random digits (as mentioned in op) as API response.

    Plugin Author Fahad Mahmood

    (@fahadmahmood)

    i am really not getting it

    Thread Starter Tushar Tajane

    (@tushonline)

    Can you tell me which meta key is required for the csv column to update the stock?

    Plugin Author Fahad Mahmood

    (@fahadmahmood)

    Meta key name varies according to the location ID for each product, kindly try an export first and see the column names (meta_keys) actually used for the stock value against each product.

    Thread Starter Tushar Tajane

    (@tushonline)

    Hi

    Here is an exported csv file to see how much stock is available for different locations.

    Now, when we use API to set the stock value to any particular location using as follows: https://paste.pics/7d16af8333dbff06953d16fa765e6b2e

    We see this type of response for both locations shown above: https://paste.pics/2d2df6defdaefda887dad5fa8cd09c8b

    When we see such response – the stock for specified location don’t update.

    Please note that: we do not want to use CSV to upload the stock for each location because, we want to pull stock data from our erp and push that every hour to the woocommerce using your plugin.

    Does this clarify further on issue we facing?

    Plugin Author Fahad Mahmood

    (@fahadmahmood)

    Dear Tushar,

    I have tested it, everything is working as expected. Kindly check your end again.
    https://youtu.be/8XluFJbttsQ

    Thread Starter Tushar Tajane

    (@tushonline)

    Thank you for taking time & sharing the test.

    However, in our case – true response shows up randomly for one of the locations but 99% of the time, the response shows either as false or as random digit numbers.

    Based on your test result, I did the following.

    1. Unchecked stock locations assigned for the sku: 935
    2. Reduced stock to 0
    3. Re-assigned locations and updated the product, manage stock = yes
    4. Stock for all locations is now 0
    5. Updated the product
    6. Ran the following for 3443, 3436 and 3433 using location IDs and SKU: ?slw-api&id=935&stock_value=10&action=set&item=stock&format=json&product_id=935&location_id=3443
    7. Result: for all three attempts, the result was {"response":false}
    8. Ran the following for 3443, 3436 and 3433 using location IDs and Product ID (not SKU): ?slw-api&id=537&stock_value=10&action=set&item=stock&format=json&product_id=537&location_id=3443
    9. Result: for all three attempts, the result was {"response":true}

    It’s working when using product id and not working using sku

    Plugin Author Fahad Mahmood

    (@fahadmahmood)

    But SKU wasn’t mentioned anywhere in the plugin API/Developers section, why are you trying SKU? This thread topic should be changed to the following “API endpoints are not working with SKU instead of ID”, Tushar, seriously it was a kind of experiment or a new feature request but not the bug report. You know why ID and product_id two parameters are given? Because sometimes when we update a variable product so ID would be variation ID and product_id will remain the product_id. Excuse me.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Array [response] => 1823533’ is closed to new replies.