Skip to content

error 401 - woocommerce_rest_cannot_view in localhost #344

@ghost

Description

I am encountering authentication issues while trying to access the WooCommerce REST API over HTTP in a local development environment. The API consistently returns a 401 Unauthorized error, indicating a problem with the authentication process.

{"code":"woocommerce_rest_cannot_view","message":"Sorry, you cannot list resources.","data":{"status":401}}

i checked and change ck_your_consumer_key:cs_your_consumer_secret is ok but i got error.

i use wordpress in mac xampp with PHP 8.3

$this->client = new Client(
            $this->baseUrl,
            $this->ck,
            $this->cs,
            [
                'wp_api' => true,
                'version' => 'wc/v3',
                'timeout' => 0
            ]
        );

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions