• Resolved rshreve

    (@rshreve)


    Hello! I’m hoping somebody can point me in the right direction as I now spent hours just trying to debug this with no luck. I have a Woocommerce webhook created that has worked great until about 2 days ago. Suddenly, I noticed webhook-delivery logs were showing errors showing the webhook “body” that is supposed to include the entire payload of order details which are then being sent to my custom app api endpoint was showing the below value instead of the order details:

    {\"code\":\"rest_no_route\",\"message\":\"No route was found matching the URL and request method.\",\"data\":{\"status\":404}}

    I have looked at every possible server log I can, tried to find the best ways to debug rest api requests, nothing seems to be pointing me in the right direction. It’s almost as if the webhook tries to run and at that time, it tries to grab the order information the use in the “body” by using the WP rest api but it is not available so it’s as if the route the webhook uses to get the order payload is not available or responding so the value of “body” is the error from the WP Rest API which is then sending to my custom app endpoint and failing because it’s missing all the order data.

    • This topic was modified 1 month, 2 weeks ago by rshreve.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter rshreve

    (@rshreve)

    This is the main part of the entry of the webhook-deliveries log showing the error message. The truncated part is the body of my custom apps response since it’s throwing errors due to missing order info.

    2024-10-04T07:38:20+00:00 Info Array
    (
    [Webhook Delivery] => Array
    (
    [Delivery ID] => a6b370fd4e8983c83b9ddbf5a0548b58
    [Date] => Oct 4, 2024 @ 7:38
    [URL] => https://[redacted].com/api/orders/update
    [Duration] => 0.88327
    [Request] => Array
    (
    [Method] => POST
    [Headers] => Array
    (
    [User-Agent] => WooCommerce/9.3.3 Hookshot (WordPress/6.6.2)
    [Content-Type] => application/json
    [X-WC-Webhook-Source] => https://[redacted].com/
    [X-WC-Webhook-Topic] => order.updated
    [X-WC-Webhook-Resource] => order
    [X-WC-Webhook-Event] => updated
    [X-WC-Webhook-Signature] => DE0dOaWhRLOsoLuzyGyba1hBuvtOLyfy+RmnbDQvxFc=
    [X-WC-Webhook-ID] => 2
    [X-WC-Webhook-Delivery-ID] => a6b370fd4e8983c83b9ddbf5a0548b58
    )

    )

    [Body] => {\"code\":\"rest_no_route\",\"message\":\"No route was found matching the URL and request method.\",\"data\":{\"status\":404}}
    [Response] => Array
    (
    [Code] => 500
    [Message] => Internal Server Error
    [Headers] => WpOrg\Requests\Utility\CaseInsensitiveDictionary Object
    (
    [data:protected] => Array
    (
    [server] => nginx
    [date] => Fri, 04 Oct 2024 07:38:20 GMT
    [content-type] => text/html; charset=UTF-8
    [cache-control] => no-cache, private
    [pragma] => no-cache
    [expires] => -1
    [x-ratelimit-limit] => 60
    [x-ratelimit-remaining] => 59
    [access-control-allow-origin] => *
    )

    )

    [Body] =>

    //////// TRUCATED INTENTIONALLY /////////
    Plugin Support RK a11n

    (@riaanknoetze)

    Hi there,

    This might be a silly question but just to check: Is your endpoint at https://[redacted].com/api/orders/update definitely up & running? Can you access it separately using something like Postman or similar?

    In addition, has something changed on your store recently? Perhaps an update to a newer version of WooCommerce? I’m asking as the legacy WooCommerce REST API was deprecated (but is still available via a plugin (more information here).

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.