• Resolved ankur89

    (@ankur89)


    Hello
    we are using woocommerce api for some purpose but this showing error on this link (https://www.kiransboutique.com/api/api_single_product.php)
    ( Fatal error: Uncaught Automattic\WooCommerce\HttpClient\HttpClientException: JSON ERROR: Syntax error in /home/509781.cloudwaysapps.com/nfkyzbddyz/public_html/api/vendor/automattic/woocommerce/src/WooCommerce/HttpClient/HttpClient.php:378 Stack trace: #0 /home/509781.cloudwaysapps.com/nfkyzbddyz/public_html/api/vendor/automattic/woocommerce/src/WooCommerce/HttpClient/HttpClient.php(422): Automattic\WooCommerce\HttpClient\HttpClient->processResponse() #1 /home/509781.cloudwaysapps.com/nfkyzbddyz/public_html/api/vendor/automattic/woocommerce/src/WooCommerce/Client.php(82): Automattic\WooCommerce\HttpClient\HttpClient->request(‘products/88963’, ‘GET’, Array, Array) #2 /home/509781.cloudwaysapps.com/nfkyzbddyz/public_html/api/api_single_product.php(40): Automattic\WooCommerce\Client->get(‘products/88963’) #3 {main} thrown in /home/509781.cloudwaysapps.com/nfkyzbddyz/public_html/api/vendor/automattic/woocommerce/src/WooCommerce/HttpClient/HttpClient.php on line 378 )
    I am follow this link for setup.
    https://packagist.org/packages/automattic/woocommerce

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi @ankur89,

    This exception is because of “Syntax error” on JSON, so probably your website is throwing HTML in the response. This happens in most of the cases when PHP errors are being thrown on the site, someone forgot to disable PHP’s display_errors. Still, I recommend you to read the errors in the error log of your website and fix these before trying to use the REST API.

    Cheers

    Hi @ankur89,

    Since we haven’t heard from you in a while, we’re hoping that means you were able to get this resolved. I’m going to close this thread out now.

    If you’re still having trouble, please open up a new topic and we’ll be happy to help out.

    Take care

    Please am also experiencing this issue on Localhost, please any advice as regarding what the cause might be?

    Am using the PHP library here https://packagist.org/packages/automattic/woocommerce

    same problem for me.. worked weeks ago without any problems.

    Solution : Just change default settings for permalink in /wp-admin/options-permalink.php

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Uncaught Automattic\WooCommerce\HttpClient\HttpClientException: JSON ERROR:’ is closed to new replies.