• Resolved Nordic Custom Made

    (@nordiccustommade)


    Hi,
    We use a service that syncs the stock between the webshop and a physics store.
    When a stock number is changed in this service, the Rest API is used to update the product’s stock status in the webshop.
    We use Webhooks to update stock status in this service when a product is updated.

    Unfortunately, we find that webhook sends the old stock number over to the service when a product is updated using the Rest API.

    We have been in contact with WooCommerce support and unfortunately they could not help us.

    Are there any who have experienced something similar and possibly have a solution to the problem or how we can supress the webhook?
    Or are there some who know if it is possible to stop a webhook to be run if a product has been updated through the Rest API, and possibly have a guide on how to do this?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hey @nordiccustommade,

    Thanks for reaching out. I want to make sure that I’m following you here. As I understand it, you’re updating a product via the REST API. That’s working as expected.

    Then a webhook is triggered by the product.updated topic and this webhook does not have the updated stock levels. Is that right?

    I tried duplicating this on my test site and I could not. To test I set up a webhook using Webhook.site and the product.updated topic. Then I sent a PUT request to update the stock level of a product.

    When I send the PUT request, the webhook is sending the updated stock level to the site.

    If you’re using a different method, let me know.

    Mirko P.

    (@rainfallnixfig)

    Hey there!

    We haven’t heard back from you in a while, so I’m going to mark this as resolved – we’ll be here if and/or when you are ready to continue.

    Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Stock number issues with Rest API and webhooks’ is closed to new replies.