• Resolved buddudevelopers

    (@buddudevelopers)


    Hi,
    I want to noninteractively setup woocommerce restapi key with read-write privileges, then use the restapi to non interactively create products.

    I tried this method, but it seems more like a hack and it randomly stopped accepting the key, however manually creating another key in the woocommerce settings works. How do you guys noninteractively setup woocommerce rest api apps for example in docker where you dont have the luxury of manual intervention. (I am using ubuntu 20.08, apache2)

    cd /var/www/html/ && sudo -u www-data wp eval 'global $wpdb;echo $wpdb->insert($wpdb->prefix . "woocommerce_api_keys", array("user_id" => 1,"description" => "mykey","permissions" => "read_write","consumer_key"=> "ck_79c7d49f6897af872045a07eccdd9b256be11c9b","consumer_secret" => "cs_c39a85a79410a975d55b8e940d8134e31620c4dc","truncated_key" => substr("cs_c39a85a79410a975d55b8e940d8134e31620c4dc", -7)));')

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to noninteractively create woocommerce Rest API key’ is closed to new replies.