• I am using the WooCommerce API endpoint for updating a order status to “completed” but I get this error:

    Error: Sorry, you are not allowed to edit this resource

    I am using the new WC API version 1 (and not the old legacy WordPress API versions 2 or 3).

    I use this:

    $woocommerce = new Client(
        'https://www.xxxxxxxxxxxxxx.dk/', 
        'ck_xxxxxxxxxx', 
        'cs_xxxxxxxxxx',
        [
            'wp_api' => true,
            'version' => 'wc/v1',
        ]
    );
    
    $data = [
        'status' => 'completed'
    ];
    
    print_r($woocommerce->put('orders/5490', $data));

    I have checked that the API key in WooCommerce has “read/write” permissions and that the user connected to the API key is an admin (if that has anything to say).

    I am using HTTPS / SSL.

    Can anyone tell me how to fix this error?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi jenskirk,

    I am experiencing the same problem.

    Did you find a resolution in your case?

    Thread Starter jenskirk

    (@jenskirk)

    I found this solution and it is working ??

    I inserted this into .htaccees in the start of the rewrite block:

    <IfModule mod_rewrite.c>
    RewriteEngine On

    RewriteRule .* – [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    And now it is not giving the error ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘API Endpoint saying: “Error: Sorry, you are not allowed to edit this resource”’ is closed to new replies.